[cmake-developers] CMAKE_INSTALL_PREFIX vs CMAKE_SYSROOT ?
Stephen Kelly
steveire at gmail.com
Wed Jul 10 11:17:55 EDT 2013
Brad King wrote:
> On 7/4/2013 4:29 AM, Stephen Kelly wrote:
>> I can't think of anything that can be done with CMAKE_FIND_ROOT_PATH
>> which can't be done with CMAKE_PREFIX_PATH (with a bit more repetition on
>> the command line, I think). Should we enumerate the use cases to consider
>> documenting it obsolete?
>
> One could have several roots in which target-arch packages
> are installed. CMAKE_FIND_ROOT_PATH can list all of them.
> The others are not lists.
I don't understand. CMAKE_PREFIX_PATH is a list.
>
>> If the install prefix is outside the sysroot,
>
> This seems like a reasonable use case that should have full support.
> Isn't your "Goals" example exactly this?
Yes, it is.
>
>>> We already have
>>>
>>> $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${install_dest}
>>
>> Goals:
>> * Install to /opt/kf5 on the target
>> * Install to $HOME/dev/kf5 on the host
>>
>> What values should be used for CMAKE_INSTALL_PREFIX and DESTDIR?
>
> It appears we need several values:
>
> * Prefix on host for host-arch binaries ($HOME/host/kf5? not above)
> * Prefix on host for target-arch binaries ($HOME/dev/kf5 above)
> * Prefix on target for target-arch binaries (/opt/kf5 above)
> * Toolchain sysroot on host (CMAKE_SYSROOT)
>
> Without teaching CMake which targets belong to which category I
> do not see how this can be done without project-specific values.
Even if we simplify and only install one target library (and build nothing
for the host), I don't know what values are appropriate. If I set
CMAKE_INSTALL_PREFIX -> /opt/kf5
DESTDIR -> $HOME/dev/kf5
then the library will end up in
$HOME/dev/kf5/opt/kf5/lib
instead of
$HOME/dev/kf5/lib
right?
Should the latter be supported?
Thanks,
Steve.
More information about the cmake-developers
mailing list