View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014974CMakeCMakepublic2014-06-13 09:152016-06-10 14:31
ReporterEvan 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 2.8.12.2 
Target VersionFixed in Version 
Summary0014974: Need to be able to generate absolute paths in install(EXPORT)
DescriptionAs per the description at https://github.com/Homebrew/homebrew/issues/29938 [^] the Qt homebrew packages have build problems because the generated Cmake files use relative paths which don't work with Homebrew's symlinking style. The current recommendation from that ticket seems to be to request absolute paths from cmake.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0036189)
Brad King (manager)
2014-06-13 09:29

CMake generates a lot of paths in a lot of places. Please provide an isolated example.
(0036190)
Evan (reporter)
2014-06-13 09:39
edited on: 2014-06-13 09:40

(I'm not entirely sure what kind of example you're looking for - I don't know much about cmake internals, I just filed this here per the recommendation of the upstream ticket.)

If I understand correctly, Qt uses cmake to generate cmake files for other apps to use when linking against Qt. These generated cmake files use relative paths to locate the various Qt headers and libraries, which doesn't work because sometimes the cmake files are installed in a different PREFIX from the rest of the Qt library (specific example, the generated cmake variable "_qt5Core_install_prefix" uses a relative path, which causes the search for "mkspecs/macx-clang" to fail on OSX when installed with homebrew - this is what caused me to file the original upstream ticket).

Ideally the generated cmake files would contain absolute paths so that this issue doesn't occur.

For more context and some intelligent discussion by people who know more than me about the underlying frameworks, please read the homebrew ticket I originally linked.

(0036191)
Brad King (manager)
2014-06-13 09:50

Files like /usr/local/lib/cmake/Qt5Core/Qt5CoreConfig.cmake are provided by Qt5 and are not generated by CMake. Qt5 uses qmake and as part of their build they generate some .cmake files and install them.
(0036193)
Stephen Kelly (developer)
2014-06-13 10:31

The issue is that homebrew creates symlinks from /usr/local to another location. An issue similar to the usr-move problem seen with ArchLinux can therefore arise if homebrew does not symlink everything. This issue became known because they do not symlink the plugins/ or mkspecs/ directories installed to by Qt.

This problem can affect any file generated by cmake install(EXPORT) which contains relative paths (eg any include directory in INTERFACE_INCLUDE_DIRECTORIES, any plugin installed to $PREFIX/plugins) if the package is found in /usr/local but it actually exists elsewhere.
(0036194)
Brad King (manager)
2014-06-13 10:41

Re 0014974:0036193: Ahh, another example of cross-prefix symlinks breaking relocatable packages.

For the usr-move case the logic is here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmExportInstallFileGenerator.cxx;hb=v3.0.0#l81 [^]

and similarly here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakePackageConfigHelpers.cmake;hb=v3.0.0#l254 [^]

The approach is to detect when the package is found in a path that is a symlink to the original installation path and then switch to the latter. The logic to do all this is only activated right now when the installation path is in /lib or /usr/lib (or lib64 versions). Perhaps we need an explicit option to enable it so packagers producing non-reloctable packages can use it.
(0037543)
宋文武 (reporter)
2015-01-03 00:48

Hi, when using CMake/Qt5 in Guix, we get executables build with no RPATH to Qt's
libraries. IIUC, it's the desired behaviors of imported targets. But we really
want to get non-relocatable one.

In Guix:
  there is in no /lib, /lib64, /usr ...
  every package install into its own directory
  every executable should link explicitly with RPATHs to find libraries
  every executable should be non-relocatable

We definitely need an option to let import targets export full path, and will be linked with full rpath.

Thanks!
(0042567)
Kitware Robot (administrator)
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.

 Issue History
Date Modified Username Field Change
2014-06-13 09:15 Evan New Issue
2014-06-13 09:29 Brad King Note Added: 0036189
2014-06-13 09:39 Evan Note Added: 0036190
2014-06-13 09:40 Evan Note Edited: 0036190
2014-06-13 09:50 Brad King Note Added: 0036191
2014-06-13 10:31 Stephen Kelly Note Added: 0036193
2014-06-13 10:34 Brad King Status new => backlog
2014-06-13 10:34 Brad King Summary Need to be able to generate absolute paths => Need to be able to generate absolute paths in install(EXPORT)
2014-06-13 10:41 Brad King Note Added: 0036194
2015-01-03 00:48 宋文武 Note Added: 0037543
2016-06-10 14:29 Kitware Robot Note Added: 0042567
2016-06-10 14:29 Kitware Robot Status backlog => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team