Skip to content

Commit

Permalink
To get git version only if in git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewOConnell committed Mar 31, 2022
1 parent 3636b3f commit ebf601c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(refine)

find_program(GIT_EXEC git)
if (GIT_EXEC)
if (GIT_EXEC AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
execute_process(COMMAND sh -c "${GIT_EXEC} describe --tag | tr -d '\n'"
OUTPUT_VARIABLE REFINE_VERSION)
message(STATUS "refine version: ${REFINE_VERSION}")
Expand Down

0 comments on commit ebf601c

Please sign in to comment.