summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeInstall.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2017-12-29 11:17:32 (GMT)
committerCraig Scott <craig.scott@crascit.com>2017-12-29 22:35:56 (GMT)
commitc267ea1c3e54626e4ab2283dc7529ed8aa8beac8 (patch)
treee361a5bcdec7006768e3a4a79109c19efa34c9ee /Tests/CMakeInstall.cmake
parent497f4bb941a84bacfca2392759de6cb8e23b0684 (diff)
downloadCMake-c267ea1c3e54626e4ab2283dc7529ed8aa8beac8.zip
CMake-c267ea1c3e54626e4ab2283dc7529ed8aa8beac8.tar.gz
CMake-c267ea1c3e54626e4ab2283dc7529ed8aa8beac8.tar.bz2
GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests
Diffstat (limited to 'Tests/CMakeInstall.cmake')
-rw-r--r--Tests/CMakeInstall.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake
index fda8c54..d9d85f7 100644
--- a/Tests/CMakeInstall.cmake
+++ b/Tests/CMakeInstall.cmake
@@ -14,7 +14,18 @@ if(CMake_TEST_INSTALL)
set(CMake_TEST_INSTALL_PREFIX ${CMake_BINARY_DIR}/Tests/CMakeInstall)
set(CMAKE_INSTALL_PREFIX "${CMake_TEST_INSTALL_PREFIX}")
- if(CMAKE_CONFIGURATION_TYPES)
+ # 3.9 or later provides a definitive answer to whether we are multi-config
+ # through a global property. Prior to 3.9, CMAKE_CONFIGURATION_TYPES being set
+ # is assumed to mean multi-config, but developers might modify it so it is
+ # technically not as reliable.
+ if(NOT CMAKE_VERSION VERSION_LESS 3.9)
+ get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ elseif(CMAKE_CONFIGURATION_TYPES)
+ set(_isMultiConfig True)
+ else()
+ set(_isMultiConfig False)
+ endif()
+ if(_isMultiConfig)
# There are multiple configurations. Make sure the tested
# configuration is the one that is installed.
set(CMake_TEST_INSTALL_CONFIG --config $<CONFIGURATION>)