OpusBuildtype.cmake 858 B

123456789101112131415161718192021222324252627
  1. # Set a default build type if none was specified
  2. if(__opus_buildtype)
  3. return()
  4. endif()
  5. set(__opus_buildtype INCLUDED)
  6. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  7. if(CMAKE_C_FLAGS)
  8. message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS})
  9. else()
  10. set(default_build_type "Release")
  11. message(
  12. STATUS
  13. "Setting build type to '${default_build_type}' as none was specified and no CFLAGS was exported."
  14. )
  15. set(CMAKE_BUILD_TYPE "${default_build_type}"
  16. CACHE STRING "Choose the type of build."
  17. FORCE)
  18. # Set the possible values of build type for cmake-gui
  19. set_property(CACHE CMAKE_BUILD_TYPE
  20. PROPERTY STRINGS
  21. "Debug"
  22. "Release"
  23. "MinSizeRel"
  24. "RelWithDebInfo")
  25. endif()
  26. endif()