<commit_before>##############################################################################
#
# Library:   TubeTK
#
# Copyright Kitware Inc.
#
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
cmake_minimum_required(VERSION 3.10.2)

cmake_policy( SET CMP0070 NEW )
cmake_policy( SET CMP0071 NEW )

####
####
####
####
project( TubeTK )

####
# Setup CMake
####
list( APPEND CMAKE_MODULE_PATH ${TubeTK_SOURCE_DIR}/CMake )

####
# Setup External Data Cache
####
include( TubeTKExternalData )
if( DEFINED "ENV{ExternalData_OBJECT_STORES}" )
  set( ExternalData_OBJECT_STORES $ENV{ExternalData_OBJECT_STORES} )
endif()


####
# Default output directories
####
make_directory( "${TubeTK_BINARY_DIR}/bin" )
make_directory( "${TubeTK_BINARY_DIR}/lib" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${TubeTK_BINARY_DIR}/bin" )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${TubeTK_BINARY_DIR}/lib" )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${TubeTK_BINARY_DIR}/lib" )

mark_as_advanced( BUILD_SHARED_LIBS )
mark_as_advanced( CMAKE_INSTALL_PREFIX )

####
# Setup testing
####
if( NOT BUILD_TESTING )
  option( BUILD_TESTING "Build TubeTK's tests" on )
  mark_as_advanced( BUILD_TESTING )
endif()
set( TubeTK_DATA_ROOT ${TubeTK_SOURCE_DIR}/data_keys)

####
# CDash dashboard setup.
####
include( CTest )

make_directory( ${TubeTK_BINARY_DIR}/Temporary )

set( BUILDNAME "${BUILDNAME}" CACHE STRING
  "Name of the build on the CDash dashboard." )
mark_as_advanced( BUILDNAME )

set( BUILD_WARNING_REPORT_LIMIT -1 )
set( BUILD_ERROR_REPORT_LIMIT -1 )

include( CTestConfig.cmake )

configure_file( ${TubeTK_SOURCE_DIR}/CMake/CTestCustom.cmake.in
  ${TubeTK_BINARY_DIR}/CTestCustom.cmake )

include( TubeTKExternalData )
if( DEFINED "ENV{ExternalData_OBJECT_STORES}" )
  set( ExternalData_OBJECT_STORES $ENV{ExternalData_OBJECT_STORES} )
endif()

####
# Find ITK and pre-built modules
####
set( TubeTK_ITK_COMPONENTS
  MinimalPathExtraction
  ITKImageIO
  ITKTransformIO
  ITKIOSpatialObjects
  ITKRegistrationCommon
  ITKBinaryMathematicalMorphology
  ITKFFT
  ITKCommon
  ITKHDF5
  ITKIOCSV
  ITKRegionGrowing
  ITKAnisotropicSmoothing
  ITKLabelVoting
  ITKPDEDeformableRegistration
  ITKIOImageBase
  ITKImageFunction
  ITKImageIntensity
  ITKDistanceMap
  ITKTestKernel
  ITKOptimizers
  ITKSmoothing
  ITKSpatialObjects
  ITKStatistics
  ITKTransform
  )
if( NOT ITK_SOURCE_DIR )
  find_package( ITK COMPONENTS ${TubeTK_ITK_COMPONENTS} REQUIRED )
  mark_as_advanced( CLEAR ITK_DIR )
  if( NOT ITK_FOUND )
    find_package( ITK )
    if( ITK_FOUND )
      message( FATAL_ERROR
        "TubeTK requires ITK with MinimalPathExtraction module enabled.")
    endif()
    set( ITK_DIR "NOT_FOUND" CACHE PATH
	    "Path to ITK installation/build directory." FORCE )
  endif()
  include( ${ITK_USE_FILE} )
endif()

####
# Find Python
####
if( ITK_WRAP_PYTHON )
  find_package( PythonInterp )
  find_package( PythonLibs REQUIRED )
  find_package( NumPy REQUIRED )
  mark_as_advanced( NUMPY_INCLUDE_DIR )
