[CMake] Cmake hangs when a custom target for running cpack is added.

Anil Gunturu anil.gunturu at skyfab.com
Mon Aug 5 21:39:58 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130805/b374ffab/attachment.htm>


More information about the CMake mailing list