On Monday 20 April 2009, Denis Scherbakov wrote:
> I have a set of cross-compilers and toolchain files for them. Our binutils
> are separated from gcc. Say:
>
> /cross/path/binutils/bin
> /cross/path/gcc/bin
>
> As I understood from CMakeFindBinUtils.cmake script, it looks for binutils
> only in /cross/path/gcc/bin, and ignores CMAKE_FIND_ROOT_PATH completely.
FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar
HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
This means first it checks in ${_CMAKE_TOOLCHAIN_LOCATION}, and after that in
the standard directories.
CMAKE_FIND_ROOT_PATH should be considered, as it is by default, i.e. first the
directories in CMAKE_FIND_ROOT_PATH, after that the ones without
CMAKE_FIND_ROOT_PATH.
But in general CMAKE_FIND_ROOT_PATH is supposed to point to the target
environment, i.e. libs, headers and data files for the target. The cross
compiler itself not necessarily belongs to this.
How does your CMAKE_FIND_ROOT_PATH look like ?
> Q1: Is it a bug or intended feature?
I'm tending towards "feature".
> Q2: Is there a way to specify location of AR and others in a toolchain
> file?
If you set CMAKE_PREFIX_PATH to /cross/path/binutils/ it should be found.
Or you could just set CMAKE_AR etc. directly in the toolchain file, this
should also keep FIND_PROGRAM() from searching it again.
Alex
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake