How to set CXXFLAGS with CMake?
Allen Winter
winter at kde.org
Mon Apr 17 13:54:20 CEST 2006
On Sunday 16 April 2006 18:18, Michael Pyne wrote:
> Hi all,
>
> I've had a problem report from a kdesvn-build that when setting CXXFLAGS to
> something like -march=i686 that CMake would complain about the '=' character.
> He also reports that setting the CFLAGS environment variable instead does
> work.
>
> kdesvn-build passes CXXFLAGS to CMake like this right now:
>
> cmake -DCMAKE_CXX_FLAGS="$cxxflags" other-options...
>
> The cxxflags are correctly passed as one argument (i.e. no shell IFS stuff is
> going on).
>
> Is there a preferred method to set CXXFLAGS for CMake, or am I doing the right
> thing and it's a CMake bug? The CMake version is the 20060317 snapshot.
>
Hi mpyne,
One idea...
We could introduce a new option for kdelibs/cmake/modules/FindKDE4Internal.cmake,
called say CMAKE_CXX_OPT_FLAGS_RELEASE.
This variable gets appended onto CMAKE_CXX_FLAGS_RELEASE. Note that it would only be used
with release builds.
So you'd call cmake with the extra -DCMAKE_CXX_OPT_FLAGS_RELEASE="-march=i686"
Ditto for CMAKE_C_FLAGS_RELEASE
-Allen
--
Let's Keep the Political Talk Out of KDE PLEASE
More information about the Kde-buildsystem
mailing list