[cmake-developers] [CMake 0015119]: target_include_directories(target INTERFACE) does make sense for custom targets

Mantis Bug Tracker mantis at public.kitware.com
Sun Aug 31 04:22:27 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15119 
====================================================================== 
Reported By:                Alex Lamaison
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15119
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-08-31 04:22 EDT
Last Modified:              2014-08-31 04:22 EDT
====================================================================== 
Summary:                    target_include_directories(target INTERFACE) does
make sense for custom targets
Description: 
This 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 Reproduce: 
use 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".
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-08-31 04:22 Alex Lamaison  New Issue                                    
======================================================================



More information about the cmake-developers mailing list