From e9da57769285e9a8a73ae3509cb85fcbe5ff1b29 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sat, 15 Jun 2019 00:15:54 +0100 Subject: Use gentoo versioning --- cmake/Version.cmake | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index 707d72639..e6386339d 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -31,20 +31,8 @@ function (write_version tag) configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp") endfunction () -find_package(Git QUIET) -if ("$Format:$" STREQUAL "") - # We're in a tarball; use hard-coded variables. - set(VERSION_IS_RELEASE "true") - write_version("release") -elseif (GIT_FOUND OR Git_FOUND) - message(STATUS "Found Git: ${GIT_EXECUTABLE}") - include(GitVersion) - get_version_tag_from_git("${GIT_EXECUTABLE}") - write_version("${VERSIONTAG}") -else() - message(STATUS "WARNING: Git was not found!") - set(VERSION_IS_RELEASE "false") - write_version("unknown") -endif () +set(VERSION_IS_RELEASE "true") +write_version("release") + add_custom_target(genversion ALL DEPENDS "${CMAKE_BINARY_DIR}/version.cpp") -- cgit v1.2.3