From 4a543072019e0bd4a0fcaaa3c2cef718e045edc6 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 16 Jul 2017 17:10:28 +0200 Subject: cmake: fix 'dist' target to actually include INKSCAPE_REVISION (re-use inkscape-version.cpp in order not to duplicate code) --- CMakeScripts/inkscape-version.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'CMakeScripts') diff --git a/CMakeScripts/inkscape-version.cmake b/CMakeScripts/inkscape-version.cmake index fdfdf35c3..2fae589d1 100644 --- a/CMakeScripts/inkscape-version.cmake +++ b/CMakeScripts/inkscape-version.cmake @@ -1,18 +1,16 @@ # This is called by cmake as an extermal process from # ./src/CMakeLists.txt and creates inkscape-version.cpp # +# It's also included directly in ./CMakeLists.txt to +# determine INKSCAPE_REVISION for the 'dist' target +# # 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_REVISION "unknown") -set(INKSCAPE_CUSTOM "custom") if(EXISTS ${INKSCAPE_SOURCE_DIR}/.git) - execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${INKSCAPE_SOURCE_DIR} OUTPUT_VARIABLE INKSCAPE_REV_HASH @@ -29,9 +27,11 @@ if(EXISTS ${INKSCAPE_SOURCE_DIR}/.git) OUTPUT_VARIABLE INKSCAPE_SOURCE_MODIFIED OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT INKSCAPE_SOURCE_MODIFIED STREQUAL "") - set(INKSCAPE_REVISION "${INKSCAPE_REVISION}, ${INKSCAPE_CUSTOM}") + set(INKSCAPE_REVISION "${INKSCAPE_REVISION}, custom") endif() endif() -message("revision is " ${INKSCAPE_REVISION}) -configure_file(${INKSCAPE_SOURCE_DIR}/src/inkscape-version.cpp.in ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp) +if(NOT "${INKSCAPE_BINARY_DIR}" STREQUAL "") + message("revision is " ${INKSCAPE_REVISION}) + configure_file(${INKSCAPE_SOURCE_DIR}/src/inkscape-version.cpp.in ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp) +endif() -- cgit v1.2.3