[CMake] CPack: avoid creating unnecessary man dirs

Alex Turbov i.zaufi at gmail.com
Sat Oct 29 12:59:55 EDT 2016


Use `CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION` to add a man's dir to
'exclude' list, so RPM package wouldn't have a dir, but files from it... so
it wouldn't conflict w/ `filesystem` package.

On Sun, Oct 30, 2016 at 12:14 AM, Robert J. Hansen <rjh at sixdemonbag.org>
wrote:

> I'm migrating a project from Autotools to CMake.  So far it's been a
> good experience save for installing manpages.
>
> I'm using include(GNUInstallDirs) to help make the migration easier.  In
> my manpage subdir I have the following CMakeLists.txt:
>
> set(MAN_NAMES nsrlsvr.1 nsrlupdate.1)
> add_custom_target(man ALL DEPENDS ${MAN_NAMES})
> install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nsrlsvr.1 DESTINATION
> ${CMAKE_INSTALL_MANDIR}/man1/)
> install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nsrlupdate.1 DESTINATION
> ${CMAKE_INSTALL_MANDIR}/man1/)
>
> This seems to work just fine for a "make install", and it successfully
> generates RPMs with a "make package".  However, those RPMs are
> uninstallable on a Fedora system:
>
> Error: Transaction check error:
>   file /usr/share/man from install of nsrlsvr-1.6.1-1.x86_64 conflicts
> with file from package filesystem-3.2-37.fc24.x86_64
>   file /usr/share/man/man1 from install of nsrlsvr-1.6.1-1.x86_64
> conflicts with file from package filesystem-3.2-37.fc24.x86_64
>
> Apparently, CMake is trying to create dirs even if they already exist.
> Is there any way to suppress this?  What's the best way to address this?
>
> (The full source tree, along with all the CMakeLists.txt files, is
> available at https://github.com/rjhansen/nsrlsvr/ )
> --
>
> 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://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161030/3ac1a0f0/attachment.html>


More information about the CMake mailing list