[cmake-developers] EXPORT_NAME-genex

Alexander Neundorf neundorf at kde.org
Mon May 20 06:13:32 EDT 2013


On Saturday 18 May 2013, Stephen Kelly wrote:
> Hi,
> 
> I've pushed the EXPORT_NAME-genex topic to my clone. It allows
> uniform/generic renaming of targets on export. That means that while
> buildsystem targets might be named boost_any/boost_mpl, they can be
> exported as boost::any/boost::mpl like this:
> 
>  set(CMAKE_EXPORT_NAME $<REPLACE:$<TARGET_PROPERTY:NAME>,^boost_,>)
> 
>  add_library(boost_any ...)
>  add_library(boost_mpl ...)
> 
>  install(TARGETS boost_any boost_mpl EXPORT boostTargets ...)
>  install(EXPORT boostTargets NAMESPACE boost:: ...)
> 
> 
> I'd find
> 
>  add_library(boost_any ...)
>  set_property(TARGET boost_any PROPERTY EXPORT_NAME any)
> 
> for each target cumbersome and we'd end up with a macro wrapping
> add_library, which I'm trying to avoid and discourage.
> 
> KDE might use
> 
>  set(CMAKE_EXPORT_NAME $<REPLACE:$<TARGET_PROPERTY:NAME>,^K,>)
> 
>  add_library(KArchive ...)
>  add_library(KCoreAddons ...)
>  install(EXPORT kdeTargets NAMESPACE KF5:: ...)
> 
> to end up with KF5::Archive, KF5::CoreAddons etc. This is more similar to
> Qt5::Core, which does not duplicate the 'Q'.
> 
> Comments? Good idea/bad idea?

You won't be surprised ;-)

I don't think this is needed, IMO it just adds unneeded complexity.

The Config.cmake files can simply provide variables, issue solved.

Alex



More information about the cmake-developers mailing list