[CMake] CMake tar.gz package does not include all installed files

Eric Noulard eric.noulard at gmail.com
Thu Feb 8 11:10:16 EST 2018


Hi Nicolas,

AFAIK
CPack Archive generators (ZIP, TGZ, etc...) cannot properly handle
ABSOLUTE_INSTALL path.
The 3 install statements:

install(FILES glewlwyd.service DESTINATION
${CMAKE_INSTALL_PREFIX}/lib/systemd/system COMPONENT config)
install(FILES glewlwyd-init DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/init.d/
RENAME glewlwyd COMPONENT config)
install(DIRECTORY webapp/ DESTINATION
${CMAKE_INSTALL_PREFIX}/share/glewlwyd/webapp/ COMPONENT runtime)

Use a DESTINATION which is absolute. Thus the issue with archive generator.

CPackDeb and CPackRPM do handle absolute install path "transparently"
because they internally set CPACK_SET_DESTDIR.

Have a look at
cmake --help-variable CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
and
cmake --help-variable CPACK_SET_DESTDIR



2018-02-08 15:47 GMT+01:00 Nicolas Mora <nicolas at babelouest.org>:

> Hello,
>
> I use a CMakeLists.txt script to build an application which works pretty
> well so far, except for the tar.gz package build.
>
> In the install procedure, I copy the application executable, the config
> files and, SysV init and SystemD service files, and an entire directory.
>
> In the make install and in the .deb file generated, all those files are
> correctly installed. But the .tar.gz package only has the executable and
> the config file, not the rest.
>
> Can anyone help me point out where my mistake is?
>
> The script is available here:
> https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt
>
> The install commands that are missing in the .tar.gz package are the
> following:
> https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L211
> https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L212
> https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L213
>
> And the .tar.gz package generator commands are here:
> https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L252
>
> Thanks in advance
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>



-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180208/8fe3184e/attachment-0001.html>


More information about the CMake mailing list