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

Stephen Kelly steveire at gmail.com
Tue Nov 29 11:10:49 EST 2011


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.

Thanks,

Steve.





More information about the cmake-developers mailing list