MantisBT - CMake
View Issue Details
0014300CMakeCMakepublic2013-07-18 05:142016-06-10 14:31
herbrechtsmeier 
Kitware Robot 
normalminoralways
closedmoved 
x86_64Ubuntu10.04.4
CMake-2-8 
 
0014300: The _CMAKE_TOOLCHAIN_LOCATION variable doesn't work in combination with CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY.
The _CMAKE_TOOLCHAIN_LOCATION variable is set to the real path (including the system root) in CMakeDetermineCCompiler.cmake module. In the CMakeFindBinUtils.cmake module this path is interpreted as relative path in the find root paths. Additionally it is impossible to pass a path which is outside of the system root or the CMAKE_FIND_ROOT_PATH.

The later is used in the cross build environment OpenEmbedded which only use the compiler from the build system and therefore set CMAKE_FIND_ROOT_PATH_MODE_* to ONLY during native builds.
- Create a toolchain file:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER /usr/bin/gcc)
set(CMAKE_CXX_COMPILER /usr/bin/g++)
set(CMAKE_FIND_ROOT_PATH /path/to/system/root)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

- Create a CMakeLists.txt
make_minimum_required(VERSION 2.8)
message("${_CMAKE_TOOLCHAIN_LOCATION}")
message("${CMAKE_C_COMPILER}")
message("${CMAKE_AR}")

- Run cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake .

- Output
/usr/bin
/usr/bin/gcc
CMAKE_AR-NOTFOUND
No tags attached.
Issue History
2013-07-18 05:14herbrechtsmeierNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0042321
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042321)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.