summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-07-14 00:58:49 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-07-14 20:51:21 +0000
commit1473ea1244ab31f308af523de7af43bd6357b221 (patch)
treeb0d2ea37d238789caf8ec3c4f47e6f23203ce954 /src
parentcmake: do not build tests for default target (diff)
downloadinkscape-1473ea1244ab31f308af523de7af43bd6357b221.tar.gz
inkscape-1473ea1244ab31f308af523de7af43bd6357b221.zip
cmake: fix targets to actually depend on inkscape-version.cpp
(targets depended only on inkscape-version.cmake to be run but not on the created file itself resulting in changes only being picked up on the second build)
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index abe6c9758..ed89c73a9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -413,18 +413,14 @@ set(inkscape_SRC
# Generate version file
# -----------------------------------------------------------------------------
-# a custom target that is always built
-add_custom_target(
- inkscape_version ALL
+# a custom command that is always built (as run_always.txt is never actually created)
+add_custom_command(
+ OUTPUT inkscape-version.cpp run_always.txt
COMMAND ${CMAKE_COMMAND}
- -DINKSCAPE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
- -DINKSCAPE_BINARY_DIR=${CMAKE_BINARY_DIR}
- -P ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake)
-
-# buildinfo.h is a generated file
-set_source_files_properties(
- ${CMAKE_BINARY_DIR}/src/inkscape-version.cpp
- PROPERTIES GENERATED TRUE)
+ -DINKSCAPE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
+ -DINKSCAPE_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake
+ COMMENT "Generating inkscape-version.cpp")
list(APPEND inkscape_SRC
${CMAKE_BINARY_DIR}/src/inkscape-version.cpp
@@ -536,8 +532,6 @@ set(INKSCAPE_TARGET_LIBS
# Build everything except main and inkview.c in a shared library.
add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC})
-add_dependencies(inkscape_base inkscape_version)
-
if(WITH_DBUS)
add_dependencies(inkscape_base inkscape_dbus)
endif()