diff options
author | Máté Ferenc Nagy-Egri <mate@streamhpc.com> | 2023-02-10 07:32:07 +0100 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-02-23 17:07:50 -0500 |
commit | 9af0e67ee506b81421169c1828a558a71941b13c (patch) | |
tree | 5b9dbd8b78fb95d5ed586f241a52b68b1ebd0904 | |
parent | 917f675b9ee6910f6a05f5a01b619a845a581f85 (diff) | |
download | cmake-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
-rw-r--r-- | Modules/FetchContent.cmake | 4 |
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() |