From: Jean-Marc Lasgouttes Date: Tue, 25 Nov 2014 17:41:33 +0000 (+0100) Subject: Add new variables lyx_build_date/time X-Git-Tag: 2.2.0alpha1~1503 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8d6d21c6d9038700418cd8c776a0d29e31847bf6;hp=4066fcac16ca51d175e800f6b07fd1dd2c87fd49;p=features.git 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 f805456cc7..706950fe9f 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 e9e88eabcf..1bb37e509d 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 d1e4ffe20e..935e0b8ef3 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 89b766cc79..2ef209fc42 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 6701accdf9..e5ac23034e 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[-]) extern char const * const lyx_package = PACKAGE; diff --git a/src/version.h b/src/version.h index d952ab5204..ffae5c4f40 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[-]) extern char const * const lyx_package;