<commit_before>cmake_minimum_required(VERSION 3.0.0)
project(KuzzleSKDTests)


include(ExternalProject)

ExternalProject_Add(
    project_cucumber_cpp
    GIT_REPOSITORY https://github.com/cucumber/cucumber-cpp
    INSTALL_COMMAND ""
    CMAKE_CACHE_ARGS
      -DCUKE_DISABLE_QT:BOOL=ON 
      -DCUKE_ENABLE_EXAMPLES:BOOL=OFF 
      -DCUKE_DISABLE_GTEST:BOOL=ON
      -DCUKE_DISABLE_UNIT_TESTS:BOOL=ON
      -DCUKE_DISABLE_E2E_TESTS:BOOL=ON
)

# Library
ExternalProject_Get_Property(project_cucumber_cpp binary_dir)
set(CUCUMBER_CPP_LIBRARY_PATH ${binary_dir}/${CMAKE_FIND_SOURCE_PREFIXES}/src/libcucumber-cpp.a)
set(CUCUMBER_CPP_LIBRARY cucumber-cpp)


ExternalProject_Get_property(project_cucumber_cpp SOURCE_DIR)
set(CUCUMBER_CPP_INCLUDE_PATH "${SOURCE_DIR}/include")

message("cucumber-cpp: include path  = ${CUCUMBER_CPP_INCLUDE_PATH}")
message("cucumber-cpp: library parh = ${CUCUMBER_CPP_LIBRARY_PATH}")

add_library(cucumber-cpp STATIC IMPORTED) # or STATIC instead of SHARED
add_dependencies(cucumber-cpp project_cucumber_cpp)
set_target_properties(cucumber-cpp PROPERTIES
    IMPORTED_LOCATION ${CUCUMBER_CPP_LIBRARY_PATH}
    INTERFACE_INCLUDE_DIRECTORIES  ${CUCUMBER_CPP_INCLUDE_PATH}
    DEPENDS project_cucumber_cpp
)

#
# JSon Spirit
#

add_subdirectory(3rdparty/json_spirit)

#
# Kuzzle SDK 
#

get_filename_component(KUZZLE_SDK_ROOT "${CMAKE_SOURCE_DIR}/../../" ABSOLUTE)
message("Kuzzle SDK root: ${KUZZLE_SDK_ROOT}")

#
# Boost
#
set(BOOST_MIN_VERSION "1.46")

set(Boost_USE_STATIC_RUNTIME OFF)
set(CUKE_CORE_BOOST_LIBS thread system regex date_time program_options filesystem)
if(NOT CUKE_DISABLE_BOOST_TEST)
    # "An external test runner utility is required to link with dynamic library" (Boost User's Guide)
    set(Boost_USE_STATIC_LIBS OFF)
    set(CMAKE_CXX_FLAGS "-DBOOST_TEST_DYN_LINK ${CMAKE_CXX_FLAGS}")
    find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS unit_test_framework)
endif()

if(CUKE_USE_STATIC_BOOST)<commit_msg>fixed build: fixed tests weren't building anymore<commit_after>cmake_minimum_required(VERSION 3.0.0)
project(KuzzleSKDTests)


include(ExternalProject)

ExternalProject_Add(
    project_cucumber_cpp
    GIT_REPOSITORY https://github.com/cucumber/cucumber-cpp
    INSTALL_COMMAND ""

    CMAKE_CACHE_ARGS
      -DCUKE_DISABLE_QT:BOOL=ON 
      -DCUKE_ENABLE_EXAMPLES:BOOL=OFF 
      -DCUKE_DISABLE_GTEST:BOOL=ON
      -DCUKE_DISABLE_UNIT_TESTS:BOOL=ON
      -DCUKE_DISABLE_E2E_TESTS:BOOL=ON
)

# Library
ExternalProject_Get_Property(project_cucumber_cpp binary_dir)
set(CUCUMBER_CPP_LIBRARY_PATH ${binary_dir}/${CMAKE_FIND_SOURCE_PREFIXES}/src/libcucumber-cpp.a)
list( APPEND CUCUMBER_CPP_INCLUDE_PATH "${binary_dir}/${CMAKE_FIND_SOURCE_PREFIXES}/src")
set(CUCUMBER_CPP_LIBRARY cucumber-cpp)


ExternalProject_Get_property(project_cucumber_cpp SOURCE_DIR)
list(APPEND CUCUMBER_CPP_INCLUDE_PATH "${SOURCE_DIR}/include")

message("cucumber-cpp: include path  = ${CUCUMBER_CPP_INCLUDE_PATH}")
message("cucumber-cpp: library parh = ${CUCUMBER_CPP_LIBRARY_PATH}")

list(APPEND LIB_INCLUDE_DIRS "dir1")
list(APPEND LIB_INCLUDE_DIRS "dir2")

add_library(cucumber-cpp STATIC IMPORTED) # or STATIC instead of SHARED
add_dependencies(cucumber-cpp project_cucumber_cpp)
set_target_properties(cucumber-cpp PROPERTIES
    IMPORTED_LOCATION ${CUCUMBER_CPP_LIBRARY_PATH}
    INTERFACE_INCLUDE_DIRECTORIES  
        "${CUCUMBER_CPP_INCLUDE_PATH}"
    DEPENDS project_cucumber_cpp
)

#
# JSon Spirit
#

add_subdirectory(3rdparty/json_spirit)

#
# Kuzzle SDK 
#

get_filename_component(KUZZLE_SDK_ROOT "${CMAKE_SOURCE_DIR}/../../" ABSOLUTE)
message("Kuzzle SDK root: ${KUZZLE_SDK_ROOT}")

#
# Boost
#
set(BOOST_MIN_VERSION "1.46")

set(Boost_USE_STATIC_RUNTIME OFF)
set(CUKE_CORE_BOOST_LIBS thread system regex date_time program_options filesystem)
if(NOT CUKE_DISABLE_BOOST_TEST)
    # "An external test runner utility is required to link with dynamic library" (Boost User's Guide)
    set(Boost_USE_STATIC_LIBS OFF)
    set(CMAKE_CXX_FLAGS "-DBOOST_TEST_DYN_LINK ${CMAKE_CXX_FLAGS}")
    find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS unit_test_framework)
endif()

if(CUKE_USE_STATIC_BOOST)
{'fraction_non_alphanumeric': 0.08903943866440842, 'fraction_numerical': 0.004355189934672151, 'mean_word_length': 6.814744801512287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1688978', 'n_tokens_mistral': 1660, 'n_tokens_neox': 1561, 'n_words': 224}