diff options
author | Craig Scott <craig.scott@crascit.com> | 2019-11-12 13:16:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-12 13:16:31 (GMT) |
commit | 27020c81d516707ee2069d343cd058496fa71587 (patch) | |
tree | 9c1c768f6aee49e2daee807008b1561a8abd7934 /Tests | |
parent | 2dcd7ce4ba803fa4c4d27526e45e2c9cbb88e49e (diff) | |
parent | 1d1fa5d3e4f3594f1c1db258e526c4b747117aa2 (diff) | |
download | CMake-27020c81d516707ee2069d343cd058496fa71587.zip CMake-27020c81d516707ee2069d343cd058496fa71587.tar.gz CMake-27020c81d516707ee2069d343cd058496fa71587.tar.bz2 |
Merge topic 'remove-CPACK_INSTALL_CMAKE_CONFIGURATIONS'
1d1fa5d3e4 Tests: Add RunCMake.CPackCommandLine case for multi-config package
108207cc84 CPack: Remove CPACK_INSTALL_CMAKE_CONFIGURATIONS
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4025
Diffstat (limited to 'Tests')
10 files changed, 51 insertions, 18 deletions
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index b0b7a99..b154c79 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -36,9 +36,6 @@ run_cpack_test(MD5SUMS "DEB.MD5SUMS" false "MONOLITHIC;COMPONENT") run_cpack_test_subtests(CPACK_INSTALL_SCRIPTS "singular;plural;both" "ZIP" false "MONOLITHIC") run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY" false "MONOLITHIC;COMPONENT") run_cpack_test_subtests(EXTERNAL "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "External" false "MONOLITHIC;COMPONENT") -if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode") - run_cpack_test(CPACK_INSTALL_CMAKE_CONFIGURATIONS "ZIP" false "MONOLITHIC") -endif() run_cpack_test_subtests( DEB_DESCRIPTION "CPACK_DEBIAN_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION_FILE" diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake deleted file mode 100644 index 34c7f8a..0000000 --- a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ExpectedFiles.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(EXPECTED_FILES_COUNT "1") - -set(EXPECTED_FILE_CONTENT_1_LIST "foo;foo/debug.txt;foo/release.txt") diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt deleted file mode 100644 index 2a3aa9e..0000000 --- a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/ZIP-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -CPack: Install projects -CPack: - Install project: CPACK_INSTALL_CMAKE_CONFIGURATIONS-MONOLITHIC-type \[Debug\] -CPack: - Install project: CPACK_INSTALL_CMAKE_CONFIGURATIONS-MONOLITHIC-type \[Release\] diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake deleted file mode 100644 index 4f562cf..0000000 --- a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_CMAKE_CONFIGURATIONS/test.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(CMAKE_CONFIGURATION_TYPES Debug Release) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/debug.txt" "debug content") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/release.txt" "release content") - -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/debug.txt" DESTINATION "foo" CONFIGURATIONS Debug) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/release.txt" DESTINATION "foo" CONFIGURATIONS Release) - -set(CPACK_INSTALL_CMAKE_CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES}) diff --git a/Tests/RunCMake/CPackCommandLine/CMakeLists.txt b/Tests/RunCMake/CPackCommandLine/CMakeLists.txt new file mode 100644 index 0000000..2632ffa --- /dev/null +++ b/Tests/RunCMake/CPackCommandLine/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CPackCommandLine/MultiConfig-check-stdout.txt b/Tests/RunCMake/CPackCommandLine/MultiConfig-check-stdout.txt new file mode 100644 index 0000000..f2ae844 --- /dev/null +++ b/Tests/RunCMake/CPackCommandLine/MultiConfig-check-stdout.txt @@ -0,0 +1,4 @@ +MultiConfig-0\.1\.1-[^/ +]*/lib/(lib|)foo_dbg\.(a|lib) +MultiConfig-0\.1\.1-[^/ +]*/lib/(lib|)foo_rel\.(a|lib) diff --git a/Tests/RunCMake/CPackCommandLine/MultiConfig-package-stdout.txt b/Tests/RunCMake/CPackCommandLine/MultiConfig-package-stdout.txt new file mode 100644 index 0000000..4fb8181 --- /dev/null +++ b/Tests/RunCMake/CPackCommandLine/MultiConfig-package-stdout.txt @@ -0,0 +1,8 @@ +^CPack: Create package using ZIP +CPack: Install projects +CPack: - Install project: MultiConfig \[Debug\] +CPack: - Install project: MultiConfig \[Release\] +CPack: Create package +CPack: - package: [^ +]*/Tests/RunCMake/CPackCommandLine/MultiConfig-build/MultiConfig-0.1.1-[^ +]*.zip generated.$ diff --git a/Tests/RunCMake/CPackCommandLine/MultiConfig.cmake b/Tests/RunCMake/CPackCommandLine/MultiConfig.cmake new file mode 100644 index 0000000..71fd189 --- /dev/null +++ b/Tests/RunCMake/CPackCommandLine/MultiConfig.cmake @@ -0,0 +1,9 @@ +enable_language(C) + +include(CPack) + +add_library(foo foo.c) +set_property(TARGET foo PROPERTY DEBUG_POSTFIX _dbg) +set_property(TARGET foo PROPERTY RELEASE_POSTFIX _rel) + +install(TARGETS foo) diff --git a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake index 991146c..53f4e4f 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() diff --git a/Tests/RunCMake/CPackCommandLine/foo.c b/Tests/RunCMake/CPackCommandLine/foo.c new file mode 100644 index 0000000..c83d856 --- /dev/null +++ b/Tests/RunCMake/CPackCommandLine/foo.c @@ -0,0 +1,4 @@ +int foo(void) +{ + return 0; +} |