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

Alexander Neundorf a.neundorf-work at gmx.net
Wed Aug 21 16:39:55 EDT 2013


On Tuesday 06 August 2013, Anil Gunturu wrote:
> 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".

Doesn't have "make package" the same effect ?
(at least "make install" builds first, haven't checked whether "make package" 
does that too, I think so).

Alex


More information about the CMake mailing list