View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015119CMakeCMakepublic2014-08-31 04:222015-03-02 08:57
ReporterAlex Lamaison 
Assigned ToStephen Kelly 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionCMake 3.0 
Target VersionFixed in Version 
Summary0015119: target_include_directories(target INTERFACE) does make sense for custom targets
DescriptionThis commit https://gitorious.org/cmake/cmake/commit/510fdcb18801076e2041eaae2941375eecc93ec2 [^] says "Setting include directories or compile definitions on a target created with add_custom_target does not make sense". But that's not quite true.

If that custom target generates a header file in a particular directory then the INTERFACE variant of target_include_directories makes sense so other targets can pick up its usage requirements by 'linking' against it.

Similarly, if the generated header needs certain compile defintions to use it, the INTERFACE variant of target_compile_definitions also makes sense.
Steps To Reproduceuse add_custom_target to generate a header file in some directory.

use target_include_directories to expose the header file's directory as a usage requirement of that header.

configure.

CMake says "target_include_directories called with non-compilable target type".
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0036766)
Stephen Kelly (developer)
2014-09-09 18:52

You can't 'link against' a custom target.

Consider

 add_library(iface INTERFACE)
 target_include_directories(iface INTERFACE /foo/bar)

for your use-case.
(0038110)
Robert Maynard (manager)
2015-03-02 08:57

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

 Issue History
Date Modified Username Field Change
2014-08-31 04:22 Alex Lamaison New Issue
2014-09-02 09:07 Brad King Assigned To => Stephen Kelly
2014-09-02 09:07 Brad King Status new => assigned
2014-09-09 18:52 Stephen Kelly Note Added: 0036766
2014-09-09 18:52 Stephen Kelly Status assigned => resolved
2014-09-09 18:52 Stephen Kelly Resolution open => no change required
2015-03-02 08:57 Robert Maynard Note Added: 0038110
2015-03-02 08:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team