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 ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers