RFC: do not overwrite customs CMake flags

David Faure faure at kde.org
Fri Sep 25 22:20:36 CEST 2009


On Friday 25 September 2009, Christophe Giboudeaux wrote:
> Hello,
> 
> When building any module which includes KDE4Internals, the custom CMake
>  flags are overwritten by the ones in this file which doesn't seem correct.
> 
> Example: If I set :
> export CMAKE_CXX_FLAGS_DEBUGFULL="-ggdb3 -fno-inline"
> or use -DCMAKE_CXX_FLAGS_DEBUGFULL; at compile time, these flags will be
> replaced by the ones from FindKde4Internals.cmake:
> 
> if (CMAKE_COMPILER_IS_GNUCXX)
> [...]
> set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
> 
> 
> Would it make sense to first check if CMake variables exist before defining
> them again ?

If we do that there's no way to fix bugs in FindKDE4Internals.cmake, everyone's
cached value will always overwrite the value written there (even for people 
who didn't configure anything special).

Why not just export CXXFLAGS before configuring?



(hmm interesting, I wonder why I have all the other ones in the cache, like 
CMAKE_CXX_FLAGS_RELWITHDEBINFO, but not the DEBUGFULL one...)

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


More information about the Kde-buildsystem mailing list