summaryrefslogtreecommitdiffstats
path: root/Tests/CPackComponents
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/CPackComponents
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/CPackComponents')
-rw-r--r--Tests/CPackComponents/CMakeLists.txt29
1 files changed, 28 insertions, 1 deletions
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()