new cmake macro available (starting monday): MACRO_APPEND_IF()

David Faure faure at kde.org
Sun Dec 16 14:19:28 GMT 2007


On Sunday 16 December 2007, Alexander Neundorf wrote:
> Hi,
> 
> I added a new macro MACRO_APPEND_IF(var condition value1..valueN) to kdelibs.
> 
> Typical use is like this, instead of:
> 
> if(SOMETHING_FOUND)
>   set(mySrcs ${mySrcs} file1.cpp file2.cpp)
> endif(SOMETHING_FOUND)
> 
> you can now do:
> 
> macro_append_if(mySrcs SOMETHING_FOUND file1.cpp file2.cpp)

Is this really worth it? The if/set/endif lines are clear and human-readable, while
macro_append_if sounds like "there's some magic involved here, including some
condition and some appending" but without being as clear for the casual reader, IMHO.
Not a strong veto, just wondering...

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list