[CMake] CPack. Modifying the installation prefix when building relocateable RPMs. v3.0.1

Domen Vrankar domen.vrankar at gmail.com
Mon Jan 19 15:30:02 EST 2015


2015-01-19 17:06 GMT+01:00  <Alan.Thompson at glasgow.ac.uk>:
> I am trying to build rpms for projects so they can be installed together
> using a modified yum into a user defined area as
> <new_prefix>/<project>/<platform>/<installed_binaries>
> hence the rpms should look like
> <relocatable>/<project>/<platform>/<installed_binaries>
>
> The only way I could find to do this was to
> set(CPACK_PACKAGING_INSTALL_PREFIX <relocatable>)
> set(CPACK_INSTALL_PREFIX <relocatable>/<project>/<platform>)
> and then call an install script which simply does
> SET(CPACK_SET_DESTDIR "")

Maybe I don't understand the problem but writing something like this:
install(TARGET some_target DESTINATION
"${INSTALL_PREFIX}/some_location") where install_prefix could be set
as "${CURRENT_PROJECT}/${CURRENT_PLATFORM}" (should be a relative
path)

and then write:
set(CPACK_PACKAGING_INSTALL_PREFIX "${RELOCATABLE}") where relocatable
can be "/"

should produce what you want.

If you really don't want to write "${INSTALL_PREFIX}" for each install
location then your solution would probably be the best way to go but
IMO setting install location is the cleaner solution.

Regards,
Domen


More information about the CMake mailing list