[cmake-developers] Generating imported library targets without the cmake executable

Clinton Stimpson clinton at elemtech.com
Tue Nov 29 11:16:47 EST 2011


On Tuesday, November 29, 2011 09:10:49 am Stephen Kelly wrote:
> Brad King wrote:
> > On 11/29/2011 10:53 AM, Stephen Kelly wrote:
> >> Qt5Core_LIBRARY is intended to be the thing that users would use in the
> >> CMakeLists.txt.
> >> 
> >> I've had another read of the Modules/readme.txt and I guess I need to
> >> change it to be consistent.
> >> 
> >> So should I rename them or should I instead add
> >> 
> >> set(Qt5Core_LIBRARIES ${Qt5Core_LIBRARY})
> > 
> > This convention is only used in Find modules to collect the individual
> > find results.  In the Config modules you already know the complete list
> > 
> > so you can go straight to the plural name.  So the minimum is:
> >    set(Qt5Core_LIBRARIES Qt5Core)
> >    set(Qt5Core_INCLUDE_DIRS "${_qt5_install_prefix}/include"
> >    
> >                             "${_qt5_install_prefix}/include/QtCore")
> > 
> > The library directory holding Qt5Core is not needed in
> > 
> >    set(Qt5Core_LIBRARY_DIRS "${_qt5_install_prefix}/lib") # not needed
> > 
> > because the imported target know where to find the libraries.  However,
> > if there are dependencies on third-party libraries that are not loaded
> > as imported targets or full paths then the locations of those belong
> > in the above list.
> 
> Ok, I'll see about these modifications later or tomorrow.
> 
> > Is there a reason to provide
> > 
> >    set(Qt5Core_HEADER_DIR "${_qt5_install_prefix}/include" )
> > 
> > at all?
> 
> I provide that because FindQt4.cmake provides QT_HEADER_DIR. I'm not sure
> why it is provided by that find module.

QT_HEADER_DIR and others were part of the finding work, which these config files 
don't have to go through.

It wasn't documented, so hopefully people weren't using it.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com


More information about the cmake-developers mailing list