diff options
author | Brad King <brad.king@kitware.com> | 2015-02-03 14:46:21 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-02-03 14:46:21 (GMT) |
commit | aec11372a5868694937b1c232af9d7510ad8497e (patch) | |
tree | 740156f23b2c802f177884ce6d7a97940682f632 /Tests/RunCMake | |
parent | 99e3650e66399e75efb989322d4b0146c549dbfa (diff) | |
parent | 3ec025472735c22cb90b09bc171190005dd28bb1 (diff) | |
download | CMake-aec11372a5868694937b1c232af9d7510ad8497e.zip CMake-aec11372a5868694937b1c232af9d7510ad8497e.tar.gz CMake-aec11372a5868694937b1c232af9d7510ad8497e.tar.bz2 |
Merge topic 'rpm_multi_prefix'
3ec02547 CPackRPM: Allow multiple path relocation prefixes for one package
Diffstat (limited to 'Tests/RunCMake')
5 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index d1457a7..801655f 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -177,3 +177,7 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) + +if(RPMBUILD) + add_RunCMake_test(CPackRPM) +endif() diff --git a/Tests/RunCMake/CPackRPM/CMakeLists.txt b/Tests/RunCMake/CPackRPM/CMakeLists.txt new file mode 100644 index 0000000..b7d170b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) + +set(CPACK_GENERATOR "RPM") +include(CPack) diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt new file mode 100644 index 0000000..3b63d5b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt @@ -0,0 +1 @@ +CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable. diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake new file mode 100644 index 0000000..3ace6a8 --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake @@ -0,0 +1,7 @@ +install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) +install(FILES CMakeLists.txt DESTINATION relocatable COMPONENT relocatable) + +set(CPACK_PACKAGE_RELOCATABLE TRUE) +set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") + +set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake new file mode 100644 index 0000000..1935e32 --- /dev/null +++ b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +function(run_cpack_rpm_test TEST_NAME) + set(RunCMake_TEST_NO_CLEAN TRUE) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-build") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + execute_process( + COMMAND "${CMAKE_COMMAND}" -D RunCMake_TEST=${TEST_NAME} "${RunCMake_SOURCE_DIR}" + WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" + OUTPUT_QUIET + ERROR_QUIET + ) + run_cmake_command(${TEST_NAME} ${CMAKE_CPACK_COMMAND}) +endfunction() + +run_cpack_rpm_test(CPackRPM_PARTIALLY_RELOCATABLE_WARNING) |