From 769cb2f694d036e59cfee0c0ce53500f3df822d9 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 6 Sep 2016 08:20:56 +0900 Subject: Set CMAKE_BUILD_TYPE if none is specified --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e5dae8f..8be4be70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,15 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) +# 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") +endif() + find_package(Qt5Core 5.2.0) # For JSON (de)serialization find_package(Qt5Network 5.2.0) # For networking find_package(Qt5Gui 5.2.0) # For userpics -- cgit v1.2.3