BuildType.cmake 598 B

1234567891011121314151617
  1. # Set a default build type if none was specified
  2. set(default_build_type "Release")
  3. if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  4. set(default_build_type "Debug")
  5. endif()
  6. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  7. message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
  8. set(CMAKE_BUILD_TYPE
  9. "${default_build_type}"
  10. CACHE STRING "Choose the type of build." FORCE
  11. )
  12. # Set the possible values of build type for cmake-gui
  13. set_property(
  14. CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo"
  15. )
  16. endif()