[CMake] Re: FindwxWidgets and Cross-compiling

Miguel A. Figueroa-Villanueva miguelf at ieee.org
Sat Jan 5 20:52:59 EST 2008


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.

--Miguel


More information about the CMake mailing list