<commit_before>#-----------------------------------------------------------------------------
# Poco
#-----------------------------------------------------------------------------

if(MITK_USE_Poco)

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

  set(proj Poco)
  set(proj_DEPENDENCIES )
  set(${proj}_DEPENDS ${proj})

  if(NOT DEFINED ${proj}_DIR)

    set(additional_cmake_args )
    if(CTEST_USE_LAUNCHERS)
      list(APPEND additional_cmake_args
        "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake"
      )
    endif()

    mitk_query_custom_ep_vars()

    set(ssl_args
      -DENABLE_CRYPTO:BOOL=OFF
      -DENABLE_NETSSL:BOOL=OFF
      -DENABLE_NETSSL_WIN:BOOL=OFF
    )

    if(OpenSSL_FOUND)
      set(ssl_args
        -DENABLE_CRYPTO:BOOL=ON
        -DENABLE_NETSSL:BOOL=ON
        -DFORCE_OPENSSL:BOOL=ON
      )

      if(OPENSSL_ROOT_DIR)
        list(APPEND ssl_args
          "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}"
        )
      endif()
    endif()

    ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/poco-1.9.0.tar.gz
      URL_MD5 1011839033f72de138f0c523c2caa121
      CMAKE_GENERATOR ${gen}
      CMAKE_GENERATOR_PLATFORM ${gen_platform}
      CMAKE_ARGS
        ${ep_common_args}
        ${additional_cmake_args}
        ${ssl_args}
        -DENABLE_XML:BOOL=ON
        -DENABLE_JSON:BOOL=ON
        -DENABLE_MONGODB:BOOL=OFF
        -DENABLE_PDF:BOOL=OFF
        -DENABLE_UTIL:BOOL=ON
        -DENABLE_NET:BOOL=ON
        -DENABLE_DATA:BOOL=OFF
        -DENABLE_DATA_SQLITE:BOOL=OFF
        -DENABLE_DATA_MYSQL:BOOL=OFF
        -DENABLE_DATA_ODBC:BOOL=OFF
        -DENABLE_SEVENZIP:BOOL=OFF<commit_msg>Upgrade Poco from version 1.9.0 to 1.12.1.<commit_after>#-----------------------------------------------------------------------------
# Poco
#-----------------------------------------------------------------------------

if(MITK_USE_Poco)

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

  set(proj Poco)
  set(proj_DEPENDENCIES )
  set(${proj}_DEPENDS ${proj})

  if(NOT DEFINED ${proj}_DIR)

    set(additional_cmake_args )
    if(CTEST_USE_LAUNCHERS)
      list(APPEND additional_cmake_args
        "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake"
      )
    endif()

    mitk_query_custom_ep_vars()

    set(ssl_args
      -DENABLE_CRYPTO:BOOL=OFF
      -DENABLE_NETSSL:BOOL=OFF
      -DENABLE_NETSSL_WIN:BOOL=OFF
    )

    if(OpenSSL_FOUND)
      set(ssl_args
        -DENABLE_CRYPTO:BOOL=ON
        -DENABLE_NETSSL:BOOL=ON
        -DFORCE_OPENSSL:BOOL=ON
      )

      if(OPENSSL_ROOT_DIR)
        list(APPEND ssl_args
          "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}"
        )
      endif()
    endif()

    ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
      GIT_REPOSITORY https://github.com/pocoproject/poco.git
      GIT_TAG poco-1.12.1-release
      CMAKE_GENERATOR ${gen}
      CMAKE_GENERATOR_PLATFORM ${gen_platform}
      CMAKE_ARGS
        ${ep_common_args}
        ${additional_cmake_args}
        ${ssl_args}
        -DENABLE_XML:BOOL=ON
        -DENABLE_JSON:BOOL=ON
        -DENABLE_MONGODB:BOOL=OFF
        -DENABLE_PDF:BOOL=OFF
        -DENABLE_UTIL:BOOL=ON
        -DENABLE_NET:BOOL=ON
        -DENABLE_DATA:BOOL=OFF
        -DENABLE_DATA_SQLITE:BOOL=OFF
        -DENABLE_DATA_MYSQL:BOOL=OFF
        -DENABLE_DATA_ODBC:BOOL=OFF
        -DENABLE_SEVENZIP:BOOL=OFF
{'fraction_non_alphanumeric': 0.1729021913415286, 'fraction_numerical': 0.010154997327632281, 'mean_word_length': 2.1139767054908485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '7187870', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1332, 'n_words': 161}