[cmake-developers] CMAKE_INSTALL_PREFIX vs CMAKE_SYSROOT ?

Stephen Kelly steveire at gmail.com
Mon Jul 8 11:57:22 EDT 2013


Brad King wrote:

> On 7/8/2013 11:22 AM, Stephen Kelly wrote:
>> Brad King wrote:
>>> or do you mean that CMAKE_HOST_INSTALL_PREFIX, if defined at all,
>>> completely replaces CMAKE_INSTALL_PREFIX for all install rules?
>> 
>> Yes for install rules, but with some exceptions I think when used in
>> calculations.
>> 
>> For things like the logic in
>> 
>>  cmExportInstallFileGenerator::GenerateMainFile
>> 
>> about the relocatable-/usr/lib-stuff, I think CMAKE_INSTALL_PREFIX should
>> still be used.
> 
> ...because it will be the actual prefix when loaded on the target,
> right?  

Yes, if used on the target from the target, or with a vm or so.

> What if one loads the target library from another project
> on the host?

You mean a case like installing to 

 /opt/kf5-cross

where 

 /opt/kf5-cross/lib -> /opt/kf5-cross/usr/lib

and where we install /opt/kf5-cross/usr/lib/cmake/KArchive.cmake ?

I think the cmake code generated in that method would have to also contain a 
check relative to the CMAKE_HOST_INSTALL_PREFIX, which is a bit unfortunate. 
I can't see another way the logic would work for the same file content post-
deployment, and pre-deployment on the host.

Thanks,

Steve.





More information about the cmake-developers mailing list