<commit_before>project(dep-glog)

include(ExternalProject)

find_library(GLOG_FIND_LIBRARY libglog.a)
if(${GLOG_FIND_LIBRARY} MATCHES GLOG_FIND_LIBRARY-NOTFOUND)

    set(GLOG_BUILD_COMMAND make -j8)
    set(GLOG_CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> CXXFLAGS=-fPIC)
    set(GLOG_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/src/glog")
    if(EXISTS ${GLOG_BUILD_DIR}/.libs/libglog.a)
        set(GLOG_CONFIGURE_COMMAND "cd")    # nop
        set(GLOG_BUILD_COMMAND "cd")        # nop
    endif()

    ExternalProject_Add(glog
        PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
        SOURCE_DIR ${GLOG_BUILD_DIR}
        GIT_REPOSITORY https://github.com/RoXeon/google-glog.git
        CONFIGURE_COMMAND ${GLOG_CONFIGURE_COMMAND}
        UPDATE_COMMAND ""
        BUILD_COMMAND ${GLOG_BUILD_COMMAND}
        BUILD_IN_SOURCE 1
        INSTALL_COMMAND ""
    )

    # Export dep includes and lib paths
    ExternalProject_Get_Property(glog prefix)
    ExternalProject_Get_Property(glog source_dir)
    set(GLOG_INCLUDE_DIR ${source_dir}/src PARENT_SCOPE)
    set(GLOG_LIBRARIES ${source_dir}/.libs/libglog.a PARENT_SCOPE)

else()

    set(GLOG_INCLUDE_DIR "" PARENT_SCOPE)
    set(GLOG_LIBRARIES ${GLOG_FIND_LIBRARY} PARENT_SCOPE)

endif()<commit_msg>VFS-292: improve build<commit_after>project(dep-glog)

include(ExternalProject)

find_library(GLOG_FIND_LIBRARY libglog.a)
if(${GLOG_FIND_LIBRARY} MATCHES GLOG_FIND_LIBRARY-NOTFOUND)

    set(GLOG_BUILD_COMMAND make -j8)
    set(GLOG_CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> CXXFLAGS=-fPIC)
    set(GLOG_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/src/glog")
    if(EXISTS ${GLOG_BUILD_DIR}/.libs/libglog.a)
        set(GLOG_CONFIGURE_COMMAND "cd")    # nop
        set(GLOG_BUILD_COMMAND "cd")        # nop
    endif()

    ExternalProject_Add(glog
        PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
        SOURCE_DIR ${GLOG_BUILD_DIR}
        GIT_REPOSITORY https://github.com/RoXeon/google-glog.git
        CONFIGURE_COMMAND ${GLOG_CONFIGURE_COMMAND}
        UPDATE_COMMAND ""
        BUILD_COMMAND ${GLOG_BUILD_COMMAND}
        BUILD_IN_SOURCE 1
        INSTALL_COMMAND ""
    )

    # Export dep includes and lib paths
    ExternalProject_Get_Property(glog prefix)
    ExternalProject_Get_Property(glog source_dir)
    set(GLOG_INCLUDE_DIR ${source_dir}/src PARENT_SCOPE)
    set(GLOG_LIBRARIES ${source_dir}/.libs/libglog.a PARENT_SCOPE)

else()

    get_filename_component(GLOG_TMP_PATH ${GLOG_FIND_LIBRARY} PATH)

    set(GLOG_INCLUDE_DIR "${GLOG_TMP_PATH}/../include" PARENT_SCOPE)
    set(GLOG_LIBRARIES ${GLOG_FIND_LIBRARY} PARENT_SCOPE)

endif()
{'fraction_non_alphanumeric': 0.09873708381171067, 'fraction_numerical': 0.0026789131266743206, 'mean_word_length': 4.065891472868217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '7357081', 'n_tokens_mistral': 1048, 'n_tokens_neox': 972, 'n_words': 131}