1# Taken from https://blog.kitware.com/cmake-and-the-default-build-type/ 2 3# Set the default build type to "Release" 4set(default_build_type "Release") 5 6get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 7if(NOT isMultiConfig AND NOT CMAKE_BUILD_TYPE) 8 message(STATUS "Setting build type to '${default_build_type}' as none was specified.") 9 set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) 10 # Set the possible values of build type for cmake-gui 11 set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") 12endif() 13