CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. cmake_minimum_required(VERSION 2.6)
  2. cmake_policy(VERSION 2.6)
  3. set(CMAKE_CXX_COMPILER "clang++")
  4. set(CMAKE_C_COMPILER "clang")
  5. project(dmux LANGUAGES C CXX)
  6. set(TARGET_NAME "dmux")
  7. set(TARGET_NAME_SERVER "dmux-server")
  8. set(CMAKE_MODULE_PATH
  9. ${CMAKE_MODULE_PATH}
  10. ${CMAKE_SOURCE_DIR}/CMake
  11. ${CMAKE_SOURCE_DIR}/CMake/Dependencies
  12. )
  13. # Contains the version information...
  14. include(ExternalProject)
  15. # Generic definitions for all compilers and operating systems...
  16. if(CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL MinSizeRel)
  17. add_definitions(-DNDEBUG)
  18. set(IS_DEBUG FALSE)
  19. else()
  20. set(IS_DEBUG TRUE)
  21. endif()
  22. # Contains a list of source files...
  23. include(CompilerSettings)
  24. include(DMUXSource)
  25. # Load dependency settings
  26. include(DependencyIrrlicht)
  27. include(DependencyIrrIMGUI)
  28. #include(DependencyIrrlichtBAW)
  29. include(DependencyRakNet)
  30. include(DependencyBullet)
  31. include(DependencyOpenAL)
  32. include(DependencyCAudio)
  33. include(DependencyCppLocate)
  34. include(DependencyGuiChan)
  35. # Print all settings
  36. include(PrintSettings)
  37. include(WriteSettings)
  38. # Target settings
  39. SET_SOURCE_FILES_PROPERTIES(ALL_HEADER_FILES
  40. PROPERTIES HEADER_FILE_ONLY TRUE)
  41. LIST(APPEND ALL_SOURCE_FILES ${ALL_HEADER_FILES})
  42. add_executable(${TARGET_NAME} ${ALL_CLIENT_FILES})
  43. target_link_libraries(${TARGET_NAME} ${DMUX_DEPENDENCY_LIBRARIES} ${OS_DEPENDENT_LIBRARIES} -lstdc++fs)
  44. add_dependencies(${TARGET_NAME} cAudio guichan IrrImgui OpenAL_1.17.2)
  45. add_executable(${TARGET_NAME_SERVER} ${ALL_SERVER_FILES})
  46. target_link_libraries(${TARGET_NAME_SERVER} ${DMUX_DEPENDENCY_LIBRARIES} ${OS_DEPENDENT_LIBRARIES} -lstdc++fs)