[CMake] Re: FindwxWidgets and Cross-compiling

Alexander Neundorf a.neundorf-work at gmx.net
Sun Jan 6 17:14:19 EST 2008

On Sunday 06 January 2008, Miguel A. Figueroa-Villanueva wrote:
> On Jan 5, 2008 9:38 PM, Rodolfo Lima wrote:
> > Miguel A. Figueroa-Villanueva escreveu:
> > > # Resource file compiler.
> > > FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
> > >   ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw
> > >   )
> > >
> > > I guess not, since in this case any resource compiler that is found
> > > should do, right?
> >
> > Yes, but if there's no wxWidgets compiled for the build system
> > installed, we've got a problem, since the system usually cannot run the
> > target wxrc. On a ubuntu system, wine is automatically invoked to run an
> >  Windows executable. Is this situation, cross-compiling to windows in a
> > ubuntu system would work, but that's not a general solution, and I think
> > there's no other way around this other than not setting wxrc_EXECUTABLE
> > in those cases. Maybe you could do a check to see if the found program
> > runs. If it does, set wxWidegts_wxrc_EXECUTABLE. Otherwise, leave this
> > unset.
> Yes, but by CMAKE_FIND_ROOT_PATH_MODE_PROGRAM defaulting to NEVER only
> the wxrc in the host platform will be found. If you want to use
> wxWidegts_wxrc_EXECUTABLE, then it needs to be in the host.
> If this is in fact how it works, then I think is a reasonable solution.

This is now in FindwxWidgets.cmake:

    # Support cross-compiling, only search in the target platform.

I think this is wrong.
Searching an executable which is intended to be executed only in the target 
environment (root) usually doesn't work, since in general it will not be 
possible to actually run the executable even if it is found.

I think the approach to have this type of foo-config executables is somewhat 
broken, having a standard format to store such information would work, 
something xml based probably.

But this doesn't help us here.

Is it possible to use some default locations when cross compiling instead of 
running wx-config ?
You could do 


More information about the CMake mailing list