[Cmake-commits] [cmake-commits] david.cole committed CMakeLists.txt 1.2 1.3
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Oct 29 12:27:21 EDT 2008
Update of /cvsroot/CMake/CMake/Tests/CPackComponents
In directory public:/mounts/ram/cvs-serv7042/Tests/CPackComponents
Modified Files:
CMakeLists.txt
Log Message:
ENH: Use settings for CPackComponents test to make it fail if the recent fix of cmCPackGenerator.cxx revision 1.16 ever encounters another regression.
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CPackComponents/CMakeLists.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C 2 -d -r1.2 -r1.3
*** CMakeLists.txt 8 Jul 2008 21:47:53 -0000 1.2
--- CMakeLists.txt 29 Oct 2008 16:27:19 -0000 1.3
***************
*** 15,20 ****
target_link_libraries(mylibapp mylib)
# Create installation targets. Note that we put each kind of file
! # into a different component via COMPONENT. These components will
# be used to create the installation components.
install(TARGETS mylib
--- 15,31 ----
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
# be used to create the installation components.
install(TARGETS mylib
***************
*** 30,36 ****
--- 41,54 ----
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 at cmake.org")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
set(CPACK_PACKAGE_VERSION "1.0.0")
***************
*** 71,72 ****
--- 89,99 ----
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()
More information about the Cmake-commits
mailing list