<commit_before>#-----------------------------------------------------------------------------
# CTest Related Settings
#-----------------------------------------------------------------------------
set(BUILDNAME "NoBuldNameGiven")
set(SITE      "NoSiteGiven")
set(BUILD_TESTING_DEFAULT ON)
if(CMAKE_VERSION VERSION_LESS 2.8.11)
  set(BUILD_TESTING_DEFAULT OFF)
endif()
option( BUILD_TESTING "Turn on Testing for SimpleITK" ${BUILD_TESTING_DEFAULT} )

# 2.8.11 required for ExternalData.cmake.
if( BUILD_TESTING AND CMAKE_VERSION VERSION_LESS 2.8.11 )
  message( FATAL_ERROR "BUILD_TESTING ON requires CMake 2.8.11 or newer." )
endif()

if(CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_VERSION VERSION_LESS 3.2 )
  message( FATAL_ERROR "Using \"Ninja\" generator requires CMake 3.2.0 or newer." )
endif()

configure_file(../CMake/CTestCustom.cmake.in CTestCustom.cmake)


enable_language(C)
enable_language(CXX)

#-----------------------------------------------------------------------------
# Platform check
#-----------------------------------------------------------------------------
set(PLATFORM_CHECK true)
if(PLATFORM_CHECK)
  # See CMake/Modules/Platform/Darwin.cmake)
  #   6.x == Mac OSX 10.2 (Jaguar)
  #   7.x == Mac OSX 10.3 (Panther)
  #   8.x == Mac OSX 10.4 (Tiger)
  #   9.x == Mac OSX 10.5 (Leopard)
  #  10.x == Mac OSX 10.6 (Snow Leopard)
  if (DARWIN_MAJOR_VERSION LESS "9")
    message(FATAL_ERROR "Only Mac OSX >= 10.5 are supported !")
  endif()
endif()

#-----------------------------------------------------------------------------
# Update CMake module path
#------------------------------------------------------------------------------

set(CMAKE_MODULE_PATH
  ${CMAKE_SOURCE_DIR}/CMake
  ${CMAKE_SOURCE_DIR}/SuperBuild
  ${CMAKE_BINARY_DIR}/CMake
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/../CMake #  CMake directory
  ${CMAKE_CURRENT_SOURCE_DIR}/../Wrapping
  ${CMAKE_MODULE_PATH}
  )

include(sitkPreventInSourceBuilds)
include(sitkPreventInBuildInstalls)
include(VariableList)
include(sitkExternalData)
include( sitkSITKLegacyNaming )



add_custom_target( SuperBuildSimpleITKSource )

#
# sitkSourceDownload( <output variable> <filename> <md5 hash> )
#
# A function to get a filename for an ExternalData source file used in
# a superbuild. Adds a target which downloads all source code
# needed for superbuild projects. The source file is cached with in
# the build tree, and can be locally cache with other ExternalData
# controlled environment variables.
#
# The "SuperBuildSimpleITKSource" target needs to be manually added as
# a dependencies to the ExternalProject.
#
#   add_dependencies( PROJ "SuperBuildSimpleITKSource" )
#
# Note: Hash files are created under the SOURCE directory in the
# .ExternalSource sub-directory during configuration.
#
function(sitkSourceDownload outVar filename hash)
  set(link_file "${CMAKE_CURRENT_SOURCE_DIR}/.ExternalSource/${filename}")
  file(WRITE  "${link_file}.md5" ${hash} )
  ExternalData_Expand_arguments(
    SuperBuildSimpleITKSourceReal
    link
    DATA{${link_file}}
    )
  set(${outVar} "${link}" PARENT_SCOPE)
endfunction()

function(sitkSourceDownloadDependency proj)
  if (CMAKE_VERSION VERSION_LESS 3.2)
    add_dependencies(${proj}  "SuperBuildSimpleITKSource")
  else()
    ExternalProject_Add_StepDependencies(${proj} download "SuperBuildSimpleITKSource")
  endif()
endfunction()

#-----------------------------------------------------------------------------
# Prerequisites
#------------------------------------------------------------------------------
#

# Compute -G arg for configuring external projects with the same CMake generator:
if(CMAKE_EXTRA_GENERATOR)
  set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
  set(gen "${CMAKE_GENERATOR}")
endif()

#-----------------------------------------------------------------------------
# Use GIT protocol
#------------------------------------------------------------------------------
find_package(Git)
set(SimpleITK_GIT_PROTOCOL_default "https")
if (GIT_VERSION_STRING VERSION_LESS "1.7.10")
  # minimum version for https support
  set(SimpleITK_GIT_PROTOCOL_default "git")
endif()
set(SimpleITK_GIT_PROTOCOL  ${SimpleITK_GIT_PROTOCOL_default} CACHE STRING "If behind a firewall turn set this to 'https' or 'http'." )<commit_msg>Rename git default variable to exclude from Superbuild propagation<commit_after>#-----------------------------------------------------------------------------
# CTest Related Settings
#-----------------------------------------------------------------------------
set(BUILDNAME "NoBuldNameGiven")
set(SITE      "NoSiteGiven")
set(BUILD_TESTING_DEFAULT ON)
if(CMAKE_VERSION VERSION_LESS 2.8.11)
  set(BUILD_TESTING_DEFAULT OFF)
