CMakeLists.txt
上传用户:gb3593
上传日期:2022-01-07
资源大小:3028k
文件大小:5k
源码类别:

游戏引擎

开发平台:

Visual C++

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