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

Stephen Kelly stephen.kelly at kdab.com
Tue Nov 29 10:42:37 EST 2011


Brad King wrote:

> On 11/29/2011 8:00 AM, Stephen Kelly wrote:
>> Alexander Neundorf wrote:
>>>> I can't generate the files. I'm asking people with windows and mac
>>>> setups to generate them and post them for review. I don't have those
>>>> setups.
>>>
>>> Just the ones for Linux would already help :-)
>>
>> I managed to get generated files for windows and mac through some IRC
>> puppeteering, so I've attached them here now.
> 
> What is the purpose of conditions like
> 
>    if (NOT "debug" STREQUAL "")
> 
> in the Config.cmake files?

The config files are created using the qmake QMAKE_SUBSTITUTES feature, 
which is functionally similar to configure_file().

qmake knows whether it is building release or debug Qt libraries (or both as 
on windows and mac), so that information is used in the .in file:

https://qt.gitorious.org/+kdab-developers/qt/kdab-developers-
qtbase/blobs/cmake_files/mkspecs/cmake/Qt5BasicConfig.cmake.in

if building debug libraries it sets the debug_type variable to anything non 
empty ("debug", similar for release_type in the same file) and 

if (NOT \"$${debug_type}\" STREQUAL \"\")

is generated to 

if (NOT "debug" STREQUAL "")

Otherwise (if debug libraries are not built) it is generated as

if (NOT "" STREQUAL "")

The mac frameworks stuff etc is done in the same way, as is the windows .lib 
stuff, so the same thing appears several files in the file.

I agree it's not very nice, but I couldn't find a better way to do it. qmake 
doesn't have an equivalent to file(WRITE), which might otherwise be used for 
the platform specific stuff.

Thanks,

Steve.





More information about the cmake-developers mailing list