Skip to content

Commit 600db67

Browse files
connorjclarkSiegeLord
authored andcommitted
Support cmake configuration for multi-config generators by default
1 parent fb66688 commit 600db67

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,19 @@ include(GNUInstallDirs)
4848

4949
set(ALLEGRO_SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
5050

51-
if(NOT CMAKE_BUILD_TYPE)
52-
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
53-
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Profile."
54-
FORCE)
51+
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
52+
if(isMultiConfig)
53+
if(NOT CMAKE_CONFIGURATION_TYPES)
54+
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel;Profile" CACHE STRING
55+
"Semicolon separated list of supported configuration types." FORCE)
56+
endif()
57+
else()
58+
if(NOT CMAKE_BUILD_TYPE)
59+
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
60+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Profile."
61+
FORCE)
62+
endif()
5563
endif()
56-
# Restrict configuration types to the selected build type.
57-
# Note: This needs to be done before the project command
58-
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}" CACHE INTERNAL "internal")
5964

6065
if(ANDROID)
6166
option(WANT_ANDROID_LEGACY "Build for Android 4 (1.6)" OFF)

0 commit comments

Comments
 (0)