[CMake] [ryppl-dev] Re: $<> expressions in include_directories command

Brad King brad.king at kitware.com
Mon Jul 25 13:16:26 EDT 2011


On 07/25/2011 12:00 PM, Daniel Pfeifer wrote:
> what is your opinion on the $<> syntax I originally proposed?
> This would not require creating virtual targets for header only libraries.

The implementation is just doing delayed variable evaluation and
is not a true generator expression in the same sense as is used
by add_test and add_custom_command.  The latter support only
generator-defined specific expressions with very specific syntax
that can be validated.  The FinalPass of commands is an ancient
implementation detail which exists only in a few commands for
historical reasons and should not be used in new commands.

The proposed solution is to use delayed evaluation to work around
lack of dependency-sorted ordering.  The topological sort already
used by the Boost CMake solves this problem in a better way.  The
ITK project already does CMake-time module dependency detection
and sorting using a similar approach.  It correctly handles the
generation of include directories for each module.  It also handles
header-only modules.  Unfortunately the implementation is embedded
in ITK's CMake code and is not (yet) easily generalizable.

-Brad


More information about the CMake mailing list