[CMake] Re: FindwxWidgets and Cross-compiling

Rodolfo Lima rodolfo at rodsoft.org
Sat Jan 5 18:43:23 EST 2008


Miguel A. Figueroa-Villanueva escreveu:

> I believe the idea is to ensure that the wx-config used is the one
> from the target platform. I would like to enlist the help of those
> more experienced cross-compiling to affirm that this is the right
> course of action. I am concerned that maybe the
> CMAKE_FIND_ROOT_PATH_MODE_PROGRAM should be set before the
> FIND_PACKAGE call. Would people be setting this differently for
> different programs, so that I need to ensure that only the
> cross-compiling directories are searched for to find wx-config? Or can
> I count on the user to have set this mode correctly for his platform?

Normally during a cross compilation, CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
should be set to NEVER because the programs installed in
${CMAKE_FIND_ROOT_PATH} usually only runs in the target platform. If my
script needs 'sed', for instance, I want the one that runs in the build
platform, which is installed in /usr/bin.

The problem is that the wx-config that returns the correct information
for the target platform is installed in ${CMAKE_FIND_ROOT_PATH}. If
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM remains set to NEVER, the host's
wx-config will be used, and it'll return wrong information. Therefore
the only way (that I know of) to select the correct wx-config is setting
explicitly CMAKE_FIND_ROOT_PATH_MODE_PROGRAM to ONLY as I did in my
patch. This solution works well in my installation (Gentoo).

Regards,
rod



More information about the CMake mailing list