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

Daniel Pfeifer purplekarrot at gmail.com
Mon Jul 25 12:00:22 EDT 2011


2011/7/25 Brad King <brad.king at kitware.com>
>
> On 07/13/2011 12:10 PM, Alexander Neundorf wrote:
> > When I talked last time with Brad such a feature was still on his TODO, and is
> > there since at least 2007 already, but still more or less at the bottom of the
> > list.
>
> It's more of a "wish I had time to do this" ;)

Brad,

what is your opinion on the $<> syntax I originally proposed?
This would not require creating virtual targets for header only libraries.
Furthermore, it is already implemented, including tests.

> include_directories($<GENERATOR_EXPRESSION>)
> set(GENERATOR_EXPRESSION $<GEN_EXP_1> $<GEN_EXP_2>)

> if(USE_FULLPATH)
>   set(GEN_EXP_1 "${CMAKE_BINARY_DIR}/GenExp1")
>   set(GEN_EXP_2 "${CMAKE_BINARY_DIR}/GenExp2" CACHE STRING "" FORCE)
> else()
>   set(GEN_EXP_1 GenExp1)
>   set(GEN_EXP_2 GenExp2 CACHE STRING "" FORCE)
> endif()
>
> # cyclic dependency must not result in endless loop
> set(GEN_EXP_1 ${GEN_EXP_1} $<GEN_EXP_2>)
> set(GEN_EXP_2 ${GEN_EXP_2} $<GEN_EXP_1> CACHE STRING "" FORCE)

See: https://github.com/purpleKarrot/CMake/blob/4b75b82a7a07e41024c1534163d4f39b45e6402a/Tests/IncludeDirectories/CMakeLists.txt

cheers, Daniel


More information about the CMake mailing list