[CMake] CPACK issue with symbolic links
While to trying to create an RPM package using CPACK, we are encountering an issue when symbolic links are present. We are using the CPACK_INSTALLED_DIRECTORIES to specify the directories for packaging. It seems like CPACK is not in the correct directory when creating the symbolic link. /builddir/build/BUILD/cmake-2.8.12.1/Source/CPack/cmCPackGenerator.cxx:429 Change dir to: /blah/.build/blah_blah/_CPack_Packages/Linux/RPM/ext-foo-1.0-Linux/protobuf-c /builddir/build/BUILD/cmake-2.8.12.1/Source/CPack/cmCPackGenerator.cxx:437 Will create a symlink: usr/include/google/protobuf-c/protobuf-c.h-- ../../protobuf-c/protobuf-c.h CPack Error: /builddir/build/BUILD/cmake-2.8.12.1/Source/CPack/cmCPackGenerator.cxx:443 Cannot create symlink: usr/include/google/protobuf-c/protobuf-c.h-- ../../protobuf-c/protobuf-c.h CPack Error: /builddir/build/BUILD/cmake-2.8.12.1/Source/CPack/cpack.cxx:516 Error when generating package: ext-foo Thanks in advance for your help, -Anil -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Cmake hangs when a custom target for running cpack is added.
Hi, A custom target in the CMakeLists.txt to run cpack seems to create a deadlock. For example the following code hangs after emitting: CPack: Create package using RPM CPack: Install projects CPack: - Install directory: /home/agunturu/projects/rpm/.install/extra CPack: - Run preinstall target for: Project set(CPACK_COMPONENTS_ALL bin header extra) set(CPACK_RPM_COMPONENT_INSTALL ON) set(CPACK_RPM_PACKAGE_DEBUG ON) set(CPACK_GENERATOR RPM) set(CPACK_PACKAGE_NAME test) set(CPACK_PACKAGE_VERSION 1.0) set(CPACK_PACKAGE_RELEASE 1) set(CPACK_PACKAGING_INSTALL_PREFIX /) set(CPACK_INSTALLED_DIRECTORIES /home/agunturu/projects/rpm/.install/extra;extra) include(CPack) add_custom_target( pkg-all ALL cpack --config CPackConfig.cmake DEPENDS test ) Looks like cpack runs the preinstall target which includes the custom target pkg-all itself. If the ALL keyword is removed from custom target it works fine with make pkg-all, but I was hoping to add the packaging step to ALL target list, so everything happens with just make. Thanks, -Anil -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Example use of CPACK_INSTALL_COMMANDS
Can someone please share an example using CPACK_INSTALL_COMMAND? More specifically, I am trying to avoid cpack installing the files using the make install. I prefer to use CPACK_INSTALLED_DIRECTORIES to get a fine grain control. Is there a way to override the default files that CPACK installs? Cheers, -Anil -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CPACK RPM compression type and level
Thanks Eric. Here is the patch for supporting the compression level on cmake 2.8.7. -Anil --- cmake/modules/patches/CPackRPM.cmake | 51 +++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/cmake/modules/patches/CPackRPM.cmake b/cmake/modules/patches/CPackRPM.cmake index bf476ad..db4823f 100644 --- a/cmake/modules/patches/CPackRPM.cmake +++ b/cmake/modules/patches/CPackRPM.cmake @@ -68,6 +68,12 @@ # to lzma or xz compression whereas older cannot use such RPM. # Using this one can enforce compression type to be used. # Possible value are: lzma, xz, bzip2 and gzip. +# CPACK_RPM_COMPRESSION_LEVEL +# Mandatory : NO +# Default : - +# May be used to set the compression level. If this is not specified it defaults +# to best possible compression level. +# Possible values are: 0-9. # CPACK_RPM_PACKAGE_REQUIRES # Mandatory : NO # Default : - @@ -374,17 +380,54 @@ IF (CPACK_RPM_COMPRESSION_TYPE) IF(CPACK_RPM_PACKAGE_DEBUG) MESSAGE(CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}) ENDIF(CPACK_RPM_PACKAGE_DEBUG) + + IF(DEFINED CPACK_RPM_COMPRESSION_LEVEL) + # validate the compression level for the compression type + IF(CPACK_RPM_COMPRESSION_LEVEL GREATER 9) + IF(CPACK_RPM_PACKAGE_DEBUG) +message(CPackRPM:Debug: Compression level should be less than 9 for lzma) + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_COMPRESSION_LEVEL 9) + ENDIF(CPACK_RPM_COMPRESSION_LEVEL GREATER 9) + + IF(CPACK_RPM_COMPRESSION_LEVEL LESS 0) + IF(CPACK_RPM_PACKAGE_DEBUG) +message(CPackRPM:Debug: Compression level should be greater than 0 for lzma) + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_COMPRESSION_LEVEL 0) + ENDIF(CPACK_RPM_COMPRESSION_LEVEL LESS 0) + ELSE(DEFINED CPACK_RPM_COMPRESSION_LEVEL) + # compression level not defined, use the highest level for + # given compression type + IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL lzma) + SET(CPACK_RPM_COMPRESSION_LEVEL 9) + ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL lzma) + IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL xz) + SET(CPACK_RPM_COMPRESSION_LEVEL 7) + ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL xz) + IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL bzip2) + SET(CPACK_RPM_COMPRESSION_LEVEL 9) + ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL bzip2) + IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL gzip) + SET(CPACK_RPM_COMPRESSION_LEVEL 9) + ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL gzip) + ENDIF(DEFINED CPACK_RPM_COMPRESSION_LEVEL) + + IF(CPACK_RPM_PACKAGE_DEBUG) + message(CPackRPM:Debug: Compression level set to ${CPACK_RPM_COMPRESSION_LEVEL}) + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL lzma) - SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w9.lzdio) + SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.lzdio) ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL lzma) IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL xz) - SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w7.xzdio) + SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.xzdio) ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL xz) IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL bzip2) - SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w9.bzdio) + SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.bzdio) ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL bzip2) IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL gzip) - SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w9.gzdio) + SET(CPACK_RPM_COMPRESSION_TYPE_TMP %define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.gzdio) ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL gzip) ELSE(CPACK_RPM_COMPRESSION_TYPE) SET(CPACK_RPM_COMPRESSION_TYPE_TMP ) -- 1.7.9.5 On Tue, Jul 2, 2013 at 5:24 AM, Eric Noulard eric.noul...@gmail.com wrote: 2013/7/2 Anil Gunturu anil.gunt...@skyfab.com: Hi, I understand that CPACK_RPM_COMPRESSION_TYPE can used to change the compression type. Is it also possible to specify the compression level? Selecting a compression type of gzip puts the following line in the spec file: %define _binary_payload w9.gzdio But is it possible specific fast compression say for example: %define _binary_payload w6.gzdio I am looking to speed up the time for RPM packaging, at the expense compression ratio. Currently the compression level is not configurable, since it was not designed for that when introduced: see http://public.kitware.com/Bug/view.php?id=10363. Have a look at CPackRPM.cmake module and you'll see: # CPACK_RPM_COMPRESSION_TYPE # if (CPACK_RPM_COMPRESSION_TYPE) if(CPACK_RPM_PACKAGE_DEBUG) message(CPackRPM:Debug: User Specified RPM compression type
[CMake] CPACK RPM compression type and level
Hi, I understand that CPACK_RPM_COMPRESSION_TYPE can used to change the compression type. Is it also possible to specify the compression level? Selecting a compression type of gzip puts the following line in the spec file: %define _binary_payload w9.gzdio But is it possible specific fast compression say for example: %define _binary_payload w6.gzdio I am looking to speed up the time for RPM packaging, at the expense compression ratio. Thanks, -Anil -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMAKE_BUILD_TYPE case sensitivity
Is the CMAKE_BUILD_TYPE case sensitive. I have seen references to both Debug and DEBUG in the mailing lists. Thanks, -Anil -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] CPack and ExternalProject_Add
Is there a way to use CPack to create RPMs for targets added using ExternalProject_Add? Specifically these targets are not CMake targets and use autotools to build (./configure make). As an example I am using the following command to add the externalproject: # add an external project target for ${PKG_NAME}-${VERSION} externalproject_add( ${PKG_NAME}-${VERSION} DEPENDS ${PKG_DEPENDS} DOWNLOAD_COMMAND PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${PKG_NAME}-${VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${PKG_NAME}-${VERSION} CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure.sh ${PKG_INSTALL_PREFIX} ${CMAKE_CURRENT_SOURCE_DIR}/${PKG_NAME}-${VERSION} ${PKG_CONFIG_PATH} ${LDPATH} ${DEBUG_FLAGS} BUILD_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${PYG_PKG_CONFIG_PATH} ${LDPATH} ) Thanks in advance for help. Cheers, -Anil -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake