# HG changeset patch # User Sebastien Decugis # Date 1430657718 -28800 # Node ID 38b0e251b8219a217dffa19d5146c7f1deb162c9 # Parent ecb844d6d87d37c389e49bbcc63c2d74c3a80717 Select Debug build type by default if none specified diff -r ecb844d6d87d -r 38b0e251b821 CMakeLists.txt --- a/CMakeLists.txt Sun Jan 04 01:22:58 2015 +0800 +++ b/CMakeLists.txt Sun May 03 20:55:18 2015 +0800 @@ -40,6 +40,15 @@ # All source code should be POSIX 200112L compatible, but some other extensions might be used, so: ADD_DEFINITIONS(-D_GNU_SOURCE) +# 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 + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo" "Profiling" "MaxPerformance" "DebianPackage" "DebugValgrind") +endif() + # Add a "Profiling" build type # SET(CMAKE_BUILD_TYPE Profiling) SET(CMAKE_C_FLAGS_PROFILING "-fprofile-arcs -ftest-coverage -fstack-protector -g -Wall")