CMakeLists.txt 7.9 KB

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