<commit_before>include_directories(${DICOM_INCLUDE_DIRS})

set(BASE_LIBS vtkDICOM ${VTK_LIBS})
if(USE_DCMTK AND DCMTK_charls_LIBRARY)
 set(BASE_LIBS ${BASE_LIBS} ${DCMTK_charls_LIBRARY})
endif()

add_executable(TestDICOMDictionary TestDICOMDictionary.cxx)
target_link_libraries(TestDICOMDictionary ${BASE_LIBS})
get_target_property(pth TestDICOMDictionary RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMDictionary ${pth}/TestDICOMDictionary)

add_executable(TestDICOMVM TestDICOMVM.cxx)
target_link_libraries(TestDICOMVM ${BASE_LIBS})
get_target_property(pth TestDICOMVM RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMVM ${pth}/TestDICOMVM)

add_executable(TestDICOMVR TestDICOMVR.cxx)
target_link_libraries(TestDICOMVR ${BASE_LIBS})
get_target_property(pth TestDICOMVR RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMVR ${pth}/TestDICOMVR)

add_executable(TestDICOMValue TestDICOMValue.cxx)
target_link_libraries(TestDICOMValue ${BASE_LIBS})
get_target_property(pth TestDICOMValue RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMValue ${pth}/TestDICOMValue)

add_executable(TestDICOMSequence TestDICOMSequence.cxx)
target_link_libraries(TestDICOMSequence ${BASE_LIBS})
get_target_property(pth TestDICOMSequence RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMSequence ${pth}/TestDICOMSequence)

add_executable(TestDICOMMetaData TestDICOMMetaData.cxx)
target_link_libraries(TestDICOMMetaData ${BASE_LIBS})
get_target_property(pth TestDICOMMetaData RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMMetaData ${pth}/TestDICOMMetaData)

add_executable(TestDICOMCharacterSet TestDICOMCharacterSet.cxx)
target_link_libraries(TestDICOMCharacterSet ${BASE_LIBS})
get_target_property(pth TestDICOMCharacterSet RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMCharacterSet ${pth}/TestDICOMCharacterSet)

add_executable(TestDICOMUtilities TestDICOMUtilities.cxx)
target_link_libraries(TestDICOMUtilities ${BASE_LIBS})
get_target_property(pth TestDICOMUtilities RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMUtilities ${pth}/TestDICOMUtilities)

if(BUILD_PYTHON_WRAPPERS)
  if(NOT "${VTK_PYTHON_EXE}")
    get_target_property(WRAP_PYTHON_PATH vtkWrapPython LOCATION)
    get_filename_component(VTK_EXE_DIR ${WRAP_PYTHON_PATH} PATH)
    find_program(VTK_PYTHON_EXE vtkpython "${VTK_EXE_DIR}")
  endif()
  if(NOT "${VTK_PYTHON_EXE}")
    # fall back to using python rather than vtkpython
    find_package(PythonInterp QUIET)
    mark_as_advanced(PYTHON_EXECUTABLE)
    set(VTK_PYTHON_EXE ${PYTHON_EXECUTABLE})
  endif()
  add_test(TestDICOMPython "${VTK_PYTHON_EXE}"
    "${CMAKE_CURRENT_SOURCE_DIR}/TestDICOMPython.py")
  if(NOT CMAKE_CONFIGURATION_TYPES)
    set_tests_properties(TestDICOMPython PROPERTIES ENVIRONMENT
      "PYTHONPATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
  endif()
endif()

if(BUILD_JAVA_WRAPPERS)
  set(_sep ":")
  if(WIN32)
    set(_sep "\\;")
  endif()
  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/TestDICOMJava.java.in"
    "${CMAKE_CURRENT_BINARY_DIR}/TestDICOMJava.java" @ONLY)
  add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/javac_test_stamp.txt
    COMMAND ${JAVA_COMPILE} ${JAVAC_OPTIONS}
    -source ${VTK_JAVA_SOURCE_VERSION}
    -target ${VTK_JAVA_TARGET_VERSION}
    -classpath "${VTK_JAR_PATH}/vtkdicom.jar${_sep}${DICOM_BINARY_DIR}/java${_sep}${VTK_JAVA_JAR}"
    -sourcepath ${CMAKE_CURRENT_SOURCE_DIR}<commit_msg>Fix conditions for VTK_PYTHON_EXE.<commit_after>include_directories(${DICOM_INCLUDE_DIRS})

