KDE/kdelibs/kio

Peter Kümmel syntheticpp at gmx.net
Sun Feb 12 20:14:08 CET 2006


Alexander Neundorf wrote:
> On Sunday 12 February 2006 18:49, Alexander Neundorf wrote:
>> On Sunday 12 February 2006 18:35, Christian Ehrlicher wrote:
>> ...
>>
>>>> +if(ZLIB_FOUND)
>>>> +   include_directories(${ZLIB_INCLUDE_DIR})
>>>> +endif(ZLIB_FOUND)
>> ...
>>
>>> why do we need to add this?
>>> I mean - can't we simply say the we need ZLIB and cmake adds all things
>>> automagically?
>> Basically:
>> if (ZLIB_FOUND)
>>   include_directories(${ZLIB_INCLUDE_DIR})
>> endif (ZLIB_FOUND)
>> ...
>> if (ZLIB_FOUND)
>>   target_link_libraries(kio ${ZLIB_LIBRARY})
>> endif (ZLIB_FOUND)
> 
> Ok, I had a closer look.
> include_directories() is not target specific but a directory property, so the 
> following works too:
> 
> add_library(kio ....)
> 
> if (ZLIB_FOUND)
>   include_directories(${ZLIB_INCLUDE_DIR})
>   target_link_libraries(kio ${ZLIB_LIBRARY})
> endif (ZLIB_FOUND)
> 
> If we really want to, this could be wrapped into a macro which could look like 
> this:
> 
> macro_use_optional_package(kio ZLIB)
> 
> Bye
> Alex

Is it necessary to begin the macros with "macro_"?
Do the user care about how it is implemented?
I would drop it.

Peter


More information about the Kde-buildsystem mailing list