Am Montag, 2. Dezember 2013 um 13:16:33, schrieb Vincent van Ravesteijn 
<v...@lyx.org>
> On Mon, Dec 2, 2013 at 11:50 AM, Kornel Benko <kor...@lyx.org> wrote:
> 
> >  Am Montag, 2. Dezember 2013 um 09:00:30, schrieb Vincent van Ravesteijn <
> > v...@lyx.org>
> >
> > > On Sat, Nov 30, 2013 at 7:08 PM, Scott Kostyshak <skost...@lyx.org>
> > wrote:
> >
> > >
> >
> > > > commit 374cf6a39f321c7843b36aab242e0852b01887b8
> >
> > > > Author: Scott Kostyshak <skost...@lyx.org>
> >
> > > > Date: Fri Nov 29 21:08:48 2013 -0500
> >
> > > >
> >
> > > > CMake: allow compile-time C++ flags to be set
> >
> > > >
> >
> > > > For example, one could run CMake as follows:
> >
> > > > cmake -DLYX_CXX_FLAGS_EXTRA="-Werror"
> >
> > > >
> >
> > > > Thanks to Kornel.
> >
> > > >
> >
> > > > diff --git a/CMakeLists.txt b/CMakeLists.txt
> >
> > > > index c285dc0..c0fd673 100644
> >
> > > > --- a/CMakeLists.txt
> >
> > > > +++ b/CMakeLists.txt
> >
> > > > @@ -468,6 +468,10 @@ if(NOT MSVC)
> >
> > > > endif()
> >
> > > > endif()
> >
> > > >
> >
> > > > +if(LYX_CXX_FLAGS_EXTRA)
> >
> > > > + add_definitions(${LYX_CXX_FLAGS_EXTRA})
> >
> > > > +endif()
> >
> > > > +
> >
> > > > find_package(Qt5Core QUIET)
> >
> > > > if (Qt5Core_FOUND)
> >
> > > > find_package(Qt5Widgets REQUIRED)
> >
> > > >
> >
> > >
> >
> > > Does this work well in the CMake gui as well ?
> >
> >
> >
> > No, and it should not do. It is not a cache variable.
> >
> >
> >
> > > I would expect some line like set(LYX_CXX_FLAGS_EXTRA "" CACHE STRING
> >
> > > "Extra compiler flags")
> >
> >
> >
> > Please no. Why do you want it in the cache? In my understanding it is for
> > developer only,
> >
> > searching for some warnings.
> >
> >
> >
> > > Vincent
> >
> >
> >
> > Kornel
> >
> 
> Well, I'm using the CMake GUI, and I'm a developer. I wouldn't want to
> switch to the command line cmake just because of this one option.

Hmm, makes sense for me ...

> You can mark the option as advanced if you want... (IIRC).

We can mark the variable as advanced, yes. (It is not option (on/off) in cmake 
sense)

The attached patch works as you like.
To see the variable in the cmake-gui, you have to reconfigure twice.

BTW, we do not come very far compiling with -Werror.
...
cd /usr/BUILD/BuildLyxGit/boost/libs/signals && /usr/bin/c++    -Wall 
-Wunused-parameter -std=gnu++0x -fno-strict-aliasing  -Wall -Wunused-parameter 
-std=gnu++0x -fno-strict-aliasing -O0 -g3 -D_DEBUG -I/usr/BUILD/BuildLyxGit 
-I/usr/src/lyx/lyx-git/src -I/usr/include/enchant -I/usr/src/lyx/lyx-git/boost  
  -Werror -DBOOST_USER_CONFIG="<config.h>" -o 
CMakeFiles/boost_signals.dir/src/signal_base.cpp.o -c 
/usr/src/lyx/lyx-git/boost/libs/signals/src/signal_base.cpp
/usr/src/lyx/lyx-git/boost/libs/signals/src/signal_base.cpp: In static member 
function ‘static void 
boost::signals::detail::signal_base_impl::slot_disconnected(void*, void*)’:
/usr/src/lyx/lyx-git/boost/libs/signals/src/signal_base.cpp:136:37: error: 
‘auto_ptr’ is deprecated (declared at 
/usr/include/c++/4.6/backward/auto_ptr.h:87) [-Werror=deprecated-declarations]
cc1plus: all warnings being treated as errors
make[2]: *** 
[boost/libs/signals/CMakeFiles/boost_signals.dir/src/signal_base.cpp.o] Error 1
make[2]: Leaving directory `/usr/BUILD/BuildLyxGit'
make[1]: *** [boost/libs/signals/CMakeFiles/boost_signals.dir/all] Error 2
make[1]: Leaving directory `/usr/BUILD/BuildLyxGit'
make: *** [all] Error 2
...

> Vincent

        Kornel
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ccb4a6c..034c864 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -279,7 +279,8 @@ if (LYX_LOCALVERSIONING)
 	FIND_PROGRAM(LYX_GITVERSION git)
 	#message(STATUS "gitversion = ${LYX_GITVERSION}")
 	if(LYX_GITVERSION)
-		EXECUTE_PROCESS(COMMAND ${LYX_GITVERSION} "describe" WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE LYX_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
+		EXECUTE_PROCESS(COMMAND ${LYX_GITVERSION} describe --match 2.0.0 HEAD
+                WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE LYX_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
 		if (LYX_PACKAGE_RELEASE MATCHES "^2\\.0\\.0\\-\([0-9]+\)\\-.*$")
 		  # We will add offset of 40000 to get appropriate value to
 		  # previous svn.

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

Reply via email to