diff options
author | Craig Scott <craig.scott@crascit.com> | 2017-12-29 11:17:32 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2017-12-29 22:35:56 (GMT) |
commit | c267ea1c3e54626e4ab2283dc7529ed8aa8beac8 (patch) | |
tree | e361a5bcdec7006768e3a4a79109c19efa34c9ee /Tests/CMakeLists.txt | |
parent | 497f4bb941a84bacfca2392759de6cb8e23b0684 (diff) | |
download | CMake-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/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5d8c2fe..fb7313f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -38,9 +38,21 @@ set(ENV{HOME} \"${TEST_HOME}\") ") endif() +# 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() + # Choose a default configuration for CTest tests. set(CTestTest_CONFIG Debug) -if(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE) +if(NOT _isMultiConfig AND CMAKE_BUILD_TYPE) set(CTestTest_CONFIG ${CMAKE_BUILD_TYPE}) endif() @@ -3190,7 +3202,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE _result ) if(_result EQUAL 0) - if(CMAKE_CONFIGURATION_TYPES) + if(_isMultiConfig) set (JAVAH_LIBRARY_PATH ${CMake_BINARY_DIR}/Tests/JavaJavah/$<CONFIGURATION>) else() set (JAVAH_LIBRARY_PATH ${CMake_BINARY_DIR}/Tests/JavaJavah) |