File: ITKDownloadSetup.cmake

package info (click to toggle)
insighttoolkit5 5.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 704,404 kB
  • sloc: cpp: 783,697; ansic: 628,724; xml: 44,704; fortran: 34,250; python: 22,874; sh: 4,078; pascal: 2,636; lisp: 2,158; makefile: 461; yacc: 328; asm: 205; perl: 203; lex: 146; tcl: 132; javascript: 98; csh: 81
file content (35 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download | duplicates (2)
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
35
# 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(WARNING "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()