Thiago Macieira thiago at kde.org
Sun Nov 20 13:14:39 UTC 2011

On Sunday, 20 de November de 2011 12.57.31, Alexander Neundorf wrote:
> When cross compiling, cmake considers the variable CMAKE_FIND_ROOT_PATH
> when  searching stuff ( see http://www.vtk.org/Wiki/CMake_Cross_Compiling).
> Now let's say it found a library there (nepomukquery).
> When linking against this, it would have to tell the linker to link with
> the  host path, but use the target path for the RPATH, i.e. remove the
> directory which was used from CMAKE_FIND_ROOT_PATH when calculating the

I highly recommend adding support in cmake for the --sysroot option to the 
compiler and linker and supporting that too in cmake's own engine. The sysroot 
option is not exactly equivalent to a chroot: you may still find build files 
outside it, such as the library you're compiling. However, it changes where 
the default locations are.

It's important to pass that option to the compiler and linker so they find the 
correct /usr/include and /usr/lib, for files required in the compilation that 
cmake won't know about (such as crt1.o). With PKG_CONFIG_SYSROOT_DIR and 
PKG_CONFIG_LIBDIR set, the sysroot is prepended to any -I or -L option 
presented by pkg-config that is read from a .pc file found inside the sysroot.

When that option is in effect, cmake should do the same: search for cmake 
configuration files inside the sysroot first and not use any of the system 
default paths. It can still use the user-supplied paths. In addition to that, 
it should treat absolute paths found inside the sysroot as relative to the 
sysroot, so the problem that Aleix is seeing would not exist.

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20111120/705dfa03/attachment.sig>

More information about the Kde-buildsystem mailing list