<commit_before>if (NOT FOLLY_FOUND OR USE_BUNDLED_FOLLY)
    if (NOT FOLLY_VERSION OR USE_BUNDLED_FOLLY)
        set (FOLLY_VERSION              2017.03.13.00)
        set (FOLLY_URL_MD5              3ba9d455edcf6e930b6f43e93e9f99f7)
    endif()

    ExternalProject_Add(Folly
        DOWNLOAD_NAME       Folly-${FOLLY_VERSION}.tar.gz
        URL                 https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz
        URL_MD5             ${FOLLY_URL_MD5}
        CONFIGURE_COMMAND   cd <SOURCE_DIR>/folly &&
                            autoreconf -vi &&
                            LD_LIBRARY_PATH=<INSTALL_DIR>/lib
                            LIBRARY_PATH=<INSTALL_DIR>/lib
                            LDFLAGS=-L<INSTALL_DIR>/lib
                            PKG_CONFIG_PATH=<INSTALL_DIR>/lib/pkgconfig
                            CFLAGS=-I<INSTALL_DIR>/include
                            CXXFLAGS=-I<INSTALL_DIR>/include
                            LIBS=${CMAKE_THREAD_LIBS_INIT}
                            OPENSSL_CFLAGS=-I${OPENSSL_INCLUDE_DIR}
                            OPENSSL_LIBS=-L${OPENSSL_LIBRARY_DIR}
                            <SOURCE_DIR>/folly/configure
                                --prefix=<INSTALL_DIR>
                                ${WITH_OPENSSL}
        BUILD_COMMAND       cd <SOURCE_DIR>/folly &&
                            make
        INSTALL_COMMAND     cd <SOURCE_DIR>/folly &&
                            make install
        TEST_COMMAND        ""
    )

    ExternalProject_Get_Property(Folly INSTALL_DIR)

    set (FOLLY_ROOT_DIR         ${INSTALL_DIR})
    set (FOLLY_STATIC_LIBRARY   "${FOLLY_ROOT_DIR}/lib/libfolly.a")
    set (FOLLY_LIBRARIES        ${FOLLY_STATIC_LIBRARY})
    set (FOLLY_FOUND            YES)

    find_path(FOLLY_INCLUDE_DIR "folly/String.h"<commit_msg>add dependencies when TARGET is exists<commit_after>if (NOT FOLLY_FOUND OR USE_BUNDLED_FOLLY)
    if (NOT FOLLY_VERSION OR USE_BUNDLED_FOLLY)
        set (FOLLY_VERSION              2017.03.13.00)
        set (FOLLY_URL_MD5              3ba9d455edcf6e930b6f43e93e9f99f7)
    endif()

    ExternalProject_Add(Folly
        DOWNLOAD_NAME       Folly-${FOLLY_VERSION}.tar.gz
        URL                 https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz
        URL_MD5             ${FOLLY_URL_MD5}
        CONFIGURE_COMMAND   cd <SOURCE_DIR>/folly &&
                            autoreconf -vi &&
                            LD_LIBRARY_PATH=<INSTALL_DIR>/lib
                            LIBRARY_PATH=<INSTALL_DIR>/lib
                            LDFLAGS=-L<INSTALL_DIR>/lib
                            PKG_CONFIG_PATH=<INSTALL_DIR>/lib/pkgconfig
                            CFLAGS=-I<INSTALL_DIR>/include
                            CXXFLAGS=-I<INSTALL_DIR>/include
                            LIBS=${CMAKE_THREAD_LIBS_INIT}
                            OPENSSL_CFLAGS=-I${OPENSSL_INCLUDE_DIR}
                            OPENSSL_LIBS=-L${OPENSSL_LIBRARY_DIR}
                            <SOURCE_DIR>/folly/configure
                                --prefix=<INSTALL_DIR>
                                ${WITH_OPENSSL}
        BUILD_COMMAND       cd <SOURCE_DIR>/folly &&
                            make
        INSTALL_COMMAND     cd <SOURCE_DIR>/folly &&
                            make install
        TEST_COMMAND        ""
    )

    if (TARGET GFlags)
        add_dependencies(Folly GFlags)
    endif ()

    if (TARGET GLog)
        add_dependencies(Folly GLog)
    endif ()

    ExternalProject_Get_Property(Folly INSTALL_DIR)

    set (FOLLY_ROOT_DIR         ${INSTALL_DIR})
    set (FOLLY_STATIC_LIBRARY   "${FOLLY_ROOT_DIR}/lib/libfolly.a")
    set (FOLLY_LIBRARIES        ${FOLLY_STATIC_LIBRARY})
    set (FOLLY_FOUND            YES)

    find_path(FOLLY_INCLUDE_DIR "folly/String.h"
{'fraction_non_alphanumeric': 0.07742270719667446, 'fraction_numerical': 0.01610808002078462, 'mean_word_length': 1.4367088607594938, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '481086', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1130, 'n_words': 150}