That was the root problem indeed!

I cleaned the code and fixed the path with ${CMAKE_INSTALL_DATAROOTDIR}:

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glewlwyd
        DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES glewlwyd.conf.sample
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/glewlwyd RENAME glewlwyd.conf COMPONENT config)
install(DIRECTORY webapp/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/glewlwyd/webapp/ COMPONENT runtime)

Thanks a lot for the help!

Le 2018-02-08 à 11:10, Eric Noulard a écrit :
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 <[email protected] <mailto:[email protected]>>:

    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
    <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#L211>
    https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L212 
<https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L212>
    https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L213 
<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 
<https://github.com/babelouest/glewlwyd/blob/cmake/CMakeLists.txt#L252>

    Thanks in advance
--
    Powered by www.kitware.com <http://www.kitware.com>

    Please keep messages on-topic and check the CMake FAQ at:
    http://www.cmake.org/Wiki/CMake_FAQ
    <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
    <http://cmake.org/cmake/help/support.html>
    CMake Consulting: http://cmake.org/cmake/help/consulting.html
    <http://cmake.org/cmake/help/consulting.html>
    CMake Training Courses: http://cmake.org/cmake/help/training.html
    <http://cmake.org/cmake/help/training.html>

    Visit other Kitware open-source projects at
    http://www.kitware.com/opensource/opensource.html
    <http://www.kitware.com/opensource/opensource.html>

    Follow this link to subscribe/unsubscribe:
    https://cmake.org/mailman/listinfo/cmake
    <https://cmake.org/mailman/listinfo/cmake>




--
Eric
--

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to