endif()
option( BUILD_TESTING "Turn on Testing for SimpleITK" ${BUILD_TESTING_DEFAULT} )

# 2.8.11 required for ExternalData.cmake.
if( BUILD_TESTING AND CMAKE_VERSION VERSION_LESS 2.8.11 )
  message( FATAL_ERROR "BUILD_TESTING ON requires CMake 2.8.11 or newer." )
endif()

if(CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_VERSION VERSION_LESS 3.2 )
  message( FATAL_ERROR "Using \"Ninja\" generator requires CMake 3.2.0 or newer." )
endif()

configure_file(../CMake/CTestCustom.cmake.in CTestCustom.cmake)


enable_language(C)
enable_language(CXX)

#-----------------------------------------------------------------------------
# Platform check
#-----------------------------------------------------------------------------
set(PLATFORM_CHECK true)
if(PLATFORM_CHECK)
  # See CMake/Modules/Platform/Darwin.cmake)
  #   6.x == Mac OSX 10.2 (Jaguar)
  #   7.x == Mac OSX 10.3 (Panther)
  #   8.x == Mac OSX 10.4 (Tiger)
  #   9.x == Mac OSX 10.5 (Leopard)
  #  10.x == Mac OSX 10.6 (Snow Leopard)
  if (DARWIN_MAJOR_VERSION LESS "9")
    message(FATAL_ERROR "Only Mac OSX >= 10.5 are supported !")
  endif()
endif()

#-----------------------------------------------------------------------------
# Update CMake module path
#------------------------------------------------------------------------------

set(CMAKE_MODULE_PATH
  ${CMAKE_SOURCE_DIR}/CMake
  ${CMAKE_SOURCE_DIR}/SuperBuild
  ${CMAKE_BINARY_DIR}/CMake
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/../CMake #  CMake directory
  ${CMAKE_CURRENT_SOURCE_DIR}/../Wrapping
  ${CMAKE_MODULE_PATH}
  )

include(sitkPreventInSourceBuilds)
include(sitkPreventInBuildInstalls)
include(VariableList)
include(sitkExternalData)
include( sitkSITKLegacyNaming )



add_custom_target( SuperBuildSimpleITKSource )

#
# sitkSourceDownload( <output variable> <filename> <md5 hash> )
#
# A function to get a filename for an ExternalData source file used in
# a superbuild. Adds a target which downloads all source code
# needed for superbuild projects. The source file is cached with in
# the build tree, and can be locally cache with other ExternalData
# controlled environment variables.
#
# The "SuperBuildSimpleITKSource" target needs to be manually added as
# a dependencies to the ExternalProject.
#
#   add_dependencies( PROJ "SuperBuildSimpleITKSource" )
#
# Note: Hash files are created under the SOURCE directory in the
# .ExternalSource sub-directory during configuration.
#
function(sitkSourceDownload outVar filename hash)
  set(link_file "${CMAKE_CURRENT_SOURCE_DIR}/.ExternalSource/${filename}")
  file(WRITE  "${link_file}.md5" ${hash} )
  ExternalData_Expand_arguments(
    SuperBuildSimpleITKSourceReal
    link
    DATA{${link_file}}
    )
  set(${outVar} "${link}" PARENT_SCOPE)
endfunction()

function(sitkSourceDownloadDependency proj)
  if (CMAKE_VERSION VERSION_LESS 3.2)
    add_dependencies(${proj}  "SuperBuildSimpleITKSource")
  else()
    ExternalProject_Add_StepDependencies(${proj} download "SuperBuildSimpleITKSource")
  endif()
endfunction()

#-----------------------------------------------------------------------------
# Prerequisites
#------------------------------------------------------------------------------
#

# Compute -G arg for configuring external projects with the same CMake generator:
if(CMAKE_EXTRA_GENERATOR)
  set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
  set(gen "${CMAKE_GENERATOR}")
endif()

#-----------------------------------------------------------------------------
# Use GIT protocol
#------------------------------------------------------------------------------
find_package(Git)
set(_SimpleITK_GIT_PROTOCOL_default "https")
if (GIT_VERSION_STRING VERSION_LESS "1.7.10")
  # minimum version for https support
  set(SimpleITK_GIT_PROTOCOL_default "git")
endif()
set(SimpleITK_GIT_PROTOCOL  ${_SimpleITK_GIT_PROTOCOL_default} CACHE STRING "If behind a firewall turn set this to 'https' or 'http'." )
{'fraction_non_alphanumeric': 0.2635283258336218, 'fraction_numerical': 0.012461059190031152, 'mean_word_length': 2.242798353909465, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6171294', 'n_tokens_mistral': 2653, 'n_tokens_neox': 2517, 'n_words': 618}