Skip to content

Commit f8a2f02

Browse files
axel-grcSimonRit
authored andcommitted
COMP: Move version hash setup outside ITK_SOURCE_DIR
1 parent ba4ca0b commit f8a2f02

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ endif()
4949

5050
if(NOT ITK_SOURCE_DIR)
5151
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
52-
include(GetGitRevisionDescription)
53-
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
52+
endif()
53+
include(GetGitRevisionDescription)
54+
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
55+
if(GIT_SHA1 MATCHES ".*NOTFOUND")
56+
set(CudaCommon_VERSION_HASH "")
57+
else()
5458
set(CudaCommon_VERSION_HASH ", git hash ${GIT_SHA1}")
5559
endif()
5660

@@ -92,7 +96,6 @@ if(NOT ITK_SOURCE_DIR)
9296
"Modules can only be built against an ITK build tree; they cannot be built against an ITK install tree."
9397
)
9498
endif()
95-
9699
include(ITKModuleExternal)
97100
else()
98101
set(ITK_DIR ${CMAKE_BINARY_DIR})

0 commit comments

Comments
 (0)