[CMake] CMAKE_FIND_ROOT_PATH and cross-compilation

Marcel Loose loose at astron.nl
Tue Jul 14 03:37:46 EDT 2009


Hi all,

Is there a way to globally set a variable or property that forces each
find_xxx() command to only use CMAKE_FIND_ROOT_PATH when searching for
files?

The reason I'm asking this is that I'm getting errors like this:

  Cannot generate a safe runtime search path for target getparsetvalue
  because files in some directories may conflict with libraries in
  implicit directories:

    runtime library [libz.so.1] in /usr/lib may be hidden by files in:
      /bgsys/drivers/ppcfloor/linux/OS/usr/lib

  Some of these libraries may not be found correctly.

I suspect it has to do with find_xxx() not only searching in
CMAKE_FIND_ROOT_PATH but also in system directories.

Now I know that you can add ONLY_CMAKE_FIND_ROOT_PATH to a find_xxx()
option. However, I only need this when cross-compiling.

In the documentation I saw a hint about CMAKE_FIND_ROOT_PATH_MODE_XXX,
but I couldn't find any more info on that. Is this the variable I'm
looking for? And if so, is it a boolean?

Best regards,
Marcel Loose.




More information about the CMake mailing list