[cmake-developers] target_include_directories() accepts only absolute paths ?

Alexander Neundorf neundorf at kde.org
Sun Jan 27 06:44:18 EST 2013


On Sunday 27 January 2013, Stephen Kelly wrote:
> Alexander Neundorf wrote:
> > Hi,
> > 
> > the docs for the new target_include_directories() say that it accepts
> > only absolute paths.
> > Why is that so ?
> > include_directories() (and also link_directories(), see CMP0015) both
> > accept relative paths and interpret them as relative to
> > CMAKE_CURRENT_SOURCE_DIR. Is there a reason why
> > target_include_directories() should behave differently ?
> 
> That results from the semantics of the INCLUDE_DIRECTORIES property and
> http://public.kitware.com/Bug/view.php?id=13188

Ok.
This applies to setting the target property directly.
But, I think target_include_directories() could still handle relative paths so 
that CMAKE_CURRENT_SOURCE_DIR is prepended before it is set as a target 
property.

Alex



More information about the cmake-developers mailing list