Commit 1db08c8 1 parent 4bdc673 commit 1db08c8 Copy full SHA for 1db08c8
File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,18 @@ cmake_minimum_required(VERSION 3.13)
31
31
# Same values than CMAKE_CONFIGURATION_TYPES
32
32
# From https://gitlab.kitware.com/cmake/cmake/issues/19401
33
33
get_property (multiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
34
+ if (DEFINED CMAKE_BUILD_TYPE )
35
+ # Because CMAKE_BUILD_TYPE is not standard for this project, we will restore the original
36
+ # after configuring this project
37
+ set (RESTORE_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} )
38
+ if (${CMAKE_BUILD_TYPE} STREQUAL "Release" )
39
+ set (CMAKE_BUILD_TYPE "release" CACHE STRING "Choose the type of build." )
40
+ else if(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo" )
41
+ set (CMAKE_BUILD_TYPE "profile" CACHE STRING "Choose the type of build." )
42
+ else if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
43
+ set (CMAKE_BUILD_TYPE "debug" CACHE STRING "Choose the type of build." )
44
+ endif ()
45
+ endif ()
34
46
if (NOT multiConfig AND NOT DEFINED CMAKE_BUILD_TYPE )
35
47
set (default_build_type "release" )
36
48
message (STATUS "Setting build type to '${default_build_type} ' as none was specified." )
@@ -176,4 +188,8 @@ if(PX_BUILDPUBLICSAMPLES)
176
188
message ("Added Samples" )
177
189
endif ()
178
190
endif ()
191
+ # Restore the CMAKE_BUILD_TYPE
192
+ if (DEFINED RESTORE_CMAKE_BUILD_TYPE)
193
+ set (CMAKE_BUILD_TYPE ${RESTORE_CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build." )
194
+ endif ()
179
195
You can’t perform that action at this time.
0 commit comments