Am Freitag, 29. November 2013 um 23:55:32, schrieb Scott Kostyshak 
<skost...@lyx.org>
> On Fri, Nov 29, 2013 at 4:38 AM, Kornel Benko <kor...@lyx.org> wrote:
> > Am Freitag, 29. November 2013 um 01:39:33, schrieb Scott Kostyshak
> > <skost...@lyx.org>
> >
> >> How does one add compiler flags for the CMake version? Attached is a
> >
> >> patch that allows me to do the following:
> >
> >>
> >
> >> cmake -DCMAKE_CXX_FLAGS="-Werror"
> >
> >
> >
> > I would not try to overwrite a variable 'CMAKE_...'.
> >
> > (Such vars should be reserved for cmake)
> 
> Ah, I will remember this. I had interpreted CMAKE_ variables to mean
> variables that are commonly passed to CMake (across most programs).
> 
> > Use -DLYX_CXX_FLAGS_EXTRA='-Werror -xxx -yyy' or such.
> >
> >
> >
> > And maybe later in CMakeLists.txt
> >
> >
> >
> > if(LYX_CXX_FLAGS_EXTRA)
> >
> > add_definitions(${LYX_CXX_FLAGS_EXTRA})
> >
> > endif()
> >
> >
> >
> > to make it available for other compilers too.
> >
> >
> >
> >> Is there a different way that is recommended?
> >
> >>
> >
> >> Scott
> >
> >
> >
> > Kornel
> 
> How about the attached patch?

Looks good.

> Should I put a line such as the following in somewhere?
> LYX_OPTION(CXX_FLAGS_EXTRA  "Add compiler flags" OFF ALL)
> It does not seem correct because it's not an ON/OFF variable.

Please no. As yuo said, it is not on/off. And more important,
it does not belong to cmake-cache IMHO.

> Or should it not be listed at the end in the CMake output?

Since it changes the behaviour of gcc, it should be listed. But since it is 
directly
(and only through commandline) set by the user, it is not needed.

> Scott

        Kornel

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to