[cmake-developers] CMake usage requirements in KDE Frameworks

Alexander Neundorf neundorf at kde.org
Wed Mar 20 20:31:35 UTC 2013


On Tuesday 19 March 2013, Brad King wrote:
> On 03/19/2013 04:02 PM, Alexander Neundorf wrote:
> > On Tuesday 19 March 2013, Stephen Kelly wrote:
> >> I don't mind renaming it, but it's a topic for the cmake list.
> > 
> > So, I think the variable name CMAKE_BUILD_INTERFACE_INCLUDES is to
> > general. Since it is similar to the effect of CMAKE_INCLUDE_CURRENT_DIR,
> > I suggest renaming it e.g. to CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE.
> 
> The proposed name is much better.  The old name was never in a final
> release so it is easy to rename now:
> 
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc43477d
> 
> >> applies to both the BUILD and INSTALL include interfaces. To limit it to
> >> 
> >> one or the other, you have to specify it:
> >>  target_include_directories(foo INTERFACE
> >>  
> >>    "$<BUILD_INTERFACE:/foo/interface/only>"
> >>  
> >>  )
> > 
> > Why was this generator expression approach chosen over simply adding
> > suitable keywords, as it is done for all other cmake commands ?
> > 
> > target_include_directories(foo INTERFACE_BUILD
> > ${CMAKE_CURRENT_SOURCE_DIR}
> > 
> >                                                ${CMAKE_CURRENT_SOURCE_DIR
> >                                                }/whatever/
> >                                                ${CMAKE_CURRENT_BINARY_DI
> >                                                R}
> >                                
> >                                INTERFACE_INSTALL ${INCLUDE_INSTALL_DIR} )
> 
> The keywords won't interact well with PUBLIC/PRIVATE/INTERFACE keywords.

Let's assume there would be only PRIVATE, INTERFACE_BUILD and 
INTERFACE_INSTALL.
I'll use PRIVATE for building the target.
I'll add INTERFACE_BUILD if I want to make using this target within the 
project easier.
I'll add INTERFACE_INSTALL if I want to make using this target when installed 
easier.

Am I correct so far ?

So e.g. I could do 
tid(hello
   PRIVATE ${Foo_INCLUDE_DIRS} ${Bar_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/blub
   INTERFACE_BUILD ${CMAKE_SOURCE_DIR}/blub ${Bar_INCLUDE_DIRS}
   INTERFACE_INSTALL ${INCLUDE_INSTALL_DIR} ${Bar_INCLUDE_DIRS} )

In which way would this be problematic ?

Do we actually need the "PUBLIC" part ? It seems unnecessary to me.

Alex


More information about the Kde-frameworks-devel mailing list