<commit_before>project(NIRAL_UTILITIES)

set(NIRAL_UTILITIES_MAJOR_VERSION 2)
set(NIRAL_UTILITIES_MINOR_VERSION 0)
set(NIRAL_UTILITIES_PATCH_VERSION 7)
set(NIRAL_UTILITIES_VERSION
  ${NIRAL_UTILITIES_MAJOR_VERSION}.${NIRAL_UTILITIES_MINOR_VERSION}.${NIRAL_UTILITIES_PATCH_VERSION})

cmake_minimum_required(VERSION 3.5)

#-----------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
  ${CMAKE_CURRENT_SOURCE_DIR}/CMake
  ${CMAKE_CURRENT_BINARY_DIR}/CMake
  ${CMAKE_MODULE_PATH}
  )
include(gitSetup)
include(niral_add_executable)
include(niral_utilitiesExternalProject)

#-----------------------------------------------------------------------------
if(CMAKE_COMPILER_2005)
  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
endif()

#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to 'Debug' as none was specified.")
  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
  mark_as_advanced(CMAKE_BUILD_TYPE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
    "MinSizeRel" "RelWithDebInfo")
endif()

#-----------------------------------------------------------------------------
if(${CMAKE_SOURCE_DIR} STREQUAL ${NIRAL_UTILITIES_SOURCE_DIR})
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${NIRAL_UTILITIES_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${NIRAL_UTILITIES_BINARY_DIR}/lib CACHE PATH "Single output directory for building all shared libraries.")
  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${NIRAL_UTILITIES_BINARY_DIR}/lib CACHE PATH "Single output directory for building all static libraries.")
endif()

# Offer the user the choice of overriding the installation directories
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")

#-----------------------------------------------------------------------------
set(ITK_IO_MODULES_USED
  # IO Components
  ITKCommon
  ITKIOImageBase
  ITKIOGDCM
  ITKIOGIPL
  ITKIOMeta
  ITKIONIFTI
  ITKIONRRD
  ITKIOTIFF
  ITKIOJPEG
  ITKIOBMP
  ITKIOPNG
  ITKIOTransformInsightLegacy
  ITKIOVTK
  ITKIOSpatialObjects
  ITKIOTransformBase
  ITKIOHDF5
  ITKIOTransformMatlab
  ITKIOTransformHDF5
  ITKIOLSM
  ITKIOStimulate
  ITKIOBioRad
  ITKIOMRC
  ITKIOGE
  MGHIO
  )

if(NOT VTK_RENDERING_BACKEND)
  set(VTK_RENDERING_BACKEND OpenGL)
endif()

# Describe property
define_property(GLOBAL PROPERTY niral_utilities_LIBRARIES
    BRIEF_DOCS "Defined libraries"
    FULL_DOCS "Defined libraries")
# Initialize property
set_property(GLOBAL PROPERTY niral_utilities_LIBRARIES "")

include_directories( Common )

option( BUILD_TESTING   "Build the testing tree" ON )
if( BUILD_TESTING )
  include(CTest)
  include(ExternalData)
endif()

find_package(ITK)

if(ITK_VERSION)
  string(REPLACE "." ";" VERSION_LIST ${ITK_VERSION})
  list(GET VERSION_LIST 0 ITK_VERSION_MAJOR)
  list(GET VERSION_LIST 1 ITK_VERSION_MINOR)
  list(GET VERSION_LIST 2 ITK_VERSION_PATCH)

  if(ITK_VERSION_MAJOR GREATER 4 OR ITK_VERSION_MAJOR EQUAL 4 AND ITK_VERSION_MINOR GREATER 12)
    message(STATUS "USING compilation flag -std=c++11")
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FAGS} -std=c++11)
  endif()
endif()
<commit_msg>COMP: Set if empty variables for install<commit_after>project(NIRAL_UTILITIES)

set(NIRAL_UTILITIES_MAJOR_VERSION 2)
set(NIRAL_UTILITIES_MINOR_VERSION 0)
set(NIRAL_UTILITIES_PATCH_VERSION 7)
set(NIRAL_UTILITIES_VERSION
  ${NIRAL_UTILITIES_MAJOR_VERSION}.${NIRAL_UTILITIES_MINOR_VERSION}.${NIRAL_UTILITIES_PATCH_VERSION})

