[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-cvs
Subject:    [LyX/master] Add new variables lyx_build_date/time
From:       Jean-Marc Lasgouttes <lasgouttes () lyx ! org>
Date:       2014-11-25 17:59:28
Message-ID: 20141125175928.587FE2807A3 () lyx ! lyx ! org
[Download RAW message or body]

commit 8d6d21c6d9038700418cd8c776a0d29e31847bf6
Author: Jean-Marc Lasgouttes <lasgouttes@lyx.org>
Date:   Tue Nov 25 18:41:33 2014 +0100

    Add new variables lyx_build_date/time
    
    These are now in version.cpp. The build machinery should therefore make sure
    that version.cpp is recompiled at every compilation.
    
    These variables are now referred to by the other places that made use of __DATE__ and __TIME__.

diff --git a/src/LyX.cpp b/src/LyX.cpp
index f805456..706950f 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -1150,7 +1150,7 @@ int parse_version(string const &, string const &, string &)
 		cout << to_utf8(_("  Git commit hash "))
 		     << string(lyx_git_commit_hash).substr(0,8) << endl;
 	cout << to_utf8(bformat(_("Built on %1$s[[date]], %2$s[[time]]"),
-		from_ascii(__DATE__), from_ascii(__TIME__))) << endl;
+		from_ascii(lyx_build_date), from_ascii(lyx_build_time))) << endl;
 	cout << lyx_version_info << endl;
 	exit(0);
 	return 0;
diff --git a/src/frontends/qt4/GuiAbout.cpp b/src/frontends/qt4/GuiAbout.cpp
index e9e88ea..1bb37e5 100644
--- a/src/frontends/qt4/GuiAbout.cpp
+++ b/src/frontends/qt4/GuiAbout.cpp
@@ -147,7 +147,7 @@ static QString buildinfo()
 		out << qt_("  Git commit hash ")
 		    << QString(lyx_git_commit_hash).left(8) << endl;
 	out << toqstr(bformat(_("Built on %1$s[[date]], %2$s[[time]]"),
-		from_ascii(__DATE__), from_ascii(__TIME__))) << endl;
+		from_ascii(lyx_build_date), from_ascii(lyx_build_time))) << endl;
 
 	out << lyx_version_info << endl;
 	return res;
diff --git a/src/tex2lyx/Makefile.am b/src/tex2lyx/Makefile.am
index d1e4ffe..935e0b8 100644
--- a/src/tex2lyx/Makefile.am
+++ b/src/tex2lyx/Makefile.am
@@ -18,7 +18,8 @@ bin_PROGRAMS = tex2lyx
 DEFAULT_INCLUDES =
 
 AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src/tex2lyx \
-	-I$(top_srcdir)/src -I$(top_builddir) $(BOOST_INCLUDES)
+	-I$(top_srcdir)/src -I$(top_builddir) -I$(top_builddir)/src \
+	$(BOOST_INCLUDES)
 
 TEST_FILES = \
 	test/runtests.cmake \
diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp
index 89b766c..2ef209f 100644
--- a/src/tex2lyx/tex2lyx.cpp
+++ b/src/tex2lyx/tex2lyx.cpp
@@ -532,7 +532,7 @@ typedef int (*cmd_helper)(string const &, string const &);
 
 int parse_help(string const &, string const &)
 {
-	cerr << "Usage: tex2lyx [options] infile.tex [outfile.lyx]\n"
+	cout << "Usage: tex2lyx [options] infile.tex [outfile.lyx]\n"
 		"Options:\n"
 		"\t-c textclass       Declare the textclass.\n"
 		"\t-m mod1[,mod2...]  Load the given modules.\n"
@@ -563,11 +563,12 @@ int parse_help(string const &, string const &)
 
 int parse_version(string const &, string const &)
 {
-	lyxerr << "tex2lyx " << lyx_version
-	       << " (" << lyx_release_date << ")" << endl;
-	lyxerr << "Built on " << __DATE__ << ", " << __TIME__ << endl;
+	cout << "tex2lyx " << lyx_version
+	     << " (" << lyx_release_date << ")" << endl;
+	cout << "Built on " << lyx_build_date << ", " << lyx_build_time
+	     << endl;
 
-	lyxerr << lyx_version_info << endl;
+	cout << lyx_version_info << endl;
 	exit(error_code);
 }
 
diff --git a/src/version.cpp b/src/version.cpp
index 6701acc..e5ac230 100644
--- a/src/version.cpp
+++ b/src/version.cpp
@@ -29,6 +29,11 @@ extern char const * const lyx_git_commit_hash = LYX_GIT_COMMIT_HASH;
 ///
 extern char const * const lyx_release_date = LYX_DATE;
 
+///
+extern char const * const lyx_build_date = __DATE__;
+///
+extern char const * const lyx_build_time = __TIME__;
+
 /// Package identifier (lyx[-<version-suffix>])
 extern char const * const lyx_package = PACKAGE;
 
diff --git a/src/version.h b/src/version.h
index d952ab5..ffae5c4 100644
--- a/src/version.h
+++ b/src/version.h
@@ -23,6 +23,10 @@ extern const int lyx_version_minor;
 extern char const * const lyx_git_commit_hash;
 ///
 extern char const * const lyx_release_date;
+///
+extern char const * const lyx_build_date;
+///
+extern char const * const lyx_build_time;
 
 /// Package identifier (lyx[-<version-suffix>])
 extern char const * const lyx_package;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic