CMakeLists.txt 894 B

12345678910111213141516171819202122232425262728293031323334
  1. if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
  2. message(FATAL_ERROR "Please create a separate directory for build files.")
  3. endif()
  4. cmake_minimum_required(VERSION 2.8.7)
  5. set(CMAKE_CXX_STANDARD 11)
  6. project(gsd C CXX)
  7. set(CMAKE_BUILD_TYPE Debug)
  8. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
  9. add_compile_options(-DRELEASE)
  10. # --[ Options
  11. option(build_modules "build modules" ON)
  12. option(build_source "build source programs" OFF)
  13. option(build_plugins "build plugins programs" ON)
  14. option(build_test "build test programs" ON)
  15. add_subdirectory(framework)
  16. if(build_modules)
  17. add_subdirectory(modules)
  18. endif()
  19. if(build_plugins)
  20. add_subdirectory(plugins)
  21. endif()
  22. if(build_source)
  23. add_subdirectory(source)
  24. endif()
  25. if(build_test)
  26. add_subdirectory(test)
  27. endif()
  28. # ---[ install
  29. set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") #set runtime path