CMakeLists.txt 2.2 KB

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