Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Update extension buildsystem to handle source dir without vcs #717

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CMake/SlicerMacroExtractRepositoryInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
# <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
# <var-prefix>_WC_INFO
#
# If source directory is not a SVN, GIT or CVS, the macro will return early
# displaying an warning message:
#
# -- Skipping repository info extraction: directory [/path/to/src] is not a GIT, SVN or CVS checkout

macro(SlicerMacroExtractRepositoryInfo)
include(CMakeParseArguments)
Expand Down Expand Up @@ -84,6 +88,13 @@ macro(SlicerMacroExtractRepositoryInfo)
set(${wc_info_prefix}_WC_REVISION_NAME "NA")
set(${wc_info_prefix}_WC_REVISION_HASH "NA")

if(NOT EXISTS ${MY_SOURCE_DIR}/.git
AND NOT EXISTS ${MY_SOURCE_DIR}/.svn
AND NOT EXISTS ${MY_SOURCE_DIR}/CVS)
message(AUTHOR_WARNING "Skipping repository info extraction: directory [${MY_SOURCE_DIR}] is not a GIT, SVN or CVS checkout")
return()
endif()

find_package(Git REQUIRED)

# Is <SOURCE_DIR> a git working copy ?
Expand Down
4 changes: 3 additions & 1 deletion Extensions/CMake/SlicerBlockUploadExtension.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ set(expected_existing_vars
Slicer_CMAKE_DIR
Slicer_DIR
Slicer_EXTENSIONS_CMAKE_DIR
Subversion_SVN_EXECUTABLE
# Since new extension generated from the SuperBuild template
# do not require SVN, we do not require it.
# Subversion_SVN_EXECUTABLE
)
foreach(var ${expected_existing_vars})
if(NOT EXISTS "${${var}}")
Expand Down