[cmake-developers] [CMake 0014367]: IMPORTED_LOCATION does not work for cross-compiling
Mantis Bug Tracker
mantis at public.kitware.com
Mon Aug 19 08:57:04 EDT 2013
The following issue has been SUBMITTED.
======================================================================
http://www.cmake.org/Bug/view.php?id=14367
======================================================================
Reported By: Manuel Nickschas
Assigned To:
======================================================================
Project: CMake
Issue ID: 14367
Category: CMake
Reproducibility: always
Severity: major
Priority: high
Status: new
======================================================================
Date Submitted: 2013-08-19 08:57 EDT
Last Modified: 2013-08-19 08:57 EDT
======================================================================
Summary: IMPORTED_LOCATION does not work for cross-compiling
Description:
In a cross-compile environment (using a toolchain file), the sysroot needs to be
prepended to CMAKE_INSTALL_PREFIX for anything related to file locations on
target. While this is done for e.g. find_package(), install() and the likes,
there seems to be no way to get the IMPORTED_LOCATION property work correctly
for cross-compiling.
In particular, when generating an export file, CMake generates a file that
contains absolute paths for IMPORTED_LOCATION properties. These paths point to
the correct location on target (i.e., based on CMAKE_INSTALL_PREFIX), but you
cannot use them for cross-compiling because there is no way to prepend the
sysroot at build-time. In fact, CMake will refuse to include such an export file
because it can't find the referenced files.
Steps to Reproduce:
1. Setup a cross-compile environment with toolchain file and sysroot
2. Try configuring a CMake-based project that tries to read an exports file
3. Watch CMake not finding the referenced targets in the sysroot and instead
trying to pick them up from the host using the absolute path specified in
IMPORTED_LOCATION
Additional Information:
It would be extremely nice to be able to have the current sysroot prepended by
default, but also to override it somehow per target as e.g. in the case of Qt5,
the host tools (which also are referenced via IMPORTED_LOCATION) need to be
picked up from the native sysroot rather than the target sysroot.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-08-19 08:57 Manuel NickschasNew Issue
======================================================================
More information about the cmake-developers
mailing list