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