[CMake] Find* and cross compiling

Rodolfo Lima rodolfo at rodsoft.org
Fri Dec 28 18:38:57 EST 2007


Hi all,
I've been exercising cmake-cvs's cross-compiling capabilities and I've
noticed that the way several Find* scripts work doesn't behave well with
cross-compiling.

Usually when doing this kind of builds (at least in linux), one have a
place (for instance /usr/i686-mingw32-pc) where all binaries compiled to
 run on the target platform resides.

When looking for installed libraries, the Find* first try to look into
this prefix (/usr/i686-mingw32-pc), but it it doesn't find, they
continue by looking into /usr, picking the incorrect binaries, since
these are compiled to the native system.

I've found those issues in FindLua*.cmake, FindFreetype.cmake and
others. The reason is that they specify '/usr', '/usr/local', ... as
search paths, instead of relying on the correct cmake's default.

If the developers agree that this is a major blocker for cross-compiling
with cmake, I could help by correcting some scripts. Just let me know.

Regards,
rod



More information about the CMake mailing list