[CMake] Buggy CPack generator behaviour?

Bjørn Forsman bjorn.forsman at gmail.com
Thu Jul 28 18:02:42 EDT 2011


2011/7/28 Eric Noulard <eric.noulard at gmail.com>:
> 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.

What do you mean with 'not relocatable'? I didn't see any difference
in the archive layouts of RPM and DEB when changing CPACK_SET_DESTIR
from 'not set' to ON. Didn't you say that RPM and DEB generators sets
CPACK_SET_DESTDIR=ON *itself*?

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

Huh?

I have never used CPACK_CONFIG_PROJECT_FILE, I just
set(CPACK_SET_DESTDIR ON) in CMakeLists.txt and it fixed absolute
DESTINATION paths for the archive generators. Just like you said in
the first email. (Yay!)

Best regards,
Bjørn Forsman


More information about the CMake mailing list