CMakeLists.txt 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. project (Atomic)
  2. cmake_minimum_required(VERSION 2.8.12.1)
  3. set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/Build/CMake/Modules)
  4. include(AtomicGit)
  5. include(AtomicUtils)
  6. add_definitions(-DATOMIC_ROOT_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -DATOMIC_ROOT_BUILD_DIR="${CMAKE_BINARY_DIR}")
  7. add_definitions( -DATOMIC_API= -DATOMIC_STATIC_DEFINE -DATOMIC_ATOMIC2D -DATOMIC_LOGGING -DATOMIC_PROFILING)
  8. if (NOT DEFINED ATOMIC_DEV_BUILD)
  9. set(ATOMIC_DEV_BUILD 1)
  10. ENDIF()
  11. if (ATOMIC_DEV_BUILD)
  12. add_definitions("-DATOMIC_DEV_BUILD=1")
  13. endif()
  14. # Disable until https://github.com/AtomicGameEngine/AtomicGameEngine/issues/554 is addressed
  15. # add_definitions("-DATOMIC_SOURCE_BUILD=1")
  16. # this is here as QtCreator is having trouble picking up #include <Atomic/*> without it
  17. include_directories(${CMAKE_SOURCE_DIR}/Source ${CMAKE_SOURCE_DIR}/Source/AtomicEditor/Source)
  18. set (ATOMIC_LINK_LIBRARIES Atomic Box2D Duktape TurboBadger FreeType JO LZ4 PugiXml STB SDL)
  19. if (NOT ATOMIC_BUILD_2D)
  20. add_definitions( -DATOMIC_PHYSICS -DATOMIC_3D)
  21. set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} Bullet StanHull)
  22. endif()
  23. if (NOT EMSCRIPTEN)
  24. add_definitions( -DATOMIC_THREADING -DATOMIC_NETWORK)
  25. set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} Civetweb Recast Detour DetourCrowd DetourTileCache kNet libcurl )
  26. endif()
  27. add_definitions( -DATOMIC_WEB )
  28. include (AtomicPlatform)
  29. find_program(CLDOC cldoc)
  30. if(CLDOC)
  31. add_custom_target(docs DEPENDS AtomicEngineDocs)
  32. endif()
  33. if (ATOMIC_WEBVIEW)
  34. if(APPLE)
  35. if(POLICY CMP0037)
  36. # new cmake doesn't like creating framework whose name has spaces
  37. # which CEF3 scripts (including shell) currently require on OSX
  38. cmake_policy(SET CMP0037 OLD)
  39. endif()
  40. set(CEF_ROOT "${CMAKE_SOURCE_DIR}/Submodules/CEF/MacOSX")
  41. elseif(MSVC)
  42. if (ATOMIC_PROJECT_ARCH STREQUAL "x86")
  43. else()
  44. set(CEF_ROOT "${CMAKE_SOURCE_DIR}/Submodules/CEF/Windows/64bit")
  45. endif()
  46. else()
  47. set(CEF_ROOT "${CMAKE_SOURCE_DIR}/Submodules/CEF/Linux")
  48. endif()
  49. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
  50. find_package(CEF REQUIRED)
  51. include_directories(${CEF_ROOT})
  52. add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
  53. endif()
  54. add_subdirectory(Source)
  55. if (ATOMIC_DESKTOP AND ATOMIC_DEV_BUILD)
  56. set (ATOMIC_CPLUSPLUS_EXAMPLES 1)
  57. if (ATOMIC_CPLUSPLUS_EXAMPLES)
  58. add_subdirectory(Submodules/AtomicExamples/FeatureExamples/CPlusPlus)
  59. endif()
  60. endif()