[CMake] Re: HowTo 'Getting Started Cross compilation with cmake' needed

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Fri Jan 19 14:52:24 EST 2007


Claus Klein <claus.klein at arcormail.de>
writes:

> I miss some features needed for cross-compiling, linking and installing to a stage dir.
> The PKGCONFIG(package includedir libdir linkflags cflags), 
> for example, the --define-variable option can't be used.  pkg-config(1)
> support that:

A cleaner solution would be a target-dependent 'pkg-config'. E.g. execute
'arm-linux-gnu-pkg-config' instead of plain 'pkg-config'. Using target
tools by testing the arch-prefix(es) first would be a nice feature for
FIND_PROGRAM().


A '--define-variable=${sysroot}' approach would assume wrong values for
system directories and set e.g.

| -L ${sysroot}/lib -I ${sysroot}/include

which would be stripped for non-cross builds.

Nevertheless, the requested feature should be already possible by setting
the PKGCONFIG_EXECUTABLE variable:

| $ cmake ... -DPKGCONFIG_EXECUTABLE:PATH='/usr/bin/pkg-config --define-variable=...'



Enrico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070119/171e7e50/attachment.pgp


More information about the CMake mailing list