-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #228 from mikkoi/fix-forced-build-type
Remove the forcing of the CMake build type
- Loading branch information
Showing
2 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Set a default build type if none was specified | ||
set(default_build_type "Release") | ||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git") | ||
set(default_build_type "Debug") | ||
endif() | ||
|
||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.") | ||
set(CMAKE_BUILD_TYPE "${default_build_type}" 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() | ||
|