KDECompilerSettings.cmake added to extra-cmake-modules

Alexander Neundorf neundorf at kde.org
Fri Feb 17 17:58:04 UTC 2012


I extracted the compiler settings part from FindKDE4Internal.cmake and create 
a file KDECompilerSettings.cmake from it.
It is in extra-cmake-modules/kde-modules/.

This is by far not done.
I a lot of places where I saw things which seemed like they shouldn't be there 
I added a TODO and a comment what I think should be done instead or why it was 

It also still directly sets the CMAKE_CXX_FLAGS etc. variables, which in 
general should not be done by any cmake module.

It contains:
* settings RPATH
* setting link flags
* setting compile flags
* setting up the build types
* settings definitions into _KDE4_PLATFORM_DEFINITIONS

What should we do ?
Instead of setting CMAKE_CXX_FLAGS, set e.g. KDE_CMAKE_CXX_FLAGS, and let the 
user decide whether he wants to use them ?
This might be quite some code in user projects, since they'll have to do this 
for all buildtypes.
Or they are clever and do 

(which is not good enough for the multi-configuration generators (xcode, 

Or put all that in a macro, so users have to do something like the following ?


Or should we just declare that by including that file (which you don't have to 
do) you just get those flags automatically ?
Then maybe the RPATH settings should be not in this file, but somewhere else.

And one more note: for using this file, you currently need cmake git master.


More information about the Kde-buildsystem mailing list