KDevelop template: Simple CMake based C++ project

Gabor Garami hrgyster at gmail.com
Fri Feb 20 20:11:34 UTC 2009


>> > You may also consider the following using a variable for the source
>> > files: set(%{APPNAMELC}Srcs main.cpp)
>> > add_executable(%{APPNAMELC} ${%{APPNAMELC}Srcs})
>>
>> IMHO that makes the template just harder to understand without giving any
>> benefit at all.
>
> Well, once the project gets bigger, it is usually a good idea to have the list
> of files in a variable, for some macros it is required.
> So I would do it this way right from the start, especially for such a template
> file.

But your recommendation isn't a best. My idea:

set(%{APPNAMELC}_SRCS main.cpp)
add_executable(%{APPNAMELC} ${%{APPNAMELC}_SRCS})

This is readable a bit than your.

Gabor Garami
hrgyster at gmail.com




More information about the KDevelop-devel mailing list