KDevelop template: Simple CMake based C++ project

Andreas Pakulat apaku at gmx.de
Thu Feb 19 21:52:01 UTC 2009


On 19.02.09 21:57:28, Alexander Neundorf wrote:
> On Thursday 19 February 2009, Alexander Neundorf wrote:
> > On Thursday 19 February 2009, Andreas Pakulat wrote:
> > > On 19.02.09 07:53:07, Gabor Garami wrote:
> > > > Thanks a comment
> > > >
> > > >   - I added CMake module path adding because this project template
> > > > doesn't assume any helper module (like KDE4 stuffs) installed, and, if
> > > > I guess well, this needed if project provided by standalone.
> > >
> > > No its not needed. A CMakeLists.txt to compile main.cpp into foo looks
> > > like this:
> > >
> > > project(foo)
> > > add_executable(foo main.cpp)
> >
> > Now with cmake 2.6.x I would recommend adding a
> > cmake_minimum_required(VERSION x.y[.z] FATAL_ERROR )
> > at the top.
> > Otherwise you will get warnings once your cmake file gets a bit bigger.
> 
> Ok, now I actually had a look at your files, this helps sometimes ;-)
> 
> One thing I'd like to add is, please use all-lower-case for the cmake 
> commands, as is recommended: 

Thats for cmake files inside kde, this one is a template for a new project
so IMHO we're free to use whatever we want. That said, I also like
lower-case more than upper-case :)

> And please add some documentation for kapptemplate_add_app_templates(), it's 
> hard to understand what the code actually does.

I suggest you talk to Anne-Marie Mahfouf, she maintains kapptemplate in
kdesdk. I'll try to take care of the similar macro in kdevplatform, but
feel free to file a bugreport against kdevplatform to remind me :)
 
> 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.

Andreas

-- 
You are sick, twisted and perverted.  I like that in a person.




More information about the KDevelop-devel mailing list