summaryrefslogtreecommitdiff
path: root/Modules/FetchContent.cmake
diff options
context:
space:
mode:
authorMáté Ferenc Nagy-Egri <mate@streamhpc.com>2023-02-10 07:32:07 +0100
committerBrad King <brad.king@kitware.com>2023-02-23 17:07:50 -0500
commit9af0e67ee506b81421169c1828a558a71941b13c (patch)
tree5b9dbd8b78fb95d5ed586f241a52b68b1ebd0904 /Modules/FetchContent.cmake
parent917f675b9ee6910f6a05f5a01b619a845a581f85 (diff)
downloadcmake-9af0e67ee506b81421169c1828a558a71941b13c.tar.gz
FetchContent: Relay CMAKE_GENERATOR_INSTANCE
If set, relay `CMAKE_GENERATOR_INSTANCE`. It may affect compiler detection in the subbuild folder. Fixes: #24404
Diffstat (limited to 'Modules/FetchContent.cmake')
-rw-r--r--Modules/FetchContent.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 8afb9bce72..a6250cc211 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -1536,7 +1536,9 @@ ExternalProject_Add_Step(${contentName}-populate copyfile
if(CMAKE_GENERATOR_TOOLSET)
list(APPEND subCMakeOpts "-T${CMAKE_GENERATOR_TOOLSET}")
endif()
-
+ if(CMAKE_GENERATOR_INSTANCE)
+ list(APPEND subCMakeOpts "-DCMAKE_GENERATOR_INSTANCE:INTERNAL=${CMAKE_GENERATOR_INSTANCE}")
+ endif()
if(CMAKE_MAKE_PROGRAM)
list(APPEND subCMakeOpts "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}")
endif()