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

Stephen Kelly steveire at gmail.com
Tue Nov 29 20:40:30 EST 2011


Alexander Neundorf wrote:

> On Tuesday 29 November 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.
> 
> Yes.
> Nevertheless, personally I would also provide the Qt5Core_LIBRARY
> variable, so if somebody wants to have a look what that variable currently
> actually is (would by the name if the imported target), he can do that,
> and then maybe do something with the target name.
> This is harder if there is only the plural version of the variables.
> I'd say those singular versions are not strictly necessary, but they don't
> hurt and can in some cases be useful.

If it's a cached variable, someone could potentially redefine QtCore_LIBRARY 
to some other Qt on their system than the one listed in the config file. I 
don't know if that's something that is intended to be supported, but I think 
I've seen someone do things like that before.

It seems like if things like that should be supported, then both the 
singular and plural forms should exist.

When there's agreement on whether both should exist I can patch the code.

Thanks,

Steve.





More information about the cmake-developers mailing list