<commit_before># Installs GTest into build directory
if(GTest_ARGUMENTS)
    cmake_parse_arguments(GTest
        "SVN_REPOSITORY;TIMEOUT"
        ""
        ${GTest_ARGUMENTS}
    )
endif()

set(arguments SVN_REPOSITORY)
if(GTest_SVN_REPOSITORY)
    list(APPEND arguments ${GTest_SVN_REPOSITORY})
else()
    list(APPEND arguments http://googletest.googlecode.com/svn/trunk/)
endif()
if(GTest_TIMEOUT)
    list(APPEND arguments TIMEOUT ${GTest_TIMEOUT})
else()
    list(APPEND arguments TIMEOUT 10)
endif()

# write subset of variables to cache for gtest to use
include(PassonVariables)
passon_variables(GTest
    FILENAME "${EXTERNAL_ROOT}/src/GTestVariables.cmake"
    PATTERNS
        "CMAKE_[^_]*_R?PATH"
        "CMAKE_C_.*"
        "CMAKE_CXX_.*"
)

set(cmake_args -DBUILD_SHARED_LIBS=OFF -Dgtest_force_shared_crt=ON)
if(MINGW)
  list(APPEND cmake_args -Dgtest_disable_pthreads=ON)
endif()

ExternalProject_Add(
    GTest
    PREFIX ${EXTERNAL_ROOT}
    ${arguments}
    # Force separate output paths for debug and release builds to allow easy
    # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands
    CMAKE_ARGS
        -C "${EXTERNAL_ROOT}/src/GTestVariables.cmake"
        -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
        ${cmake_args}
    # Wrap download, configure and build steps in a script to log output
    INSTALL_COMMAND ""
    UPDATE_COMMAND ""
    LOG_DOWNLOAD ON
    LOG_CONFIGURE ON
    LOG_BUILD ON
)

add_recursive_cmake_step(GTest DEPENDEES build)
# Required by FindGTest
set(GTEST_ROOT "${EXTERNAL_ROOT}/src/GTest-build" CACHE
    PATH "Path to gtest root install directory")<commit_msg>:lipstick: add safeguards around directory<commit_after># Installs GTest into build directory
if(GTest_ARGUMENTS)
    cmake_parse_arguments(GTest
        "SVN_REPOSITORY;TIMEOUT"
        ""
        ${GTest_ARGUMENTS}
    )
endif()

set(arguments SVN_REPOSITORY)
if(GTest_SVN_REPOSITORY)
    list(APPEND arguments ${GTest_SVN_REPOSITORY})
else()
    list(APPEND arguments http://googletest.googlecode.com/svn/trunk/)
endif()
if(GTest_TIMEOUT)
    list(APPEND arguments TIMEOUT ${GTest_TIMEOUT})
else()
    list(APPEND arguments TIMEOUT 10)
endif()

# write subset of variables to cache for gtest to use
include(PassonVariables)
passon_variables(GTest
    FILENAME "${EXTERNAL_ROOT}/src/GTestVariables.cmake"
    PATTERNS
        "CMAKE_[^_]*_R?PATH"
        "CMAKE_C_.*"
        "CMAKE_CXX_.*"
)

set(cmake_args -DBUILD_SHARED_LIBS=OFF -Dgtest_force_shared_crt=ON)
if(MINGW)
  list(APPEND cmake_args -Dgtest_disable_pthreads=ON)
endif()

ExternalProject_Add(
    GTest
    PREFIX "${EXTERNAL_ROOT}"
    ${arguments}
    # Force separate output paths for debug and release builds to allow easy
    # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands
    CMAKE_ARGS
        -C "${EXTERNAL_ROOT}/src/GTestVariables.cmake"
        -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
        ${cmake_args}

    # Wrap download, configure and build steps in a script to log output
    INSTALL_COMMAND ""
    UPDATE_COMMAND ""
    LOG_DOWNLOAD ON
    LOG_CONFIGURE ON
    LOG_BUILD ON
)

add_recursive_cmake_step(GTest DEPENDEES build)
# Required by FindGTest
set(GTEST_ROOT "${EXTERNAL_ROOT}/src/GTest-build" CACHE
    PATH "Path to gtest root install directory")
{'fraction_non_alphanumeric': 0.08837772397094432, 'fraction_numerical': 0.0012106537530266344, 'mean_word_length': 4.1003086419753085, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4860355', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1143, 'n_words': 253}