FindKDE(3,4) set -fno-execptions unconditionally

David Faure faure at kde.org
Tue May 9 10:44:54 CEST 2006


On Tuesday 09 May 2006 03:15, Michael Biebl wrote:
> Looking at the FindKDE module (cmake 2.4.1), exceptions are disabled
> unconditionally.
> I noticed that because I wanted to build an application which uses exceptions.
> The old autotools build system tried to determine if execptions are
> supported during configure time, at least I found these test in
> acinclude.m4.in:
>     KDE_CHECK_COMPILER_FLAG(fexceptions,
> [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )

This determines if the compiler supports the flag. But still with KDE3 it was the same:
exceptions were disabled by default. You had to add KDE_CXXFLAGS=$(USE_EXCEPTIONS)
to get exceptions.

> Shouldn't FindKDE do the same and determine this flag more dynamically?

It does the same: it finds out what is the correct flag to enable exceptions; but it 
doesn't do so by default.

> Or is there an easy way how I can override this setting. Specifying
> CXXFLAGS=-fexceptions or -DCMAKE_CXX_FLAGS does not help, because the
> value of this variable is prepended and not appended, so
> -fno-exceptions set in FindKDE is always used.

Do like khtml does:
  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  ${KDE4_ENABLE_EXCEPTIONS}")
in your CMakeLists.txt

-- 
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-buildsystem mailing list