diff options
Diffstat (limited to 'Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake index 991146c8ec..53f4e4f930 100644 --- a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake @@ -8,3 +8,26 @@ set(CPACK_PACKAGE_VERSION "1") set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(NotAGenerator ${CMAKE_CPACK_COMMAND} -G NotAGenerator) unset(RunCMake_TEST_NO_CLEAN) + +function(run_MultiConfig) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/MultiConfig-build") + run_cmake(MultiConfig) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(MultiConfig-build-dbg ${CMAKE_COMMAND} --build . --config Debug) + run_cmake_command(MultiConfig-build-rel ${CMAKE_COMMAND} --build . --config Release) + run_cmake_command(MultiConfig-package ${CMAKE_CPACK_COMMAND} -G ZIP -C "Debug\;Release") + set(zip_glob "${RunCMake_TEST_BINARY_DIR}/MultiConfig-0.1.1-*.zip") + file(GLOB zips "${zip_glob}") + set(zip_found 0) + foreach(zip IN LISTS zips) + set(zip_found 1) + run_cmake_command(MultiConfig-check ${CMAKE_COMMAND} -E tar tf "${zip}") + endforeach() + if(NOT zip_found) + message(SEND_ERROR "No package file found at\n ${zip_glob}") + endif() +endfunction() + +if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode") + run_MultiConfig() +endif() |