aboutsummaryrefslogtreecommitdiff
path: root/cmake/Version.cmake
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2018-03-21 16:26:54 +0000
committerHoward Chu <hyc@symas.com>2018-03-21 16:33:52 +0000
commit522be96fe4b2742e349e73b6953ed888b1f4b2ce (patch)
treecd28aa6cc045a054f4972ca8e7ef1883c4548f2a /cmake/Version.cmake
parentMerge pull request #3429 (diff)
downloadmonero-522be96fe4b2742e349e73b6953ed888b1f4b2ce.tar.xz
Fix generating version.cpp
Also removes BYPRODUCT dependency on CMake 3.2
Diffstat (limited to 'cmake/Version.cmake')
-rw-r--r--cmake/Version.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmake/Version.cmake b/cmake/Version.cmake
index 63b2a6790..439c4c5ae 100644
--- a/cmake/Version.cmake
+++ b/cmake/Version.cmake
@@ -37,14 +37,16 @@ if ("$Format:$" STREQUAL "")
write_static_version_header("release")
elseif (GIT_FOUND OR Git_FOUND)
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
- add_custom_target(genversion ALL
+ add_custom_command(
+ OUTPUT "${CMAKE_BINARY_DIR}/version.cpp"
COMMAND "${CMAKE_COMMAND}"
"-D" "GIT=${GIT_EXECUTABLE}"
"-D" "TO=${CMAKE_BINARY_DIR}/version.cpp"
"-P" "cmake/GenVersion.cmake"
- BYPRODUCTS "${CMAKE_BINARY_DIR}/version.cpp"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
else()
message(STATUS "WARNING: Git was not found!")
write_static_version_header("unknown")
endif ()
+add_custom_target(genversion ALL
+ DEPENDS "${CMAKE_BINARY_DIR}/version.cpp")