set(BASE_LIBS vtkDICOM ${VTK_LIBS})
if(USE_DCMTK AND DCMTK_charls_LIBRARY)
 set(BASE_LIBS ${BASE_LIBS} ${DCMTK_charls_LIBRARY})
endif()

add_executable(TestDICOMDictionary TestDICOMDictionary.cxx)
target_link_libraries(TestDICOMDictionary ${BASE_LIBS})
get_target_property(pth TestDICOMDictionary RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMDictionary ${pth}/TestDICOMDictionary)

add_executable(TestDICOMVM TestDICOMVM.cxx)
target_link_libraries(TestDICOMVM ${BASE_LIBS})
get_target_property(pth TestDICOMVM RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMVM ${pth}/TestDICOMVM)

add_executable(TestDICOMVR TestDICOMVR.cxx)
target_link_libraries(TestDICOMVR ${BASE_LIBS})
get_target_property(pth TestDICOMVR RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMVR ${pth}/TestDICOMVR)

add_executable(TestDICOMValue TestDICOMValue.cxx)
target_link_libraries(TestDICOMValue ${BASE_LIBS})
get_target_property(pth TestDICOMValue RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMValue ${pth}/TestDICOMValue)

add_executable(TestDICOMSequence TestDICOMSequence.cxx)
target_link_libraries(TestDICOMSequence ${BASE_LIBS})
get_target_property(pth TestDICOMSequence RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMSequence ${pth}/TestDICOMSequence)

add_executable(TestDICOMMetaData TestDICOMMetaData.cxx)
target_link_libraries(TestDICOMMetaData ${BASE_LIBS})
get_target_property(pth TestDICOMMetaData RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMMetaData ${pth}/TestDICOMMetaData)

add_executable(TestDICOMCharacterSet TestDICOMCharacterSet.cxx)
target_link_libraries(TestDICOMCharacterSet ${BASE_LIBS})
get_target_property(pth TestDICOMCharacterSet RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMCharacterSet ${pth}/TestDICOMCharacterSet)

add_executable(TestDICOMUtilities TestDICOMUtilities.cxx)
target_link_libraries(TestDICOMUtilities ${BASE_LIBS})
get_target_property(pth TestDICOMUtilities RUNTIME_OUTPUT_DIRECTORY)
add_test(TestDICOMUtilities ${pth}/TestDICOMUtilities)

if(BUILD_PYTHON_WRAPPERS)
  if(NOT VTK_PYTHON_EXE)
    get_target_property(WRAP_PYTHON_PATH vtkWrapPython LOCATION)
    get_filename_component(VTK_EXE_DIR ${WRAP_PYTHON_PATH} PATH)
    find_program(VTK_PYTHON_EXE vtkpython "${VTK_EXE_DIR}")
  endif()
  if(NOT VTK_PYTHON_EXE)
    # fall back to using python rather than vtkpython
    find_package(PythonInterp QUIET)
    mark_as_advanced(PYTHON_EXECUTABLE)
    set(VTK_PYTHON_EXE ${PYTHON_EXECUTABLE})
  endif()
  add_test(TestDICOMPython "${VTK_PYTHON_EXE}"
    "${CMAKE_CURRENT_SOURCE_DIR}/TestDICOMPython.py")
  if(NOT CMAKE_CONFIGURATION_TYPES)
    set_tests_properties(TestDICOMPython PROPERTIES ENVIRONMENT
      "PYTHONPATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
  endif()
endif()

if(BUILD_JAVA_WRAPPERS)
  set(_sep ":")
  if(WIN32)
    set(_sep "\\;")
  endif()
  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/TestDICOMJava.java.in"
    "${CMAKE_CURRENT_BINARY_DIR}/TestDICOMJava.java" @ONLY)
  add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/javac_test_stamp.txt
    COMMAND ${JAVA_COMPILE} ${JAVAC_OPTIONS}
    -source ${VTK_JAVA_SOURCE_VERSION}
    -target ${VTK_JAVA_TARGET_VERSION}
    -classpath "${VTK_JAR_PATH}/vtkdicom.jar${_sep}${DICOM_BINARY_DIR}/java${_sep}${VTK_JAVA_JAR}"
    -sourcepath ${CMAKE_CURRENT_SOURCE_DIR}
{'fraction_non_alphanumeric': 0.09066305818673884, 'fraction_numerical': 0.0006014133213050669, 'mean_word_length': 10.332197614991482, 'pattern_counts': {'":': 2, '<': 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': '1421178', 'n_tokens_mistral': 2698, 'n_tokens_neox': 2614, 'n_words': 292}