endif()

####
# VTK setup.
####
option( TubeTK_USE_VTK "Use VTK to enable additional functionality." OFF )
if( TubeTK_USE_VTK )
  find_package( VTK REQUIRED )
  mark_as_advanced( CLEAR VTK_DIR )
  include( ${VTK_USE_FILE} )
endif()

####
# ArrayFire setup
####
option( TubeTK_USE_ARRAYFIRE
  "Use the ArrayFire library to speedup filtering opertions using the GPU."
  OFF)
if( TubeTK_USE_ARRAYFIRE )
  find_package( ArrayFire REQUIRED )
  mark_as_advanced( CLEAR ArrayFire_DIR )
  include_directories( ${ArrayFire_INCLUDE_DIRS} )
endif()


####
# LIBSVM setup.
####
option( TubeTK_USE_LIBSVM "Use LIBSVM for additional functionality."
  OFF )
mark_as_advanced( TubeTK_USE_LIBSVM )
if( TubeTK_USE_LIBSVM )
  find_package( LIBSVM REQUIRED )
  mark_as_advanced( CLEAR LIBSVM_DIR )
  include_directories( ${LIBSVM_INCLUDE_DIRS} )
endif()

####
# RandomForest setup.
####
option( TubeTK_USE_RANDOMFOREST
  "Use RandomForest to enable additional functionality." OFF )
mark_as_advanced( TubeTK_USE_RANDOMFOREST )
if( TubeTK_USE_RANDOMFOREST )
  find_package( RandomForest REQUIRED )
  mark_as_advanced( CLEAR RandomForest_DIR )
  include_directories( ${RandomForest_INCLUDE_DIRS} )
endif()

####
# Ask to build apps
####
option( TubeTK_BUILD_APPLICATION 
  "Build the optional apps that come with TubeTK." OFF )<commit_msg>BUG: Typo in cmake variable blocked building apps<commit_after>##############################################################################
#
# Library:   TubeTK
#
# Copyright Kitware Inc.
#
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
cmake_minimum_required(VERSION 3.10.2)

cmake_policy( SET CMP0070 NEW )
cmake_policy( SET CMP0071 NEW )

####
####
####
####
project( TubeTK )

####
# Setup CMake
####
list( APPEND CMAKE_MODULE_PATH ${TubeTK_SOURCE_DIR}/CMake )

####
# Setup External Data Cache
####
include( TubeTKExternalData )
if( DEFINED "ENV{ExternalData_OBJECT_STORES}" )
  set( ExternalData_OBJECT_STORES $ENV{ExternalData_OBJECT_STORES} )
endif()


####
# Default output directories
####
make_directory( "${TubeTK_BINARY_DIR}/bin" )
make_directory( "${TubeTK_BINARY_DIR}/lib" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${TubeTK_BINARY_DIR}/bin" )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${TubeTK_BINARY_DIR}/lib" )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${TubeTK_BINARY_DIR}/lib" )

mark_as_advanced( BUILD_SHARED_LIBS )
mark_as_advanced( CMAKE_INSTALL_PREFIX )

####
# Setup testing
####
if( NOT BUILD_TESTING )
  option( BUILD_TESTING "Build TubeTK's tests" on )
  mark_as_advanced( BUILD_TESTING )
endif()
set( TubeTK_DATA_ROOT ${TubeTK_SOURCE_DIR}/data_keys)

####
# CDash dashboard setup.
####
include( CTest )

make_directory( ${TubeTK_BINARY_DIR}/Temporary )

set( BUILDNAME "${BUILDNAME}" CACHE STRING
  "Name of the build on the CDash dashboard." )
mark_as_advanced( BUILDNAME )

set( BUILD_WARNING_REPORT_LIMIT -1 )
set( BUILD_ERROR_REPORT_LIMIT -1 )

include( CTestConfig.cmake )

configure_file( ${TubeTK_SOURCE_DIR}/CMake/CTestCustom.cmake.in
  ${TubeTK_BINARY_DIR}/CTestCustom.cmake )

