[CMake] Buggy CPack generator behaviour?

Bjørn Forsman bjorn.forsman at gmail.com
Fri Jul 29 05:15:05 EDT 2011


2011/7/29 Eric Noulard <eric.noulard at gmail.com>:
> 2011/7/29 Bjørn Forsman <bjorn.forsman at gmail.com>:
>> 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.
>
> if you do:
>
> rpm -qpi your.rpm
>
> you'll see a line like:
>
> "Relocations : (not relocatable)"
> or
> "Relocations : /usr"
>
> When an rpm is relocatable you can do
>
> rpm -i  --prefix=/your/relocation/prefix your.rpm
>
> if the rpm is not relocatable you can't.

Aha, I see.

>> Didn't you say that RPM and DEB generators sets
>> CPACK_SET_DESTDIR=ON *itself*?
>
> Yes but not too soon (CPack internal step are indeed multiple) such that
> CPack can effectively collect files which are installed purposely with
> ABSOLUTE path and
> treat them as config file in RPM specification file.
>
> When DESTDIR is set to ON by the user CPack cannot do this work
> properly, and spit out a
> warning like:
>
> "CPackRPM:Warning: CPACK_SET_DESTDIR is set (=ON) while requesting a
> relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is
> not supported, the package won't be relocatable."

Aha, I see that now.

>> 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!)
>
> Because you wanted to go along the fast path and I cannot blame you
> but I did Indeed indicate in my firts e-mail:
>
> "If you want to do some specific adjustment depending on the CPack
> generator used
> you may use a CPACK_PROJECT_CONFIG_FILE see doc here:
> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29"
>
> Now that the fast path works for you
> I thought you may be interested in your CPack config "fine tuning".
>
> Read the link here:
> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29
>
> and you'll see that you can setup diferent value of CPACK_<whateever>
> var depending on the CPack Generator
> which is run.
>
> Obviously this is not mandatory in your case because you already get
> what you want,
> but may be you want to try.

Thanks a lot for the pointers.

Best regards,
Bjørn Forsman


More information about the CMake mailing list