summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Framework/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-27 10:23:13 (GMT)
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-04 13:30:54 (GMT)
commitad3f69c86eb27abd16d2a8534a7b90d59c0d74ed (patch)
treee1f0f070bbfaeb14c923f4fbb3cac503f3154111 /Tests/RunCMake/Framework/RunCMakeTest.cmake
parentd016637eefd7ebd6745adcd36bbfad7da67529ef (diff)
downloadCMake-ad3f69c86eb27abd16d2a8534a7b90d59c0d74ed.zip
CMake-ad3f69c86eb27abd16d2a8534a7b90d59c0d74ed.tar.gz
CMake-ad3f69c86eb27abd16d2a8534a7b90d59c0d74ed.tar.bz2
Add support for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>
Diffstat (limited to 'Tests/RunCMake/Framework/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/Framework/RunCMakeTest.cmake36
1 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake
index 965fbf4..6ee61a3 100644
--- a/Tests/RunCMake/Framework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake
@@ -45,3 +45,39 @@ framework_type_test(ios SHARED YES)
framework_type_test(ios STATIC YES)
framework_type_test(osx SHARED YES)
framework_type_test(osx STATIC YES)
+
+function(framework_multi_config_postfix_test)
+ set(configure_name "FrameworkMultiConfigPostfix")
+ set(build_name "${configure_name}-build-intermediate")
+ set(build_name_final "${configure_name}-build-final")
+
+ if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config")
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_CROSS_CONFIGS=all")
+ elseif(RunCMake_GENERATOR MATCHES "Xcode")
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release")
+ else()
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE=Debug")
+ endif()
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${configure_name})
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${configure_name})
+ unset(RunCMake_TEST_OPTIONS)
+
+ if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config")
+ run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build . --target all:all)
+ elseif(RunCMake_GENERATOR MATCHES "Xcode")
+ run_cmake_command(${build_name} ${CMAKE_COMMAND} --build . --config Release)
+ run_cmake_command(${build_name} ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build . --config Debug)
+ else()
+ run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build .)
+ endif()
+endfunction()
+
+framework_multi_config_postfix_test()