2
0

CMakeLists.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # This CMakeLists.txt is a cross-platform alternative to the $Polycode/IDE/Build/$OS
  2. # build systems.
  3. #
  4. # It also demonstrates how Polycode projects other than the IDE can be built.
  5. # First a few variables need to be set:
  6. # * POLYCODE_ROOT_DIR
  7. # * POLYCODE_RELEASE_DIR
  8. # * POLYCODE_CMAKE_DIR
  9. # * CMAKE_INSTALL_PREFIX
  10. # Then we can simply include ${POLYCODE_CMAKE_DIR}/PolycodeDependencies.cmake
  11. # After that, ${POLYCODE_DEPENDENCY_LIBS} will be set to the paths of our required
  12. # link libraries, which we can simply add to our IDE project with TARGET_LINK_LIBRARIES
  13. CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
  14. PROJECT(PolycodeIDE)
  15. SET(POLYCODE_ROOT_DIR ${PolycodeIDE_SOURCE_DIR}/../../)
  16. SET(POLYCODE_RELEASE_DIR ${POLYCODE_ROOT_DIR}/Release/${CMAKE_SYSTEM_NAME})
  17. SET(POLYCODE_CMAKE_DIR ${POLYCODE_ROOT_DIR}/CMake)
  18. SET(CMAKE_INSTALL_PREFIX ${POLYCODE_RELEASE_DIR}/Standalone/)
  19. SET(CMAKE_PREFIX_PATH
  20. ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies
  21. ${POLYCODE_RELEASE_DIR}/Framework/Modules/Dependencies
  22. ${POLYCODE_RELEASE_DIR}/Framework/Tools/Dependencies)
  23. SET(CMAKE_DEBUG_POSTFIX "_d")
  24. SET(CMAKE_MODULE_PATH ${POLYCODE_ROOT_DIR}/CMake)
  25. INCLUDE(${POLYCODE_CMAKE_DIR}/PolycodeDependencies.cmake)
  26. IF(MSVC OR MINGW)
  27. SET(MAIN_CPP ../Build/Windows/main.cpp)
  28. ELSEIF(APPLE)
  29. MESSAGE("Target system not currently supported.")
  30. ELSE(MSVC OR MINGW)
  31. SET(MAIN_CPP ../Build/Linux/main.cpp)
  32. ENDIF(MSVC OR MINGW)
  33. SET(PolycodeIDE_SRCS
  34. ${MAIN_CPP}
  35. Source/ExampleBrowserWindow.cpp
  36. Source/PolycodeProject.cpp
  37. Source/ExportProjectWindow.cpp
  38. Source/PolycodeProjectBrowser.cpp
  39. Source/NewFileWindow.cpp
  40. Source/PolycodeProjectEditor.cpp
  41. Source/NewProjectWindow.cpp
  42. Source/PolycodeProjectManager.cpp
  43. Source/PolycodeClipboard.cpp
  44. Source/PolycodeProps.cpp
  45. Source/PolycodeConsole.cpp
  46. Source/PolycodeRemoteDebugger.cpp
  47. Source/PolycodeEditor.cpp
  48. Source/PolycodeScreenEditor.cpp
  49. Source/PolycodeEditorManager.cpp
  50. Source/PolycodeSpriteEditor.cpp
  51. Source/PolycodeFontEditor.cpp
  52. Source/PolycodeTextEditor.cpp
  53. Source/PolycodeFrame.cpp
  54. Source/PolycodeToolLauncher.cpp
  55. Source/PolycodeIDEApp.cpp
  56. Source/SettingsWindow.cpp
  57. Source/PolycodeImageEditor.cpp
  58. Source/TextureBrowser.cpp
  59. Source/PolycodeMaterialEditor.cpp
  60. Source/ToolWindows.cpp
  61. )
  62. SET(PolycodeIDE_HDRS
  63. Include/ExampleBrowserWindow.h
  64. Include/PolycodeFrame.h
  65. Include/PolycodeProps.h
  66. Include/ExportProjectWindow.h
  67. Include/PolycodeGlobals.h
  68. Include/PolycodeRemoteDebugger.h
  69. Include/NewFileWindow.h
  70. Include/PolycodeIDEApp.h
  71. Include/PolycodeScreenEditor.h
  72. Include/NewProjectWindow.h
  73. Include/PolycodeImageEditor.h
  74. Include/PolycodeSpriteEditor.h
  75. Include/PolycodeClipboard.h
  76. Include/PolycodeMaterialEditor.h
  77. Include/PolycodeTextEditor.h
  78. Include/PolycodeConsole.h
  79. Include/PolycodeProject.h
  80. Include/PolycodeToolLauncher.h
  81. Include/PolycodeEditor.h
  82. Include/PolycodeProjectBrowser.h
  83. Include/SettingsWindow.h
  84. Include/PolycodeEditorManager.h
  85. Include/PolycodeProjectEditor.h
  86. Include/TextureBrowser.h
  87. Include/PolycodeFontEditor.h
  88. Include/PolycodeProjectManager.h
  89. Include/ToolWindows.h
  90. )
  91. INSTALL(FILES ${POLYCODE_ROOT_DIR}/LICENSE.txt
  92. DESTINATION ./)
  93. # WIN32 makes it build a GUI application on windows(no effect on other platforms)
  94. ADD_EXECUTABLE(PolycodeIDE WIN32 ${PolycodeIDE_SRCS} ${PolycodeIDE_HDRS})
  95. IF(MSVC OR MINGW)
  96. INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/bin/OpenAL32.dll DESTINATION bin)
  97. INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/default.pak DESTINATION bin)
  98. INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/hdr.pak DESTINATION bin)
  99. INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/api.pak DESTINATION bin)
  100. INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/UI.pak DESTINATION bin)
  101. INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/Physics2D.pak DESTINATION bin)
  102. INSTALL(FILES ${POLYCODE_RELEASE_DIR}/Framework/Player/Physics3D.pak DESTINATION bin)
  103. TARGET_LINK_LIBRARIES(PolycodeIDE
  104. ${POLYCODE_DEPENDENCY_LIBS}
  105. )
  106. ELSEIF(APPLE)
  107. MESSAGE("Target system not currently supported.")
  108. ELSE(MSVC OR MINGW)
  109. TARGET_LINK_LIBRARIES(PolycodeIDE
  110. ${POLYCODE_DEPENDENCY_LIBS}
  111. )
  112. # Install resources etc. after the build is finished
  113. ADD_CUSTOM_COMMAND(TARGET PolycodeIDE POST_BUILD
  114. COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Resources/ ${CMAKE_BINARY_DIR}
  115. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../Release/Linux/Framework/Core/Assets/default.pak ${CMAKE_BINARY_DIR}
  116. COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/../../Release/Linux/Standalone ${CMAKE_BINARY_DIR}/Standalone
  117. )
  118. ENDIF(MSVC OR MINGW)