blob: 445c248acfa189a1f5b33fa02cfa8c3cf7b0d66d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
set(BOX2D_Collision_SRCS
Collision/b2BroadPhase.cpp
Collision/b2CollideCircle.cpp
Collision/b2CollideEdge.cpp
Collision/b2CollidePolygon.cpp
Collision/b2Collision.cpp
Collision/b2Distance.cpp
Collision/b2DynamicTree.cpp
Collision/b2TimeOfImpact.cpp
)
set(BOX2D_Collision_HDRS
Collision/b2BroadPhase.h
Collision/b2Collision.h
Collision/b2Distance.h
Collision/b2DynamicTree.h
Collision/b2TimeOfImpact.h
)
set(BOX2D_Shapes_SRCS
Collision/Shapes/b2CircleShape.cpp
Collision/Shapes/b2EdgeShape.cpp
Collision/Shapes/b2ChainShape.cpp
Collision/Shapes/b2PolygonShape.cpp
)
set(BOX2D_Shapes_HDRS
Collision/Shapes/b2CircleShape.h
Collision/Shapes/b2EdgeShape.h
Collision/Shapes/b2ChainShape.h
Collision/Shapes/b2PolygonShape.h
Collision/Shapes/b2Shape.h
)
set(BOX2D_Common_SRCS
Common/b2BlockAllocator.cpp
Common/b2Draw.cpp
Common/b2Math.cpp
Common/b2Settings.cpp
Common/b2StackAllocator.cpp
Common/b2Timer.cpp
)
set(BOX2D_Common_HDRS
Common/b2BlockAllocator.h
Common/b2Draw.h
Common/b2GrowableStack.h
Common/b2Math.h
Common/b2Settings.h
Common/b2StackAllocator.h
Common/b2Timer.h
)
set(BOX2D_Dynamics_SRCS
Dynamics/b2Body.cpp
Dynamics/b2ContactManager.cpp
Dynamics/b2Fixture.cpp
Dynamics/b2Island.cpp
Dynamics/b2World.cpp
Dynamics/b2WorldCallbacks.cpp
)
set(BOX2D_Dynamics_HDRS
Dynamics/b2Body.h
Dynamics/b2ContactManager.h
Dynamics/b2Fixture.h
Dynamics/b2Island.h
Dynamics/b2TimeStep.h
Dynamics/b2World.h
Dynamics/b2WorldCallbacks.h
)
set(BOX2D_Contacts_SRCS
Dynamics/Contacts/b2CircleContact.cpp
Dynamics/Contacts/b2Contact.cpp
Dynamics/Contacts/b2ContactSolver.cpp
Dynamics/Contacts/b2PolygonAndCircleContact.cpp
Dynamics/Contacts/b2EdgeAndCircleContact.cpp
Dynamics/Contacts/b2EdgeAndPolygonContact.cpp
Dynamics/Contacts/b2ChainAndCircleContact.cpp
Dynamics/Contacts/b2ChainAndPolygonContact.cpp
Dynamics/Contacts/b2PolygonContact.cpp
)
set(BOX2D_Contacts_HDRS
Dynamics/Contacts/b2CircleContact.h
Dynamics/Contacts/b2Contact.h
Dynamics/Contacts/b2ContactSolver.h
Dynamics/Contacts/b2PolygonAndCircleContact.h
Dynamics/Contacts/b2EdgeAndCircleContact.h
Dynamics/Contacts/b2EdgeAndPolygonContact.h
Dynamics/Contacts/b2ChainAndCircleContact.h
Dynamics/Contacts/b2ChainAndPolygonContact.h
Dynamics/Contacts/b2PolygonContact.h
)
set(BOX2D_Joints_SRCS
Dynamics/Joints/b2DistanceJoint.cpp
Dynamics/Joints/b2FrictionJoint.cpp
Dynamics/Joints/b2GearJoint.cpp
Dynamics/Joints/b2Joint.cpp
Dynamics/Joints/b2MouseJoint.cpp
Dynamics/Joints/b2PrismaticJoint.cpp
Dynamics/Joints/b2PulleyJoint.cpp
Dynamics/Joints/b2RevoluteJoint.cpp
Dynamics/Joints/b2RopeJoint.cpp
Dynamics/Joints/b2WeldJoint.cpp
Dynamics/Joints/b2WheelJoint.cpp
)
set(BOX2D_Joints_HDRS
Dynamics/Joints/b2DistanceJoint.h
Dynamics/Joints/b2FrictionJoint.h
Dynamics/Joints/b2GearJoint.h
Dynamics/Joints/b2Joint.h
Dynamics/Joints/b2MouseJoint.h
Dynamics/Joints/b2PrismaticJoint.h
Dynamics/Joints/b2PulleyJoint.h
Dynamics/Joints/b2RevoluteJoint.h
Dynamics/Joints/b2RopeJoint.h
Dynamics/Joints/b2WeldJoint.h
Dynamics/Joints/b2WheelJoint.h
)
set(BOX2D_Rope_SRCS
Rope/b2Rope.cpp
)
set(BOX2D_Rope_HDRS
Rope/b2Rope.h
)
set(BOX2D_General_HDRS
Box2D.h
)
include_directories( ../ )
if(BOX2D_BUILD_SHARED)
add_library(Box2D_shared SHARED
${BOX2D_General_HDRS}
${BOX2D_Joints_SRCS}
${BOX2D_Joints_HDRS}
${BOX2D_Contacts_SRCS}
${BOX2D_Contacts_HDRS}
${BOX2D_Dynamics_SRCS}
${BOX2D_Dynamics_HDRS}
${BOX2D_Common_SRCS}
${BOX2D_Common_HDRS}
${BOX2D_Shapes_SRCS}
${BOX2D_Shapes_HDRS}
${BOX2D_Collision_SRCS}
${BOX2D_Collision_HDRS}
${BOX2D_Rope_SRCS}
${BOX2D_Rope_HDRS}
)
set_target_properties(Box2D_shared PROPERTIES
OUTPUT_NAME "Box2D"
CLEAN_DIRECT_OUTPUT 1
VERSION ${BOX2D_VERSION}
)
endif()
if(BOX2D_BUILD_STATIC)
add_library(Box2D STATIC
${BOX2D_General_HDRS}
${BOX2D_Joints_SRCS}
${BOX2D_Joints_HDRS}
${BOX2D_Contacts_SRCS}
${BOX2D_Contacts_HDRS}
${BOX2D_Dynamics_SRCS}
${BOX2D_Dynamics_HDRS}
${BOX2D_Common_SRCS}
${BOX2D_Common_HDRS}
${BOX2D_Shapes_SRCS}
${BOX2D_Shapes_HDRS}
${BOX2D_Collision_SRCS}
${BOX2D_Collision_HDRS}
${BOX2D_Rope_SRCS}
${BOX2D_Rope_HDRS}
)
set_target_properties(Box2D PROPERTIES
CLEAN_DIRECT_OUTPUT 1
VERSION ${BOX2D_VERSION}
)
endif()
# These are used to create visual studio folders.
source_group(Collision FILES ${BOX2D_Collision_SRCS} ${BOX2D_Collision_HDRS})
source_group(Collision\\Shapes FILES ${BOX2D_Shapes_SRCS} ${BOX2D_Shapes_HDRS})
source_group(Common FILES ${BOX2D_Common_SRCS} ${BOX2D_Common_HDRS})
source_group(Dynamics FILES ${BOX2D_Dynamics_SRCS} ${BOX2D_Dynamics_HDRS})
source_group(Dynamics\\Contacts FILES ${BOX2D_Contacts_SRCS} ${BOX2D_Contacts_HDRS})
source_group(Dynamics\\Joints FILES ${BOX2D_Joints_SRCS} ${BOX2D_Joints_HDRS})
source_group(Include FILES ${BOX2D_General_HDRS})
source_group(Rope FILES ${BOX2D_Rope_SRCS} ${BOX2D_Rope_HDRS})
if(BOX2D_INSTALL)
# install headers
install(FILES ${BOX2D_General_HDRS} DESTINATION include/Box2D)
install(FILES ${BOX2D_Collision_HDRS} DESTINATION include/Box2D/Collision)
install(FILES ${BOX2D_Shapes_HDRS} DESTINATION include/Box2D/Collision/Shapes)
install(FILES ${BOX2D_Common_HDRS} DESTINATION include/Box2D/Common)
install(FILES ${BOX2D_Dynamics_HDRS} DESTINATION include/Box2D/Dynamics)
install(FILES ${BOX2D_Contacts_HDRS} DESTINATION include/Box2D/Dynamics/Contacts)
install(FILES ${BOX2D_Joints_HDRS} DESTINATION include/Box2D/Dynamics/Joints)
install(FILES ${BOX2D_Rope_HDRS} DESTINATION include/Box2D/Rope)
# install libraries
if(BOX2D_BUILD_SHARED)
install(TARGETS Box2D_shared EXPORT Box2D-targets DESTINATION lib)
endif()
if(BOX2D_BUILD_STATIC)
install(TARGETS Box2D EXPORT Box2D-targets DESTINATION lib)
endif()
# install build system hooks for third-party apps
install(EXPORT Box2D-targets DESTINATION lib/Box2D)
install(FILES Box2DConfig.cmake DESTINATION lib/Box2D)
endif(BOX2D_INSTALL)
|