include( TubeTKExternalData )
if( DEFINED "ENV{ExternalData_OBJECT_STORES}" )
  set( ExternalData_OBJECT_STORES $ENV{ExternalData_OBJECT_STORES} )
endif()

####
# Find ITK and pre-built modules
####
set( TubeTK_ITK_COMPONENTS
  MinimalPathExtraction
  ITKImageIO
  ITKTransformIO
  ITKIOSpatialObjects
  ITKRegistrationCommon
  ITKBinaryMathematicalMorphology
  ITKFFT
  ITKCommon
  ITKHDF5
  ITKIOCSV
  ITKRegionGrowing
  ITKAnisotropicSmoothing
  ITKLabelVoting
  ITKPDEDeformableRegistration
  ITKIOImageBase
  ITKImageFunction
  ITKImageIntensity
  ITKDistanceMap
  ITKTestKernel
  ITKOptimizers
  ITKSmoothing
  ITKSpatialObjects
  ITKStatistics
  ITKTransform
  )
if( NOT ITK_SOURCE_DIR )
  find_package( ITK COMPONENTS ${TubeTK_ITK_COMPONENTS} REQUIRED )
  mark_as_advanced( CLEAR ITK_DIR )
  if( NOT ITK_FOUND )
    find_package( ITK )
    if( ITK_FOUND )
      message( FATAL_ERROR
        "TubeTK requires ITK with MinimalPathExtraction module enabled.")
    endif()
    set( ITK_DIR "NOT_FOUND" CACHE PATH
	    "Path to ITK installation/build directory." FORCE )
  endif()
  include( ${ITK_USE_FILE} )
endif()

####
# Find Python
####
if( ITK_WRAP_PYTHON )
  find_package( PythonInterp )
  find_package( PythonLibs REQUIRED )
  find_package( NumPy REQUIRED )
  mark_as_advanced( NUMPY_INCLUDE_DIR )
endif()

####
# VTK setup.
####
option( TubeTK_USE_VTK "Use VTK to enable additional functionality." OFF )
if( TubeTK_USE_VTK )
  find_package( VTK REQUIRED )
  mark_as_advanced( CLEAR VTK_DIR )
  include( ${VTK_USE_FILE} )
endif()

####
# ArrayFire setup
####
option( TubeTK_USE_ARRAYFIRE
  "Use the ArrayFire library to speedup filtering opertions using the GPU."
  OFF)
if( TubeTK_USE_ARRAYFIRE )
  find_package( ArrayFire REQUIRED )
  mark_as_advanced( CLEAR ArrayFire_DIR )
  include_directories( ${ArrayFire_INCLUDE_DIRS} )
endif()


####
# LIBSVM setup.
####
option( TubeTK_USE_LIBSVM "Use LIBSVM for additional functionality."
  OFF )
mark_as_advanced( TubeTK_USE_LIBSVM )
if( TubeTK_USE_LIBSVM )
  find_package( LIBSVM REQUIRED )
  mark_as_advanced( CLEAR LIBSVM_DIR )
  include_directories( ${LIBSVM_INCLUDE_DIRS} )
endif()

####
# RandomForest setup.
####
option( TubeTK_USE_RANDOMFOREST
  "Use RandomForest to enable additional functionality." OFF )
mark_as_advanced( TubeTK_USE_RANDOMFOREST )
if( TubeTK_USE_RANDOMFOREST )
  find_package( RandomForest REQUIRED )
  mark_as_advanced( CLEAR RandomForest_DIR )
  include_directories( ${RandomForest_INCLUDE_DIRS} )
endif()

####
# Ask to build apps
####
option( TubeTK_BUILD_APPLICATIONS 
  "Build the optional apps that come with TubeTK." OFF )
{'fraction_non_alphanumeric': 0.12603158430973, 'fraction_numerical': 0.003871625063678044, 'mean_word_length': 5.526595744680851, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4959469', 'n_tokens_mistral': 3598, 'n_tokens_neox': 3395, 'n_words': 801}