View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014495CMakeCMakepublic2013-10-20 12:552014-07-31 14:06
ReporterNick Hutchinson 
Assigned ToStephen Kelly 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformMacOSOS XOS Version10.8
Product Version 
Target VersionFixed in Version 
Summary0014495: Spurious error about non-existent INTERFACE_INCLUDE_DIRECTORIES of IMPORTED target
DescriptionCMake seems to demand that the directories referenced by the INTERFACE_INCLUDE_DIRECTORIES property of an IMPORTED target can be found at configure-time. This is quite unhelpful if those directories are only generated generated as part of the build.

You get the following error:
> Imported target "XXX" includes non-existent path
>
> "YYY"
>
> in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
>
> * The path was deleted, renamed, or moved to another location.
>
> * An install or uninstall procedure did not complete successfully.
>
> * The installation package was faulty and references files it does not
> provide.

Workaround is add a `file(MAKE_DIRECTORY YYY)` command to the CMakeLists.txt file.
Steps To Reproduce> cat <<-EOF > CMakeLists.txt

cmake_minimum_required(VERSION 2.8.12)
add_library(foo STATIC IMPORTED GLOBAL)
set_property(TARGET foo PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/include")

EOF

> cmake -GNinja .
TagsNo tags attached.
Attached Files

 Relationships
related to 0015052closedKitware Robot INTERFACE_INCLUDE_DIRECTORIES does not allow non-existent directories, but INCLUDE_DIRECTORIES does 

  Notes
(0034187)
Stephen Kelly (developer)
2013-10-21 09:42

IMPORTED targets are imported from elsewhere. By definition, they are not part of your build, but they are an external dependency. Assuming the external dependency is packaged/installed correctly, all files it refers to must be present.

You seem to be creating an IMPORTED target and building something it refers to by hand? Why?
(0034194)
Nick Hutchinson (reporter)
2013-10-21 10:33

I use ExternalProject_Add() to build third-party components and install them into the build tree. The main project can then refer to their build products via IMPORTED targets, which encapsulate their usage requirements by the various nifty INTERFACE_XXX properties added in 2.8.11/2.8.12.

Hardly an obscure use case, I would have thought.
(0034196)
Stephen Kelly (developer)
2013-10-21 10:37

Right. That is not an obscure use-case.

However, you need to ensure that the external project is completed before anything attempts to use it. As far as I know (I haven't used ExternalProject much ), you need to make sure your targets depend on the ExternalProject. Presumably that is responsible for creating the required directory. I presume the IMPORTED targets are created by export() or install(EXPORT) ?

That dependency ensures that when the file with the IMPORTED targets exists and is ready to use, so is the directory.
(0034217)
Stephen Kelly (developer)
2013-10-22 11:44

I'm sure that what is described is a dependency issue, not an issue with the INTERFACE_INCLUDE_DIRECTORIES, as such.
(0035294)
Robert Maynard (manager)
2014-03-05 09:58

Closing resolved issues that have not been updated in more than 4 months

 Issue History
Date Modified Username Field Change
2013-10-20 12:55 Nick Hutchinson New Issue
2013-10-21 08:28 Brad King Assigned To => Stephen Kelly
2013-10-21 08:28 Brad King Status new => assigned
2013-10-21 09:42 Stephen Kelly Note Added: 0034187
2013-10-21 10:33 Nick Hutchinson Note Added: 0034194
2013-10-21 10:37 Stephen Kelly Note Added: 0034196
2013-10-22 11:44 Stephen Kelly Note Added: 0034217
2013-10-22 11:44 Stephen Kelly Status assigned => resolved
2013-10-22 11:44 Stephen Kelly Resolution open => no change required
2014-03-05 09:58 Robert Maynard Note Added: 0035294
2014-03-05 09:58 Robert Maynard Status resolved => closed
2014-07-31 14:06 Brad King Relationship added related to 0015052


Copyright © 2000 - 2018 MantisBT Team