diff options
author | Brad King <brad.king@kitware.com> | 2017-10-03 18:53:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-19 14:20:08 (GMT) |
commit | 314613d1afd069dd896aa0d5112dfbf2b82af3c3 (patch) | |
tree | d6de6878803459df63b60c86e42c5a1faa6c8fc2 /Tests/RunCMake/RunCMake.cmake | |
parent | 358ceee5d84723f60c2db5cdff52445d478d6a42 (diff) | |
download | CMake-314613d1afd069dd896aa0d5112dfbf2b82af3c3.zip CMake-314613d1afd069dd896aa0d5112dfbf2b82af3c3.tar.gz CMake-314613d1afd069dd896aa0d5112dfbf2b82af3c3.tar.bz2 |
Add infrastructure for generators to select a build tool instance
Add cache entry `CMAKE_GENERATOR_INSTANCE` to hold the instance location
persistently across re-runs of CMake in a given build tree.
For now we reject the option by default if explicitly set. It will be
implemented on a per-generator basis. Pass the setting into try_compile
project generation. Add a RunCMake.GeneratorInstance test to cover
basic use cases for the option. Verify that `CMAKE_GENERATOR_INSTANCE`
is empty by default, and that it is rejected when the generator does not
support a user setting.
Issue: #17268
Diffstat (limited to 'Tests/RunCMake/RunCMake.cmake')
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 4fd816e..e688830 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -79,11 +79,17 @@ function(run_cmake test) ${maybe_timeout} ) else() + if(RunCMake_GENERATOR_INSTANCE) + set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE=${RunCMake_GENERATOR_INSTANCE}") + else() + set(_D_CMAKE_GENERATOR_INSTANCE "") + endif() execute_process( COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}" -G "${RunCMake_GENERATOR}" -A "${RunCMake_GENERATOR_PLATFORM}" -T "${RunCMake_GENERATOR_TOOLSET}" + ${_D_CMAKE_GENERATOR_INSTANCE} -DRunCMake_TEST=${test} --no-warn-unused-cli ${RunCMake_TEST_OPTIONS} |