[cmake-developers] [CMake 0014300]: The _CMAKE_TOOLCHAIN_LOCATION variable doesn't work in combination with CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY.

Mantis Bug Tracker mantis at public.kitware.com
Thu Jul 18 05:14:28 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14300 
====================================================================== 
Reported By:                herbrechtsmeier
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14300
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-07-18 05:14 EDT
Last Modified:              2013-07-18 05:14 EDT
====================================================================== 
Summary:                    The _CMAKE_TOOLCHAIN_LOCATION variable doesn't work
in combination with CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY.
Description: 
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.


Steps to Reproduce: 
- 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

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-07-18 05:14 herbrechtsmeierNew Issue                                    
======================================================================




More information about the cmake-developers mailing list