<commit_before>cmake_minimum_required( VERSION 2.6 )

# This project is intended to be built outside the Insight source tree
project( ITKTools )
#enable_testing()

#---------------------------------------------------------------------
# Find ITK.
FIND_PACKAGE( ITK 4 REQUIRED )

# ITKTools depends on some ITK modules. Check for them:
# NOTE: not sure if this is the best way to check for this,
# but for now it works.
set( listofrequiredcomponents ITKCommon ITKIOPhilipsREC )
foreach( item ${listofrequiredcomponents} )
  # Find the item in the list of enabled modules
  list( FIND ITK_MODULES_ENABLED ${item} found )

  # Notify the user and fail gracefully.
  if( found EQUAL -1 )
    message( SEND_ERROR "The module "${item}" has not been set to ON when compiling ITK. This option is mandatory for ITKTools to build.\nPlease recompile your ITK installation." )
  else()
    message( STATUS "Found required ITK module "${item} )
  endif()
endforeach()
message( STATUS "Found all ITK modules required to build ITKTools!" )

#---------------------------------------------------------------------
# Kill the anoying MS VS warning about non-safe functions.
# They hide real warnings.
if( MSVC )
  add_definitions(
    /D_SCL_SECURE_NO_DEPRECATE
    /D_CRT_SECURE_NO_DEPRECATE
    /D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
    )
endif( MSVC )

#---------------------------------------------------------------------
# Output directories.
set( LIBRARY_OUTPUT_PATH ${ITKTools_BINARY_DIR}/bin
  CACHE INTERNAL "Single output directory for building all libraries." )
set( EXECUTABLE_OUTPUT_PATH ${ITKTools_BINARY_DIR}/bin
  CACHE INTERNAL "Single output directory for building all executables." )
mark_as_advanced( LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH )
set( ITKTools_LIBRARY_PATH    "${LIBRARY_OUTPUT_PATH}" )
set( ITKTools_EXECUTABLE_PATH "${EXECUTABLE_OUTPUT_PATH}" )
include_directories( ${ITKTools_SOURCE_DIR}/common )

#---------------------------------------------------------------------
# Compilation options
set( ITKTOOLS_3D_SUPPORT OFF CACHE BOOL
  "Support operations on 3D Images." )
if(ITKTOOLS_3D_SUPPORT)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DITKTOOLS_3D_SUPPORT")
endif()

set( ITKTOOLS_4D_SUPPORT OFF CACHE BOOL
  "Support operations on 4D Images." )
if(ITKTOOLS_4D_SUPPORT)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DITKTOOLS_4D_SUPPORT")
endif()

#---------------------------------------------------------------------
# Define where to install ITKTools
if( WIN32 )
  set( ITKTools_INSTALL_DIR ${CMAKE_INSTALL_PREFIX} )
else()
  set( ITKTools_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin )
endif()

#---------------------------------------------------------------------
# Testing
set( ITKTOOLS_BUILD_TESTING OFF CACHE BOOL
  "Perform some tests on basic functionality of ITKTools." )
if( ITKTOOLS_BUILD_TESTING )
 enable_testing()
 add_subdirectory( ${ITKTools_SOURCE_DIR}/../Testing ${ITKTools_BINARY_DIR}/Testing )
 include( CTest )
endif()<commit_msg>ENH: set 3D compilation to ON by default<commit_after>cmake_minimum_required( VERSION 2.6 )

# This project is intended to be built outside the Insight source tree
project( ITKTools )

#---------------------------------------------------------------------
# Find ITK.
FIND_PACKAGE( ITK 4 REQUIRED )

# ITKTools depends on some ITK modules. Check for them:
# NOTE: not sure if this is the best way to check for this,
# but for now it works.
set( listofrequiredcomponents ITKCommon ITKIOPhilipsREC )
foreach( item ${listofrequiredcomponents} )
  # Find the item in the list of enabled modules
  list( FIND ITK_MODULES_ENABLED ${item} found )

  # Notify the user and fail gracefully.
  if( found EQUAL -1 )
    message( SEND_ERROR "The module "${item}" has not been set to ON when compiling ITK. This option is mandatory for ITKTools to build.\nPlease recompile your ITK installation." )
  else()
    message( STATUS "Found required ITK module "${item} )
  endif()
endforeach()
message( STATUS "Found all ITK modules required to build ITKTools!" )

#---------------------------------------------------------------------
# Kill the anoying MS VS warning about non-safe functions.
# They hide real warnings.
if( MSVC )
  add_definitions(
    /D_SCL_SECURE_NO_DEPRECATE
    /D_CRT_SECURE_NO_DEPRECATE
    /D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
    )
endif( MSVC )

#---------------------------------------------------------------------
# Output directories.
set( LIBRARY_OUTPUT_PATH ${ITKTools_BINARY_DIR}/bin
  CACHE INTERNAL "Single output directory for building all libraries." )
set( EXECUTABLE_OUTPUT_PATH ${ITKTools_BINARY_DIR}/bin
  CACHE INTERNAL "Single output directory for building all executables." )
mark_as_advanced( LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH )
set( ITKTools_LIBRARY_PATH    "${LIBRARY_OUTPUT_PATH}" )
set( ITKTools_EXECUTABLE_PATH "${EXECUTABLE_OUTPUT_PATH}" )
include_directories( ${ITKTools_SOURCE_DIR}/common )

#---------------------------------------------------------------------
# Compilation options
set( ITKTOOLS_3D_SUPPORT ON CACHE BOOL
  "Support operations on 3D Images." )
if( ITKTOOLS_3D_SUPPORT )
  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DITKTOOLS_3D_SUPPORT" )
endif()

set( ITKTOOLS_4D_SUPPORT OFF CACHE BOOL
  "Support operations on 4D Images." )
if( ITKTOOLS_4D_SUPPORT )
  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DITKTOOLS_4D_SUPPORT" )
endif()

#---------------------------------------------------------------------
# Define where to install ITKTools
if( WIN32 )
  set( ITKTools_INSTALL_DIR ${CMAKE_INSTALL_PREFIX} )
else()
  set( ITKTools_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin )
endif()

#---------------------------------------------------------------------
# Testing
set( ITKTOOLS_BUILD_TESTING OFF CACHE BOOL
  "Perform some tests on basic functionality of ITKTools." )
if( ITKTOOLS_BUILD_TESTING )
 enable_testing()
 add_subdirectory( ${ITKTools_SOURCE_DIR}/../Testing ${ITKTools_BINARY_DIR}/Testing )
 include( CTest )
endif()
{'fraction_non_alphanumeric': 0.2110924369747899, 'fraction_numerical': 0.004873949579831933, 'mean_word_length': 2.591430295715148, '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': '7105883', 'n_tokens_mistral': 1856, 'n_tokens_neox': 1760, 'n_words': 521}