Skip to content

Commit 28d0f98

Browse files
committed
BUILD: Set CMake build type to Debug if none specified
1 parent 36f2884 commit 28d0f98

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ set(xoreos-tools_VERSION 0.0.6)
2828
option(Boost_USE_STATIC_LIBS "Use Boost static libraries" OFF)
2929

3030

31+
# -------------------------------------------------------------------------
32+
# default build type
33+
34+
set(default_build_type "Debug")
35+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
36+
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
37+
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
38+
STRING "Choose the type of build." FORCE)
39+
# Set the possible values of build type for cmake-gui
40+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
41+
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
42+
endif()
43+
44+
3145
# -------------------------------------------------------------------------
3246
# load some cmake modules from cmake/ subfolder
3347
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

0 commit comments

Comments
 (0)