[CMake] Buggy CPack generator behaviour?

Eric Noulard eric.noulard at gmail.com
Thu Jul 28 12:11:29 EDT 2011


2011/7/28 Bjørn Forsman <bjorn.forsman at gmail.com>:
>
> Thanks a lot! With three lines in CMakeLists.txt I now get the same
> behaviour for 'make install' and the package generators:
>
> set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) # don't prepend package name
> etc. (for archive generators)
> set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
> set(CPACK_SET_DESTDIR ON) # fixes absolute paths for archive generators
>
> IMHO, it would be really sweet if cpack could default to
> CPACK_SET_DESTDIR=ON and
> CPACK_PACKAGING_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}. But I don't
> know what that would mean in terms of backwards compatibility
> breakage...

As you guessed this is impossible without backward compat' breakage.
e.g. be aware that with "CPACK_SET_DESTDIR" set to ON RPM and DEB
behavior changes
namely RPM package built with that may not be relocatable.

You may set(CPACK_SET_DESTDIR ON) only for ArchiveGenerator if you
use CPACK_CONFIG_PROJECT_FILE.

> Well anyway, thanks for helping me out :-)

No problem.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list