<commit_before>function(DCMTK_project)

    if (DEFINED DCMTK_DIR AND NOT EXISTS ${DCMTK_DIR})
        message(FATAL_ERROR "DCMTK_DIR variable is defined but corresponds to non-existing directory")
    endif()

    ParseProjectArguments(dcmtk dcmtkp "" "" ${ARGN})

    set(extproj_revision_tag GIT_TAG "${dcmtkp_REVISION}")
    if ("${dcmtkp_REVISION}" STREQUAL "") 
        #set(extproj_revision_tag GIT_TAG "ae3b946f6e6231")
    endif()

    set(ep_project_include_arg)
    if (CTEST_USE_LAUNCHERS)
        set(ep_project_include_arg
            "-DCMAKE_PROJECT_DCMTK_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake")
    endif()

    if (NOT DEFINED location)
        set(SRC_DIR ${CMAKE_BINARY_DIR}/dcmtk/src/DCMTK)
        if (NOT dcmtkp_UPSTREAM)
            set(location GIT_REPOSITORY "git://github.com/medInria/dcmtk.git" ${extproj_revision_tag})
        else()
            set(location GIT_REPOSITORY "git://git.dcmtk.org/dcmtk.git" ${extproj_revision_tag})
        endif()
    endif()

    ExternalProject_Add(DCMTK
        PREFIX dcmtk
        ${location}
        CMAKE_GENERATOR ${gen}
        UPDATE_COMMAND ""
        INSTALL_DIR dcmtk/install
        CMAKE_ARGS
            -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
        CMAKE_CACHE_ARGS
            ${ep_common_cache_args}
            ${ep_project_include_arg}
            -DBUILD_SHARED_LIBS:BOOL=ON
            -DDCMTK_WITH_DOXYGEN:BOOL=OFF
            -DDCMTK_WITH_ZLIB:BOOL=OFF # see github issue #25
            -DDCMTK_WITH_OPENSSL:BOOL=OFF # see github issue #25
            -DDCMTK_WITH_PNG:BOOL=OFF # see github issue #25
            -DDCMTK_WITH_TIFF:BOOL=OFF  # see github issue #25
            -DDCMTK_WITH_XML:BOOL=OFF  # see github issue #25
            -DDCMTK_WITH_ICONV:BOOL=OFF  # see github issue #178
            -DDCMTK_FORCE_FPIC_ON_UNIX:BOOL=ON
            -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS:BOOL=OFF
        )
        
    set(DCMTK_DIR ${CMAKE_BINARY_DIR}/dcmtk/install PARENT_SCOPE)

endfunction()<commit_msg>Force DCMTK to build as static libs on Windows<commit_after>function(DCMTK_project)

    if (DEFINED DCMTK_DIR AND NOT EXISTS ${DCMTK_DIR})
        message(FATAL_ERROR "DCMTK_DIR variable is defined but corresponds to non-existing directory")
    endif()

    ParseProjectArguments(dcmtk dcmtkp "" "" ${ARGN})

    set(extproj_revision_tag GIT_TAG "${dcmtkp_REVISION}")
    if ("${dcmtkp_REVISION}" STREQUAL "") 
        #set(extproj_revision_tag GIT_TAG "ae3b946f6e6231")
    endif()

    set(ep_project_include_arg)
    if (CTEST_USE_LAUNCHERS)
        set(ep_project_include_arg
            "-DCMAKE_PROJECT_DCMTK_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake")
    endif()

    if (NOT DEFINED location)
        set(SRC_DIR ${CMAKE_BINARY_DIR}/dcmtk/src/DCMTK)
        if (NOT dcmtkp_UPSTREAM)
            set(location GIT_REPOSITORY "git://github.com/medInria/dcmtk.git" ${extproj_revision_tag})
        else()
            set(location GIT_REPOSITORY "git://git.dcmtk.org/dcmtk.git" ${extproj_revision_tag})
        endif()
    endif()

    if (WIN32)
        set(shared_libs_option "-DBUILD_SHARED_LIBS:BOOL=OFF")
    else()
        set(shared_libs_option "-DBUILD_SHARED_LIBS:BOOL=ON")
    endif()

    ExternalProject_Add(DCMTK
        PREFIX dcmtk
        ${location}
        CMAKE_GENERATOR ${gen}
        UPDATE_COMMAND ""
        INSTALL_DIR dcmtk/install
        CMAKE_ARGS
            -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
        CMAKE_CACHE_ARGS
            ${ep_common_cache_args}
            ${ep_project_include_arg}
            ${shared_libs_option}
            -DDCMTK_WITH_DOXYGEN:BOOL=OFF
            -DDCMTK_WITH_ZLIB:BOOL=OFF # see github issue #25
            -DDCMTK_WITH_OPENSSL:BOOL=OFF # see github issue #25
            -DDCMTK_WITH_PNG:BOOL=OFF # see github issue #25
            -DDCMTK_WITH_TIFF:BOOL=OFF  # see github issue #25
            -DDCMTK_WITH_XML:BOOL=OFF  # see github issue #25
            -DDCMTK_WITH_ICONV:BOOL=OFF  # see github issue #178
            -DDCMTK_FORCE_FPIC_ON_UNIX:BOOL=ON
            -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS:BOOL=OFF
        )
        
    set(DCMTK_DIR ${CMAKE_BINARY_DIR}/dcmtk/install PARENT_SCOPE)

endfunction()
{'fraction_non_alphanumeric': 0.0928588263021447, 'fraction_numerical': 0.011784115012962526, 'mean_word_length': 2.7791629563668745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6245030', 'n_tokens_mistral': 1642, 'n_tokens_neox': 1509, 'n_words': 235}