From 9af0e67ee506b81421169c1828a558a71941b13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Ferenc=20Nagy-Egri?= Date: Fri, 10 Feb 2023 07:32:07 +0100 Subject: FetchContent: Relay CMAKE_GENERATOR_INSTANCE If set, relay `CMAKE_GENERATOR_INSTANCE`. It may affect compiler detection in the subbuild folder. Fixes: #24404 --- Modules/FetchContent.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Modules/FetchContent.cmake') 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() -- cgit v1.2.1