From de52ae6c703dc6453a6548d3cdcc8c2e54f2f6a2 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 14 Oct 2016 09:43:38 -0400 Subject: [PATCH] Allow the contents of KiCadVersion.cmake to override git version. When the version string in KiCadVersion.cmake is set to something other than the default "no-vcs-found", it ignores the git version even if a .git folder exists in the source folder. --- CMakeModules/WriteVersionHeader.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeModules/WriteVersionHeader.cmake b/CMakeModules/WriteVersionHeader.cmake index 7f55871037..2a09a6b32d 100644 --- a/CMakeModules/WriteVersionHeader.cmake +++ b/CMakeModules/WriteVersionHeader.cmake @@ -29,8 +29,10 @@ # "no-vcs-found". include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake ) -# Attempt to detect if we have a git repo and set the version string. -if( EXISTS "${SRC_PATH}/.git" ) +# Attempt to detect if we have a git repo and set the version string if +# the version wasn't set to something other than the default value in +# KiCadVersion.cmake. +if( _wvh_version_str STREQUAL "no-vcs-found" AND EXISTS "${SRC_PATH}/.git" ) message( STATUS "Using Git to determine build version string." ) include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake ) create_git_version_header( ${SRC_PATH} )