]> git.lyx.org Git - features.git/commitdiff
Add new variables lyx_build_date/time
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 25 Nov 2014 17:41:33 +0000 (18:41 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 25 Nov 2014 17:58:35 +0000 (18:58 +0100)
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__.

src/LyX.cpp
src/frontends/qt4/GuiAbout.cpp
src/tex2lyx/Makefile.am
src/tex2lyx/tex2lyx.cpp
src/version.cpp
src/version.h

index f805456cc71b9271a6b5a2f51f661ceddbea83c1..706950fe9fa317b09a0d8fbbe503e6c92ff84a0f 100644 (file)
@@ -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;
index e9e88eabcf5a5aaa7aa4e8f0f83be882abfa1000..1bb37e509de28d4de59911d7ee718a98925e0521 100644 (file)
@@ -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;
index d1e4ffe20e75542839f6487c93c720030d52bce9..935e0b8ef3d83f39266bf404ae165d90781c55d1 100644 (file)
@@ -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 \
index 89b766cc791f01bdd3cdb345db944b5c513b1af0..2ef209fc42305fc03731aa0a84da5197c6637535 100644 (file)
@@ -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);
 }
 
index 6701accdf95180878a3cf816eb1e545d6229449b..e5ac23034e332eb010f811b0adcd8d1966c4e256 100644 (file)
@@ -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;
 
index d952ab52046280ce51317f63f1a1364f93962e5d..ffae5c4f40f7d944179badbb80fa32c4999307be 100644 (file)
@@ -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;