diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-16 15:10:28 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-16 15:33:43 +0000 |
| commit | 4a543072019e0bd4a0fcaaa3c2cef718e045edc6 (patch) | |
| tree | 559fd60d6e356d0dcda2a548e00cee4904f63ed0 /CMakeScripts/inkscape-version.cmake | |
| parent | root dir tidying: cleanup inkscape icons (diff) | |
| download | inkscape-4a543072019e0bd4a0fcaaa3c2cef718e045edc6.tar.gz inkscape-4a543072019e0bd4a0fcaaa3c2cef718e045edc6.zip | |
cmake: fix 'dist' target to actually include INKSCAPE_REVISION
(re-use inkscape-version.cpp in order not to duplicate code)
Diffstat (limited to 'CMakeScripts/inkscape-version.cmake')
| -rw-r--r-- | CMakeScripts/inkscape-version.cmake | 16 |
1 files changed, 8 insertions, 8 deletions
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() |
