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

Alexander Broekhuis a.broekhuis at gmail.com
Sun Feb 16 09:53:31 EST 2014


Hi all,

Sorry to "hijack" this message, but I am running into the same problem. As
part of my build I create zip files, and currently have this coupled to a
normal library target (add_library). This works ok, but for some new
features I need to create a zip file with a collection of libraries, so
instead of coupling CPack to a library target I want to add it using a
custom target which is coupled to the build chain (using ALL).

How can I do this without running in the problem mentioned by the topic
starter? And what is the difference in this case between a normal
(add_library) target and a custom target?

Thanks!



2013-08-06 3:39 GMT+02:00 Anil Gunturu <anil.gunturu at skyfab.com>:

> 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
>



-- 
Met vriendelijke groet,

Alexander Broekhuis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140216/67ddf28b/attachment.html>


More information about the CMake mailing list