From eceeca65839d5e61234c235d5a6df0e360707862 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 13 Jun 2011 15:24:52 +0000 Subject: cmake: The cmake files were using the inkscape-version.cpp file generated by autoconfigure. now generate our own. Also remove bad include. (bzr r10289) --- CMakeScripts/inkscape-version.cmake | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 CMakeScripts/inkscape-version.cmake (limited to 'CMakeScripts') diff --git a/CMakeScripts/inkscape-version.cmake b/CMakeScripts/inkscape-version.cmake new file mode 100644 index 000000000..7e53f710b --- /dev/null +++ b/CMakeScripts/inkscape-version.cmake @@ -0,0 +1,30 @@ +# This is called by cmake as an extermal process from +# ./src/CMakeLists.txt and creates inkscape-version.cpp +# +# These variables are defined by the caller, matching the CMake equivilents. +# - ${INKSCAPE_SOURCE_DIR} +# - ${INKSCAPE_BINARY_DIR} + +# We should extract the version from build.xml +# but for now just hard code +set(INKSCAPE_VERSION "0.48+devel") +set(INKSCAPE_REVISION "unknown") + +if(EXISTS ${INKSCAPE_SOURCE_DIR}/.bzr/) + execute_process(COMMAND + bzr revno ${INKSCAPE_SOURCE_DIR} + OUTPUT_VARIABLE INKSCAPE_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + +file(WRITE + ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp.txt + "namespace Inkscape {\n" + " char const *version_string = \"${INKSCAPE_VERSION} ${INKSCAPE_REVISION}\";\n" + "}\n") + +# Copy the file to the final header only if the version changes +# and avoid needless rebuilds +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp.txt + ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp) -- cgit v1.2.3