<commit_before>cmake_minimum_required(VERSION 2.8.6)
project(kinetic_cpp_client_examples CXX C)

find_package (Threads)

set(CMAKE_CXX_FLAGS "-g --std=c++11 -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-unused-parameter -Wno-unused-local-typedefs -Wno-null-dereference -DGTEST_USE_OWN_TR1_TUPLE=1 -D__STDC_FORMAT_MACROS")

set(GENERATED_SOURCES_PATH ${kinetic_cpp_client_SOURCE_DIR}/src/main/generated)

include(ExternalProject)

option(USE_LOCAL_KINETIC_CLIENT "Uses the kinetic client at the KINETIC_CLIENT_PATH variable instead of downloading library from Git" off)
if(USE_LOCAL_KINETIC_CLIENT)
else(USE_LOCAL_KINETIC_CLIENT)
    set(KINETIC_CLIENT_PATH "${kinetic_cpp_client_examples_SOURCE_DIR}/vendor/src/kinetic_cpp_client")

    ExternalProject_add(
        kinetic_cpp_client
        PREFIX "vendor"
        GIT_REPOSITORY "<EMAIL>:Seagate/Kinetic-C-Client.git"
        GIT_TAG "e5a14908ac17652d621997261a51dfac4c141c86"
        BUILD_IN_SOURCE 1
        INSTALL_COMMAND ""
    )
endif(USE_LOCAL_KINETIC_CLIENT)

include_directories(
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/include
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/include
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/src/gmock/fused-src
    ${KINETIC_CLIENT_PATH}/src/main
    ${KINETIC_CLIENT_PATH}/src/main/generated
    ${KINETIC_CLIENT_PATH}/include
)

set(LIBRARY_DEPENDENCIES
    ${KINETIC_CLIENT_PATH}/libkinetic_client.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/libprotobufutil.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libglog.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libgflags.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libssl.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libcrypto.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libprotobuf.a
    ${CMAKE_THREAD_LIBS_INIT}
    dl
)

macro(add_example_target NAME)
    add_executable(${NAME} src/${NAME}.cc)
    target_link_libraries(${NAME} ${LIBRARY_DEPENDENCIES})
    add_dependencies(${NAME} kinetic_cpp_client)

    set_target_properties( ${NAME} PROPERTIES
        RUNTIME_OUTPUT_DIRECTORY_DEBUG   ${CMAKE_SOURCE_DIR}
        RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}
        ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}
        ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}
    )
endmacro(add_example_target)

add_example_target(kineticstat)
add_example_target(ise)
add_example_target(setclusterversion)
add_example_target(setpin)
add_example_target(set_acls)
add_example_target(write_file_blocking)
add_example_target(read_file_blocking)
add_example_target(read_file_nonblocking)
add_example_target(delete_file_nonblocking)
add_example_target(delete_file_blocking)
add_example_target(write_file_nonblocking)
add_example_target(firmware_update)

<commit_msg>update to latest master<commit_after>cmake_minimum_required(VERSION 2.8.6)
project(kinetic_cpp_client_examples CXX C)

find_package (Threads)

set(CMAKE_CXX_FLAGS "-g --std=c++11 -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-unused-parameter -Wno-unused-local-typedefs -Wno-null-dereference -DGTEST_USE_OWN_TR1_TUPLE=1 -D__STDC_FORMAT_MACROS")

set(GENERATED_SOURCES_PATH ${kinetic_cpp_client_SOURCE_DIR}/src/main/generated)

include(ExternalProject)

option(USE_LOCAL_KINETIC_CLIENT "Uses the kinetic client at the KINETIC_CLIENT_PATH variable instead of downloading library from Git" off)
if(USE_LOCAL_KINETIC_CLIENT)
else(USE_LOCAL_KINETIC_CLIENT)
    set(KINETIC_CLIENT_PATH "${kinetic_cpp_client_examples_SOURCE_DIR}/vendor/src/kinetic_cpp_client")

    ExternalProject_add(
        kinetic_cpp_client
        PREFIX "vendor"
        GIT_REPOSITORY "<EMAIL>:Seagate/Kinetic-C-Client.git"
        GIT_TAG "ed256779886d08671551d3441a31a467b094f9dc"
        BUILD_IN_SOURCE 1
        INSTALL_COMMAND ""
    )
endif(USE_LOCAL_KINETIC_CLIENT)

include_directories(
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/include
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/include
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/src/gmock/fused-src
    ${KINETIC_CLIENT_PATH}/src/main
    ${KINETIC_CLIENT_PATH}/src/main/generated
    ${KINETIC_CLIENT_PATH}/include
)

set(LIBRARY_DEPENDENCIES
    ${KINETIC_CLIENT_PATH}/libkinetic_client.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/libprotobufutil.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libglog.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libgflags.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libssl.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libcrypto.a
    ${KINETIC_CLIENT_PATH}/vendor/src/protobufutil/vendor/lib/libprotobuf.a
    ${CMAKE_THREAD_LIBS_INIT}
    dl
)

macro(add_example_target NAME)
    add_executable(${NAME} src/${NAME}.cc)
    target_link_libraries(${NAME} ${LIBRARY_DEPENDENCIES})
    add_dependencies(${NAME} kinetic_cpp_client)

    set_target_properties( ${NAME} PROPERTIES
        RUNTIME_OUTPUT_DIRECTORY_DEBUG   ${CMAKE_SOURCE_DIR}
        RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}
        ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}
        ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}
    )
endmacro(add_example_target)

add_example_target(kineticstat)
add_example_target(ise)
add_example_target(setclusterversion)
add_example_target(setpin)
add_example_target(set_acls)
add_example_target(write_file_blocking)
add_example_target(read_file_blocking)
add_example_target(read_file_nonblocking)
add_example_target(delete_file_nonblocking)
add_example_target(delete_file_blocking)
add_example_target(write_file_nonblocking)
add_example_target(firmware_update)


{'fraction_non_alphanumeric': 0.09261186264308012, 'fraction_numerical': 0.012833853624696497, 'mean_word_length': 6.263224181360202, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4636896', 'n_tokens_mistral': 2215, 'n_tokens_neox': 2121, 'n_words': 209}