summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-07-17 21:03:40 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-07-17 21:03:40 +0000
commit70586fa27b270f48e36b5f92f0acf803eb723e6a (patch)
treee47ccad7e06b47d5b692e686344eda3956298ae5 /src
parentCleanup: eliminate require-config.h (diff)
downloadinkscape-70586fa27b270f48e36b5f92f0acf803eb723e6a.tar.gz
inkscape-70586fa27b270f48e36b5f92f0acf803eb723e6a.zip
Cleanup: eliminate version from config.h
The idea behind inkscape-version.h / inkscape-version.cpp is to avoid rebuilding most of the code base when the version number changes. Defining a version number in config.h defeats this purpose.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/extension/internal/latex-pstricks.cpp5
-rw-r--r--src/extension/internal/latex-text-renderer.cpp3
-rw-r--r--src/inkscape-version.cpp.in2
-rw-r--r--src/menus-skeleton.h2
5 files changed, 11 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d1fbc0f78..d10e4ec25 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -412,7 +412,10 @@ set(inkscape_SRC
# Generate version file
# -----------------------------------------------------------------------------
-# a custom command that is always built (as run_always.txt is never actually created)
+# configure with values known at configure time
+configure_file(inkscape-version.cpp.in ${CMAKE_BINARY_DIR}/src/inkscape-version.cpp.in @ONLY)
+
+# configure further at build time (always built as run_always.txt is never actually created)
add_custom_command(
OUTPUT inkscape-version.cpp run_always.txt
COMMAND ${CMAKE_COMMAND}
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp
index ae8f30a5c..018c56d82 100644
--- a/src/extension/internal/latex-pstricks.cpp
+++ b/src/extension/internal/latex-pstricks.cpp
@@ -25,6 +25,7 @@
#include "extension/print.h"
#include "extension/system.h"
+#include "inkscape-version.h"
#include "io/sys.h"
#include "latex-pstricks.h"
#include "sp-item.h"
@@ -121,8 +122,8 @@ unsigned int PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc
if (res >= 0) {
- os << "%%Creator: " << PACKAGE_STRING << "\n";
- os << "%%Please note this file requires PSTricks extensions\n";
+ os << "%%Creator: Inkscape " << Inkscape::version_string << "\n";
+ os << "%%Please note this file requires PSTricks extensions\n";
os << "\\psset{xunit=.5pt,yunit=.5pt,runit=.5pt}\n";
// from now on we can output px, but they will be treated as pt
diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp
index dec75aeb6..d1cf7e484 100644
--- a/src/extension/internal/latex-text-renderer.cpp
+++ b/src/extension/internal/latex-text-renderer.cpp
@@ -43,6 +43,7 @@
#include "extension/system.h"
+#include "inkscape-version.h"
#include "io/sys.h"
#include "document.h"
@@ -153,7 +154,7 @@ LaTeXTextRenderer::setTargetFile(gchar const *filename) {
(void) signal(SIGPIPE, SIG_IGN);
#endif
- fprintf(_stream, "%%%% Creator: Inkscape %s, www.inkscape.org\n", PACKAGE_STRING);
+ fprintf(_stream, "%%%% Creator: Inkscape %s, www.inkscape.org\n", Inkscape::version_string);
fprintf(_stream, "%%%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010\n");
fprintf(_stream, "%%%% Accompanies image file '%s' (pdf, eps, ps)\n", _filename);
fprintf(_stream, "%%%%\n");
diff --git a/src/inkscape-version.cpp.in b/src/inkscape-version.cpp.in
index 9056ddf8d..455a0fe99 100644
--- a/src/inkscape-version.cpp.in
+++ b/src/inkscape-version.cpp.in
@@ -3,5 +3,5 @@
#endif
namespace Inkscape {
- char const *version_string = VERSION " " "(${INKSCAPE_REVISION})";
+ char const *version_string = "@INKSCAPE_VERSION@" " " "(${INKSCAPE_REVISION})";
}
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index e5991aa1d..ca337e6a7 100644
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
@@ -11,7 +11,7 @@
#endif
static char const menus_skeleton[] =
-"<inkscape version=\"" VERSION "\"\n"
+"<inkscape\n"
" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n"
" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\">\n"
"\n"