summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPackRPM
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-01-20 23:29:46 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-29 15:48:58 (GMT)
commit3ec025472735c22cb90b09bc171190005dd28bb1 (patch)
treeef09aed4a19e40b892c3228fb0f2aa3051c22423 /Tests/RunCMake/CPackRPM
parent8c4b7c567bbb47ed9555da2bd50b672304ccb858 (diff)
downloadCMake-3ec025472735c22cb90b09bc171190005dd28bb1.zip
CMake-3ec025472735c22cb90b09bc171190005dd28bb1.tar.gz
CMake-3ec025472735c22cb90b09bc171190005dd28bb1.tar.bz2
CPackRPM: Allow multiple path relocation prefixes for one package
Diffstat (limited to 'Tests/RunCMake/CPackRPM')
-rw-r--r--Tests/RunCMake/CPackRPM/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt1
-rw-r--r--Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake7
-rw-r--r--Tests/RunCMake/CPackRPM/RunCMakeTest.cmake17
4 files changed, 32 insertions, 0 deletions
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)