[cmake-developers] [PATCH 3/3] FindQt4: document cross compilation

Brad King brad.king at kitware.com
Thu Jul 30 10:56:02 EDT 2015


On 07/30/2015 09:29 AM, Pascal Bach wrote:
> CMAKE_FIND_ROOT_PATH_MODE would then need to be extended to support
> something like NATIVE and TARGET that one could use to choose where
> to look for files.
> This way every find_* call could explicitly tell if it wants a host
> or a target version.

Are you proposing new keyword arguments to find_* commands to specify
this?  The problem is that find modules don't necessarily know which
kind of binary the application wants.  That is why we have the
CMAKE_FIND_ROOT_PATH_MODE_<type> variables.

The existing CMAKE_FIND_ROOT_PATH* and CMAKE_SYSROOT options have been
sufficient for most packages for a long time.  We regularly get
complaints that FindPythonLibs does not ask the python executable
where to get its libraries, and our answer every time is that it is
wrong to do that for cross compiling.  FindQt4 is making that mistake,
and that is the cause of these troubles.

FindQt4 should be taught not to ask qmake for anything when cross
compiling.

-Brad



More information about the cmake-developers mailing list