CMakeLists.txt 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. # set up common includes
  2. INCLUDE(PolycodeIncludes)
  3. SET(polycore_SRCS
  4. Source/OSBasics.cpp
  5. Source/PolyBezierCurve.cpp
  6. Source/PolyBone.cpp
  7. Source/PolyCamera.cpp
  8. Source/PolyColor.cpp
  9. Source/PolyConfig.cpp
  10. Source/PolyCore.cpp
  11. Source/PolyCoreInput.cpp
  12. Source/PolyCoreServices.cpp
  13. Source/PolyCubemap.cpp
  14. Source/PolyData.cpp
  15. Source/PolyEntity.cpp
  16. Source/PolyEvent.cpp
  17. Source/PolyEventDispatcher.cpp
  18. Source/PolyEventHandler.cpp
  19. Source/PolyFixedShader.cpp
  20. Source/PolyFont.cpp
  21. Source/PolyFontGlyphSheet.cpp
  22. Source/PolyFontManager.cpp
  23. Source/PolyGLCubemap.cpp
  24. Source/PolyGLRenderer.cpp
  25. Source/PolyGLSLProgram.cpp
  26. Source/PolyGLSLShader.cpp
  27. Source/PolyGLSLShaderModule.cpp
  28. Source/PolyGLTexture.cpp
  29. Source/PolyGLVertexBuffer.cpp
  30. Source/PolyImage.cpp
  31. Source/PolyInputEvent.cpp
  32. Source/PolyLabel.cpp
  33. Source/PolyLogger.cpp
  34. Source/PolyMaterial.cpp
  35. Source/PolyMaterialManager.cpp
  36. Source/PolyMatrix4.cpp
  37. Source/PolyMesh.cpp
  38. Source/PolyModule.cpp
  39. Source/PolyObject.cpp
  40. Source/PolyParticleEmitter.cpp
  41. Source/PolyPerlin.cpp
  42. Source/PolyQuaternion.cpp
  43. Source/PolyQuaternionCurve.cpp
  44. Source/PolyRectangle.cpp
  45. Source/PolyRenderer.cpp
  46. Source/PolyRenderDataArray.cpp
  47. Source/PolyResource.cpp
  48. Source/PolyResourceManager.cpp
  49. Source/PolyScene.cpp
  50. Source/PolySceneLabel.cpp
  51. Source/PolySceneLight.cpp
  52. Source/PolySceneLine.cpp
  53. Source/PolySceneManager.cpp
  54. Source/PolySceneMesh.cpp
  55. Source/PolyScenePrimitive.cpp
  56. Source/PolySceneImage.cpp
  57. Source/PolySceneRenderTexture.cpp
  58. Source/PolySceneSound.cpp
  59. Source/PolyShader.cpp
  60. Source/PolySkeleton.cpp
  61. Source/PolySound.cpp
  62. Source/PolySoundManager.cpp
  63. Source/PolyString.cpp
  64. Source/PolyTextMesh.cpp
  65. Source/PolyTexture.cpp
  66. Source/PolyThreaded.cpp
  67. Source/PolyTimer.cpp
  68. Source/PolyTimerManager.cpp
  69. Source/PolyTween.cpp
  70. Source/PolyTweenManager.cpp
  71. Source/PolyVector2.cpp
  72. Source/PolyVector3.cpp
  73. Source/PolyVector4.cpp
  74. Source/tinystr.cpp
  75. Source/tinyxml.cpp
  76. Source/tinyxmlerror.cpp
  77. Source/tinyxmlparser.cpp
  78. Source/PolySocket.cpp
  79. Source/PolyPeer.cpp
  80. Source/PolyClient.cpp
  81. Source/PolyServer.cpp
  82. Source/PolyRay.cpp
  83. Source/PolySceneSprite.cpp
  84. Source/PolySceneEntityInstance.cpp
  85. Source/rgbe.cpp
  86. Include/stb_image.h
  87. )
  88. SET(polycore_HDRS
  89. Include/OSBasics.h
  90. Include/PolyBezierCurve.h
  91. Include/PolyBone.h
  92. Include/PolyCamera.h
  93. Include/Polycode.h
  94. Include/PolyColor.h
  95. Include/PolyConfig.h
  96. Include/PolyCore.h
  97. Include/PolyCoreInput.h
  98. Include/PolyCoreServices.h
  99. Include/PolyCubemap.h
  100. Include/PolyData.h
  101. Include/PolyEntity.h
  102. Include/PolyEventDispatcher.h
  103. Include/PolyEvent.h
  104. Include/PolyEventHandler.h
  105. Include/PolyFixedShader.h
  106. Include/PolyFont.h
  107. Include/PolyFontGlyphSheet.h
  108. Include/PolyFontManager.h
  109. Include/PolyGLCubemap.h
  110. Include/PolyGLHeaders.h
  111. Include/PolyGlobals.h
  112. Include/PolyGLRenderer.h
  113. Include/PolyGLSLProgram.h
  114. Include/PolyGLSLShader.h
  115. Include/PolyGLSLShaderModule.h
  116. Include/PolyGLTexture.h
  117. Include/PolyGLVertexBuffer.h
  118. Include/PolyImage.h
  119. Include/PolyInputEvent.h
  120. Include/PolyInputKeys.h
  121. Include/PolyLabel.h
  122. Include/PolyLogger.h
  123. Include/PolyMaterial.h
  124. Include/PolyMaterialManager.h
  125. Include/PolyMatrix4.h
  126. Include/PolyMesh.h
  127. Include/PolyModule.h
  128. Include/PolyObject.h
  129. Include/PolyParticleEmitter.h
  130. Include/PolyPerlin.h
  131. Include/PolyQuaternionCurve.h
  132. Include/PolyQuaternion.h
  133. Include/PolyRectangle.h
  134. Include/PolyRenderer.h
  135. Include/PolyRenderDataArray.h
  136. Include/PolyResource.h
  137. Include/PolyResourceManager.h
  138. Include/PolyScene.h
  139. Include/PolySceneLabel.h
  140. Include/PolySceneLight.h
  141. Include/PolySceneLine.h
  142. Include/PolySceneManager.h
  143. Include/PolySceneMesh.h
  144. Include/PolyScenePrimitive.h
  145. Include/PolySceneImage.h
  146. Include/PolySceneRenderTexture.h
  147. Include/PolySceneSound.h
  148. Include/PolyShader.h
  149. Include/PolySkeleton.h
  150. Include/PolySound.h
  151. Include/PolySoundManager.h
  152. Include/PolyString.h
  153. Include/PolyTextMesh.h
  154. Include/PolyTexture.h
  155. Include/PolyThreaded.h
  156. Include/PolyTimer.h
  157. Include/PolyTimerManager.h
  158. Include/PolyTween.h
  159. Include/PolyTweenManager.h
  160. Include/PolyVector2.h
  161. Include/PolyVector3.h
  162. Include/PolyVector4.h
  163. Include/tinystr.h
  164. Include/tinyxml.h
  165. Include/PolySocket.h
  166. Include/PolyPeer.h
  167. Include/PolyClient.h
  168. Include/PolyServer.h
  169. Include/PolyServerWorld.h
  170. Include/PolyRay.h
  171. Include/PolySceneSprite.h
  172. Include/PolySceneEntityInstance.h
  173. Include/rgbe.h
  174. Include/stb_image.h
  175. )
  176. SET(CMAKE_DEBUG_POSTFIX "_d")
  177. # TODO: iPhone
  178. # Include/PolyiPhoneCore.h
  179. # Include/Poly_iPhone.h
  180. # Source/PolyiPhoneCore.cpp
  181. # TODO: PolyGLES1
  182. # Include/PolyGLES1Renderer.h
  183. # Include/PolyGLES1Texture.h
  184. # Source/PolyGLES1Renderer.cpp
  185. # Source/PolyGLES1Texture.cpp
  186. # platform specific
  187. IF (MINGW)
  188. SET(polycore_SRCS ${polycore_SRCS}
  189. Source/GLee.cpp
  190. )
  191. ENDIF(MINGW)
  192. INCLUDE(FindPkgConfig)
  193. IF(MSVC OR MINGW)
  194. SET(polycore_SRCS ${polycore_SRCS} PolycodeView/MSVC/PolycodeView.cpp Source/PolyWinCore.cpp)
  195. SET(polycore_HDRS ${polycore_HDRS} PolycodeView/MSVC/PolycodeView.h Include/PolyWinCore.h)
  196. ELSEIF(APPLE)
  197. SET(polycore_SRCS ${polycore_SRCS} "PolycodeView/Mac OS X/PolycodeView.mm" Source/PolyCocoaCore.mm)
  198. SET(polycore_HDRS ${polycore_HDRS} "PolycodeView/Mac OS X/PolycodeView.h" Include/PolyCocoaCore.h)
  199. # SET(EXTRA_LIBS "-framework Cocoa")
  200. ELSE(MSVC OR MINGW)
  201. SET(polycore_SRCS ${polycore_SRCS} PolycodeView/Linux/PolycodeView.cpp Source/PolySDLCore.cpp)
  202. SET(polycore_HDRS ${polycore_HDRS} PolycodeView/Linux/PolycodeView.h Include/PolySDLCore.h)
  203. ENDIF(MSVC OR MINGW)
  204. #IF(POLYCODE_BUILD_SHARED)
  205. # ADD_LIBRARY(Polycore_dynamic SHARED ${polycore_SRCS} ${polycore_HDRS})
  206. # TARGET_LINK_LIBRARIES(Polycore_dynamic
  207. # ${OPENGL_LIBRARIES}
  208. # ${OPENAL_LIBRARY}
  209. # ${PNG_LIBRARIES}
  210. # ${FREETYPE_LIBRARIES}
  211. # ${PHYSFS_LIBRARY}
  212. # ${OGG_LIBRARIES}
  213. # ${VORBIS_LIBRARIES}
  214. # ${VORBISFILE_LIBRARIES}
  215. # ${SDL_LIBRARY}
  216. # ${EXTRA_LIBS})
  217. #ENDIF(POLYCODE_BUILD_SHARED)
  218. #IF(POLYCODE_BUILD_STATIC)
  219. ADD_LIBRARY(Polycore ${polycore_SRCS} ${polycore_HDRS})
  220. #ENDIF(POLYCODE_BUILD_STATIC)
  221. # On linux, check for x11
  222. IF("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  223. # TODO: Allow to set X11 path manually instead of using pkg-config
  224. IF(NOT ${PKG_CONFIG_FOUND})
  225. message( FATAL_ERROR "You seem to be using Linux, but pkg-config is not installed. Please install pkg-config." )
  226. endif()
  227. PKG_CHECK_MODULES(X11 x11)
  228. IF(${X11_FOUND})
  229. INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})
  230. SET_TARGET_PROPERTIES(Polycore PROPERTIES COMPILE_FLAGS "-DUSE_X11")
  231. ELSE()
  232. message( FATAL_ERROR "You seem to be using Linux, but X11 is not installed. Please install X11." )
  233. ENDIF()
  234. ENDIF()
  235. IF(POLYCODE_INSTALL_FRAMEWORK)
  236. # install headers
  237. INSTALL(FILES ${polycore_HDRS}
  238. DESTINATION Core/include)
  239. IF(MSVC OR MINGW)
  240. INSTALL(FILES "PolycodeView/MSVC/PolycodeView.h" "PolycodeView/MSVC/PolycodeView.cpp"
  241. DESTINATION "Core/PolycodeView")
  242. ELSEIF(APPLE)
  243. INSTALL(FILES "PolycodeView/Mac OS X/PolycodeView.h" "PolycodeView/Mac OS X/PolycodeView.mm"
  244. DESTINATION "Core/PolycodeView")
  245. ELSE(MSVC OR MINGW)
  246. INSTALL(FILES "PolycodeView/Linux/PolycodeView.h" "PolycodeView/Linux/PolycodeView.cpp"
  247. DESTINATION "Core/PolycodeView")
  248. ENDIF(MSVC OR MINGW)
  249. # install libraries
  250. # IF(POLYCODE_BUILD_SHARED)
  251. # INSTALL(TARGETS Polycore_dynamic EXPORT Polycore-targets
  252. # DESTINATION ${POLYCODE_RELEASE_DIR}/Framework/Core/lib)
  253. # ENDIF(POLYCODE_BUILD_SHARED)
  254. # IF(POLYCODE_BUILD_STATIC)
  255. INSTALL(TARGETS Polycore EXPORT Polycore-targets
  256. DESTINATION Core/lib)
  257. # ENDIF(POLYCODE_BUILD_STATIC)
  258. ENDIF(POLYCODE_INSTALL_FRAMEWORK)
  259. IF(POLYCODE_INSTALL_PLAYER)
  260. # install core libs for player
  261. # IF(POLYCODE_BUILD_SHARED)
  262. # INSTALL(TARGETS Polycore_dynamic DESTINATION ${POLYCODE_RELEASE_DIR}/Player)
  263. # END(POLYCODE_BUILD_SHARED)
  264. # INSTALL(DIRECTORY ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/bin/
  265. # DESTINATION ${POLYCODE_RELEASE_DIR}/Player)
  266. ENDIF(POLYCODE_INSTALL_PLAYER)