File: ITKDownloadSetup.cmake

package info (click to toggle)
insighttoolkit4 4.13.3withdata-dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 489,260 kB
  • sloc: cpp: 557,342; ansic: 146,850; fortran: 34,788; python: 16,572; sh: 2,187; lisp: 2,070; tcl: 993; java: 362; perl: 200; makefile: 129; csh: 81; pascal: 69; xml: 19; ruby: 10
file content (34 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This script provides download related helper macro and sets up download
# environment.

#-----------------------------------------------------------------------------
# Forbid downloading resources from the network during a build. This helps
# when building on systems without network connectivity to determine which
# resources must be obtained manually and made available to the build.
#
option(ITK_FORBID_DOWNLOADS "Do not download source code or data from the network" OFF)
mark_as_advanced(ITK_FORBID_DOWNLOADS)

macro(itk_download_attempt_check _name)
  if(ITK_FORBID_DOWNLOADS)
    message(SEND_ERROR "Attempted to download ${_name} when ITK_FORBID_DOWNLOADS is ON")
  endif()
endmacro()

#-----------------------------------------------------------------------------
# Git protocol setup
#
if(NOT ITK_FORBID_DOWNLOADS)
  find_package(Git)
  set(ITK_USE_GIT_PROTOCOL_default "OFF")
  if (GIT_VERSION_STRING VERSION_LESS "1.7.10")
    # minimum version for https support
    set(ITK_USE_GIT_PROTOCOL_default "ON")
  endif()
  option(ITK_USE_GIT_PROTOCOL "If behind a firewall turn this off to use https instead." ${ITK_USE_GIT_PROTOCOL_default})
  mark_as_advanced(ITK_USE_GIT_PROTOCOL)
  set(git_protocol "https")
  if(ITK_USE_GIT_PROTOCOL)
    set(git_protocol "git")
  endif()
endif()