summaryrefslogtreecommitdiff
path: root/Modules/FetchContent.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2022-05-17 14:42:31 +1000
committerCraig Scott <craig.scott@crascit.com>2022-05-17 14:42:31 +1000
commit82f3ceb26b82913984dc1d59444cf6c07e364178 (patch)
treeee36d0ee3bfb8d8924314d9793feb01a638a2d3f /Modules/FetchContent.cmake
parent7a390edefbc5de670f9b5cab60d282df2e22f548 (diff)
downloadcmake-82f3ceb26b82913984dc1d59444cf6c07e364178.tar.gz
FetchContent: Use Debug rather than Release for sub-build
The config used can be part of the path to the sub-build. On some platforms, there are restrictions on the length of paths or file names. Use Debug rather than Release because the former is shorter. When CMAKE_CONFIGURATION_TYPES is left at its default, this also makes the path the same as the previous default before 10865c8e5f (FetchContent: Hard-code a config for the sub-build, 2022-05-01) .
Diffstat (limited to 'Modules/FetchContent.cmake')
-rw-r--r--Modules/FetchContent.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index b92c6793af..a342aa7023 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -1356,7 +1356,7 @@ ExternalProject_Add_Step(${contentName}-populate copyfile
# and can always request a known configuration further below.
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
- list(APPEND subCMakeOpts "-DCMAKE_CONFIGURATION_TYPES:STRING=Release")
+ list(APPEND subCMakeOpts "-DCMAKE_CONFIGURATION_TYPES:STRING=Debug")
endif()
else()
@@ -1404,7 +1404,7 @@ set_property(GLOBAL PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION
# anything to be updated, so extra rebuilds of the project won't occur.
# Make sure to pass through CMAKE_MAKE_PROGRAM in case the main project
# has this set to something not findable on the PATH. We also ensured above
- # that the Release config will be defined for multi-config generators.
+ # that the Debug config will be defined for multi-config generators.
configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/FetchContent/CMakeLists.cmake.in"
"${ARG_SUBBUILD_DIR}/CMakeLists.txt")
execute_process(
@@ -1420,7 +1420,7 @@ set_property(GLOBAL PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION
message(FATAL_ERROR "CMake step for ${contentName} failed: ${result}")
endif()
execute_process(
- COMMAND ${CMAKE_COMMAND} --build . --config Release
+ COMMAND ${CMAKE_COMMAND} --build . --config Debug
RESULT_VARIABLE result
${outputOptions}
WORKING_DIRECTORY "${ARG_SUBBUILD_DIR}"