MantisBT - CMake
View Issue Details
0015052CMakeCMakepublic2014-07-31 13:482016-06-10 14:31
Dmitry 
Kitware Robot 
normalminoralways
closedmoved 
LinuxUbuntu14.04
CMake 2.8.12.2 
 
0015052: INTERFACE_INCLUDE_DIRECTORIES does not allow non-existent directories, but INCLUDE_DIRECTORIES does
It is a duplicate of http://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=14495 [^] , but I think that Stephen Kelly was not right there.

When using add_library(IMPORTED) with INTERFACE_INCLUDE_DIRECTORIES CMake checks existence of the directory in the configuration-time. However, if we declare the same path in INCLUDE_DIRECTORY of the dependent target, everything work fine. This is not consistent.
1. Unzip cmake-include-issue.zip
2. Try to build, build will fail
3. Replace "include(inc1.txt)' on line 25 of CMakeLists.txt with "include(inc2.txt)", effectively replacing

set_target_properties(sub PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${source_dir}/include"
)

with

target_include_directories(main PRIVATE "${source_dir}/include")

4. Now everything works as expected
No tags attached.
related to 0014495closed Stephen Kelly Spurious error about non-existent INTERFACE_INCLUDE_DIRECTORIES of IMPORTED target 
zip cmake-include-issue.zip (2,647) 2014-07-31 13:48
https://public.kitware.com/Bug/file/5208/cmake-include-issue.zip
Issue History
2014-07-31 13:48DmitryNew Issue
2014-07-31 13:48DmitryFile Added: cmake-include-issue.zip
2014-07-31 14:06Brad KingRelationship addedrelated to 0014495
2016-01-31 10:31Xavier DécoretNote Added: 0040384
2016-01-31 18:46DmitryNote Added: 0040385
2016-06-10 14:29Kitware RobotNote Added: 0042598
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0040384)
Xavier Décoret   
2016-01-31 10:31   
This bug is still active. This is very annoying to create third_party libraries using ExternalProject. When declaring the IMPORTED target, you can't specify the include associated to it, because it does not exist yet.
(0040385)
Dmitry   
2016-01-31 18:46   
By the way, there is a workaround - just call file(MAKE_DIRECTORY) for the include directory, then everything goes smooth.
(0042598)
Kitware Robot   
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.