View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015052CMakeCMakepublic2014-07-31 13:482016-06-10 14:31
Assigned ToKitware Robot 
PlatformLinuxOSUbuntuOS Version14.04
Product VersionCMake 
Target VersionFixed in Version 
Summary0015052: INTERFACE_INCLUDE_DIRECTORIES does not allow non-existent directories, but INCLUDE_DIRECTORIES does
DescriptionIt is a duplicate of [^] , 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.
Steps To Reproduce1. Unzip
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"


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

4. Now everything works as expected
TagsNo tags attached.
Attached Fileszip file icon [^] (2,647 bytes) 2014-07-31 13:48

related to 0014495closedStephen Kelly Spurious error about non-existent INTERFACE_INCLUDE_DIRECTORIES of IMPORTED target 

Xavier Décoret (reporter)
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.
Dmitry (reporter)
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.
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-07-31 13:48 Dmitry New Issue
2014-07-31 13:48 Dmitry File Added:
2014-07-31 14:06 Brad King Relationship added related to 0014495
2016-01-31 10:31 Xavier Décoret Note Added: 0040384
2016-01-31 18:46 Dmitry Note Added: 0040385
2016-06-10 14:29 Kitware Robot Note Added: 0042598
2016-06-10 14:29 Kitware Robot Status new => 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