summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2008-10-29 16:27:19 (GMT)
committerDavid Cole <david.cole@kitware.com>2008-10-29 16:27:19 (GMT)
commitb0536e29eaf2edbf798cd98884eb3a31ebf4f781 (patch)
tree184f3822ad64282e966085c11292aa93b6a633af /Tests
parent351ef7c187e0d29caef23db7add58bf214b42951 (diff)
downloadCMake-b0536e29eaf2edbf798cd98884eb3a31ebf4f781.zip
CMake-b0536e29eaf2edbf798cd98884eb3a31ebf4f781.tar.gz
CMake-b0536e29eaf2edbf798cd98884eb3a31ebf4f781.tar.bz2
ENH: Use settings for CPackComponents test to make it fail if the recent fix of cmCPackGenerator.cxx revision 1.16 ever encounters another regression.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt3
-rw-r--r--Tests/CPackComponents/CMakeLists.txt29
2 files changed, 31 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 74a59a2..b0310ed 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -391,6 +391,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-two-config
--build-target package
+ --build-options
+ -DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
+ -DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
--test-command ${CMAKE_CMAKE_COMMAND}
"-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents"
-P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake")
diff --git a/Tests/CPackComponents/CMakeLists.txt b/Tests/CPackComponents/CMakeLists.txt
index d34490a..d41faa0 100644
--- a/Tests/CPackComponents/CMakeLists.txt
+++ b/Tests/CPackComponents/CMakeLists.txt
@@ -14,8 +14,19 @@ add_library(mylib mylib.cpp)
add_executable(mylibapp mylibapp.cpp)
target_link_libraries(mylibapp mylib)
+# On Linux, enable using an absolute install path to verify that
+# CMAKE_INSTALL_PREFIX and CPACK_SET_DESTDIR interact properly.
+if(UNIX AND NOT APPLE)
+ set(mylib_install_to_absolute_path ON)
+endif()
+
+if(mylib_install_to_absolute_path)
+ set(CMAKE_INSTALL_PREFIX "/opt/mylib")
+ set(CPACK_SET_DESTDIR ON)
+endif()
+
# Create installation targets. Note that we put each kind of file
-# into a different component via COMPONENT. These components will
+# into a different component via COMPONENT. These components will
# be used to create the installation components.
install(TARGETS mylib
ARCHIVE
@@ -29,9 +40,16 @@ install(FILES mylib.h
DESTINATION include
COMPONENT headers)
+if(mylib_install_to_absolute_path)
+ install(FILES mylib.cpp
+ DESTINATION /opt/mylib-source
+ COMPONENT source)
+endif()
+
# CPack boilerplate for this project
set(CPACK_PACKAGE_NAME "MyLib")
set(CPACK_PACKAGE_VENDOR "CMake.org")
+set(CPACK_PACKAGE_CONTACT "somebody@cmake.org")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
set(CPACK_PACKAGE_VERSION "1.0.0")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
@@ -70,3 +88,12 @@ cpack_add_component(headers
GROUP Development
DEPENDS libraries
INSTALL_TYPES Developer Full)
+
+if(mylib_install_to_absolute_path)
+ cpack_add_component(source
+ DISPLAY_NAME "C++ Source Files"
+ DESCRIPTION "C/C++ source files to build MyLib"
+ GROUP Development
+ DEPENDS libraries
+ INSTALL_TYPES Developer Full)
+endif()