changeset 1287:38b0e251b821

Select Debug build type by default if none specified
author Sebastien Decugis <sdecugis@freediameter.net>
date Sun, 03 May 2015 20:55:18 +0800
parents ecb844d6d87d
children 389c26b904d7
files CMakeLists.txt
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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")
"Welcome to our mercurial repository"