Commit 00f5e020 authored by Craig Scott's avatar Craig Scott Committed by Kitware Robot

Merge topic 'remove-CPACK_INSTALL_CMAKE_CONFIGURATIONS' into release-3.16

1d1fa5d3 Tests: Add RunCMake.CPackCommandLine case for multi-config package
108207cc CPack: Remove CPACK_INSTALL_CMAKE_CONFIGURATIONS
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !4025
parents 5e328c6d 1d1fa5d3
......@@ -55,6 +55,8 @@ Options
When the CMake project uses a multi-configuration
generator such as Xcode or Visual Studio, this option is needed to tell
``cpack`` which built executables to include in the package.
The user is responsible for ensuring that the configuration(s) listed
have already been built before invoking ``cpack``.
``-D <var>=<value>``
Set a CPack variable. This will override any value set for ``<var>`` in the
......
......@@ -207,9 +207,8 @@ CTest
CPack
-----
* CPack variable :variable:`CPACK_INSTALL_CMAKE_CONFIGURATIONS` was added to
control what configurations are to be packaged for multi-configuration
CMake generators.
* :manual:`cpack(1)` learned support for multiple configurations for ``-C``
option.
* The :cpack_gen:`CPack DEB Generator` is now able to format generic text
(usually used as the description for multiple CPack generators) according
......
......@@ -301,13 +301,6 @@ The following variables are for advanced uses of CPack:
project. Defaults to the value of :variable:`CMAKE_GENERATOR`. Few users
will want to change this setting.
.. variable:: CPACK_INSTALL_CMAKE_CONFIGURATIONS
Specify the project configurations to be packaged (e.g. ``Debug``, ``Release``,
etc.). When the CMake project uses a multi-configuration generator such as Xcode
or Visual Studio, this option can be used to specify what configurations
to include in the package.
.. variable:: CPACK_INSTALL_CMAKE_PROJECTS
List of four values that specify what project to install. The four values
......
......@@ -605,14 +605,6 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmExpandList(buildConfig, buildConfigs);
}
// Try get configurations requested by the user explicitly
{
const char* const configsCstr =
this->GetOption("CPACK_INSTALL_CMAKE_CONFIGURATIONS");
auto configs = configsCstr ? configsCstr : std::string{};
cmExpandList(configs, buildConfigs);
}
// Remove duplicates
std::sort(buildConfigs.begin(), buildConfigs.end());
buildConfigs.erase(std::unique(buildConfigs.begin(), buildConfigs.end()),
......
......@@ -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"
......
set(EXPECTED_FILES_COUNT "1")
set(EXPECTED_FILE_CONTENT_1_LIST "foo;foo/debug.txt;foo/release.txt")
CPack: Install projects
CPack: - Install project: CPACK_INSTALL_CMAKE_CONFIGURATIONS-MONOLITHIC-type \[Debug\]
CPack: - Install project: CPACK_INSTALL_CMAKE_CONFIGURATIONS-MONOLITHIC-type \[Release\]
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})
cmake_minimum_required(VERSION 3.16)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
MultiConfig-0\.1\.1-[^/
]*/lib/(lib|)foo_dbg\.(a|lib)
MultiConfig-0\.1\.1-[^/
]*/lib/(lib|)foo_rel\.(a|lib)
^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.$
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)
......@@ -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()
int foo(void)
{
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment