From fdc93e68da219fa48acfa5ac11ba2e90a30a753b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 25 Dec 2016 23:17:54 +0100 Subject: [PATCH] =?UTF-8?q?build:=20use=20git-describe=20with=20just=20.gi?= =?UTF-8?q?t=20/=20add=20'Using=20version=20from=20=E2=80=A6'=20msg=20(#13?= =?UTF-8?q?02)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With Git submodules there is only a `.git` file typically, e.g.: > gitdir: /home/user/Vcs/awesome-www/.git/modules/src --- awesomeConfig.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index ba151ef7e..77705a3b1 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -87,7 +87,8 @@ endif() # {{{ Version stamp if(OVERRIDE_VERSION) set(VERSION ${OVERRIDE_VERSION}) -elseif(EXISTS ${SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE) + message(STATUS "Using version from OVERRIDE_VERSION: ${VERSION}") +elseif(EXISTS ${SOURCE_DIR}/.git AND GIT_EXECUTABLE) # get current version execute_process( COMMAND ${GIT_EXECUTABLE} describe --dirty @@ -99,9 +100,11 @@ elseif(EXISTS ${SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE) file(WRITE ${VERSION_STAMP_FILE} ${VERSION}) # create a version_stamp target later set(BUILD_FROM_GIT TRUE) + message(STATUS "Using version from git: ${VERSION}") elseif( EXISTS ${SOURCE_DIR}/.version_stamp ) # get version from version stamp file(READ ${SOURCE_DIR}/.version_stamp VERSION) + message(STATUS "Using version from ${SOURCE_DIR}/.version_stamp: ${VERSION}") endif() # }}}