Skip to content

Commit

Permalink
Disable git version checking when project is not top level
Browse files Browse the repository at this point in the history
  • Loading branch information
daljit46 committed Jul 2, 2024
1 parent 8266d9f commit 8e79b6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmake/FindVersion.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(GIT_EXECUTABLE)
if(GIT_EXECUTABLE AND PROJECT_IS_TOP_LEVEL)
message(VERBOSE "Git found: ${GIT_EXECUTABLE}")
# Get tag
execute_process(
Expand Down Expand Up @@ -31,7 +31,11 @@ endif()

if(NOT MRTRIX_VERSION)
set(MRTRIX_VERSION ${MRTRIX_BASE_VERSION})
message(STATUS "Failed to determine version from Git, using default base version: ${MRTRIX_BASE_VERSION}")
if(PROJECT_IS_TOP_LEVEL)
message(STATUS "Failed to determine version from Git, using default base version: ${MRTRIX_BASE_VERSION}")
else()
message(VERBOSE "MRtrix3 version is set to version: ${MRTRIX_BASE_VERSION}")
endif()
endif()


Expand Down

0 comments on commit 8e79b6d

Please sign in to comment.