cmake_minimum_required(VERSION 3.5)

#-----------------------------------------------------------------------------
set(CMAKE_MODULE_PATH
  ${CMAKE_CURRENT_SOURCE_DIR}/CMake
  ${CMAKE_CURRENT_BINARY_DIR}/CMake
  ${CMAKE_MODULE_PATH}
  )
include(gitSetup)
include(niral_add_executable)
include(niral_utilitiesExternalProject)

if(NOT COMMAND SETIFEMPTY)
  macro(SETIFEMPTY)
    set(KEY ${ARGV0})
    set(VALUE ${ARGV1})
    if(NOT ${KEY})
      set(${ARGV})
    endif()
  endmacro()
endif()

#-----------------------------------------------------------------------------
if(CMAKE_COMPILER_2005)
  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
endif()

#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to 'Debug' as none was specified.")
  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
  mark_as_advanced(CMAKE_BUILD_TYPE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
    "MinSizeRel" "RelWithDebInfo")
endif()

#-----------------------------------------------------------------------------
if(${CMAKE_SOURCE_DIR} STREQUAL ${NIRAL_UTILITIES_SOURCE_DIR})
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${NIRAL_UTILITIES_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${NIRAL_UTILITIES_BINARY_DIR}/lib CACHE PATH "Single output directory for building all shared libraries.")
  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${NIRAL_UTILITIES_BINARY_DIR}/lib CACHE PATH "Single output directory for building all static libraries.")
endif()

# Offer the user the choice of overriding the installation directories
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")

#-----------------------------------------------------------------------------
set(ITK_IO_MODULES_USED
  # IO Components
  ITKCommon
  ITKIOImageBase
  ITKIOGDCM
  ITKIOGIPL
  ITKIOMeta
  ITKIONIFTI
  ITKIONRRD
  ITKIOTIFF
  ITKIOJPEG
  ITKIOBMP
  ITKIOPNG
  ITKIOTransformInsightLegacy
  ITKIOVTK
  ITKIOSpatialObjects
  ITKIOTransformBase
  ITKIOHDF5
  ITKIOTransformMatlab
  ITKIOTransformHDF5
  ITKIOLSM
  ITKIOStimulate
  ITKIOBioRad
  ITKIOMRC
  ITKIOGE
  MGHIO
  )

if(NOT VTK_RENDERING_BACKEND)
  set(VTK_RENDERING_BACKEND OpenGL)
endif()

# Describe property
define_property(GLOBAL PROPERTY niral_utilities_LIBRARIES
    BRIEF_DOCS "Defined libraries"
    FULL_DOCS "Defined libraries")
# Initialize property
set_property(GLOBAL PROPERTY niral_utilities_LIBRARIES "")

include_directories( Common )

option( BUILD_TESTING   "Build the testing tree" ON )
if( BUILD_TESTING )
  include(CTest)
  include(ExternalData)
endif()

find_package(ITK)

if(ITK_VERSION)
  string(REPLACE "." ";" VERSION_LIST ${ITK_VERSION})
  list(GET VERSION_LIST 0 ITK_VERSION_MAJOR)
  list(GET VERSION_LIST 1 ITK_VERSION_MINOR)
  list(GET VERSION_LIST 2 ITK_VERSION_PATCH)

  if(ITK_VERSION_MAJOR GREATER 4 OR ITK_VERSION_MAJOR EQUAL 4 AND ITK_VERSION_MINOR GREATER 12)
    message(STATUS "USING compilation flag -std=c++11")
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FAGS} -std=c++11)
  endif()
endif()

setifempty(INSTALL_RUNTIME_DESTINATION bin)
setifempty(INSTALL_LIBRARY_DESTINATION lib)
setifempty(INSTALL_ARCHIVE_DESTINATION lib)

{'fraction_non_alphanumeric': 0.18121847109041522, 'fraction_numerical': 0.005950071142154961, 'mean_word_length': 3.236712328767123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3252149', 'n_tokens_mistral': 2709, 'n_tokens_neox': 2560, 'n_words': 524}