[cmake-developers] [CMake 0015643]: Control includes order of project being configured

Mantis Bug Tracker mantis at public.kitware.com
Wed Jul 8 14:49:58 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15643 
====================================================================== 
Reported By:                Stephen Kelly
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15643
Category:                   CMake
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-07-08 20:49 CEST
Last Modified:              2015-07-08 20:49 CEST
====================================================================== 
Summary:                    Control includes order of project being configured
Description: 

A buildsystem can contain

 target_link_libraries(foo PRIVATE
  Vendor1::Dep
  Vendor2::OtherDep
 )

I might have otherdep installed in /opt, such that 

 /opt/otherdep/include/otherdep.h

exists.

The 'dep' dependency might be provided in /usr or /usr/local.

I can run cmake with various settings such as CMAKE_PREFIX_PATH or OtherDep_DIR
to find otherdep in the correct location. The 'foo' target will be compiled with

 -I/opt/otherdep/include

However, if otherdep headers are also installed in /usr or /usr/local, that -I
path will not be used to find the headers, and 'foo' will be miscompiled. 

There is no generic solution to this. If upstream changes the order of the
IMPORTED targets, downstreams with 'dep' in /opt will have the problem instead.

This problem is more-common on platforms with package managers which do not
split headers into -devel packages, and when using a mixture of libraries which
are commonly installed though the package manager (such as Qt), and libraries
which are installed outside the package manager using vendor supplied packages
(such as Qt). It can be reproduced by installing devel packages on linux too.

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/52883/focus=52895

Perhaps a variable could be introduced to set priority of IMPORTED targets when
running cmake. This is an issue local to each actor building the project.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-07-08 20:49 Stephen Kelly  New Issue                                    
======================================================================



More information about the cmake-developers mailing list