#1217 CMake: minor improvements; in peculiar the trick found on the Web...
#1217 CMake: minor improvements; in peculiar the trick found on the Web concerning default CMAKE_BUILD_TYPE didn't work correctly; replaced it by another one which seems to fare better.
message(FATAL_ERROR "-DSETTINGS_FILE must be present in the command line and point to a file that specify the paths and settings to use in the build. A default one is defined in cmake/Paths.cmake; feel free to copy and adapt it to your needs.")
message(FATAL_ERROR "-DSETTINGS_FILE must be present in the command line and point to a file that specify the paths and settings to use in the build. Examples are given in cmake/Settings folder; feel free to copy and adapt them to your needs.")
endif()
include(${SETTINGS_FILE})
...
...
@@ -35,20 +34,18 @@ endif()
# WARNING: all those calls must occur BEFORE the call to project, so that overriding remains possible.
# From https://cmake.org/pipermail/cmake/2008-September/023808.html
# Ensure if the user doesn't specify arenything in command line debug is chosen (CMake default is no optimization and no debug symbol, which is rather useless).
if(DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of
build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug
Release RelWithDebInfo MinSizeRel.")
else()
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build,
options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
RelWithDebInfo MinSizeRel.")
# From http://cmake.3232098.n2.nabble.com/Default-value-for-CMAKE-BUILD-TYPE-td7550756.html#a7550797
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui