<commit_before>cmake_minimum_required(VERSION 3.6.2)

#
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")

# Add external cmake modules
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../cmake")

# DEPENDENCIES
## OpenSSL v1.0.2l
if (MACOSX)
    set(OPENSSL_ROOT_DIR "/usr/local/Cellar/openssl/1.0.2l")
elseif (UNIX)
    set(OPENSSL_ROOT_DIR "/usr/local/ssl")
endif ()
find_package(OpenSSL REQUIRED)
include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})

## Boost Library v1.64
find_package(Threads)
set(EXTRA_LIBS ${EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
if (UNIX)
    set(BOOST_INCLUDEDIR "/usr/local/Cellar/boost/1.64.0_1/include")
    set(BOOST_LIBRARYDIR "/usr/local/Cellar/boost/1.64.0_1/lib")
endif ()
find_package(Boost 1.6 REQUIRED COMPONENTS system thread date_time program_options)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})

# Standard DSA v2 headers
include_directories(".")
include_directories(${PROJECT_INCLUDE_DIR})

# LIBRARIES:
set(LIB_UTIL "./util")
set(LIB_VARIANT "./variant")
set(LIB_CRYPTO "./crypto")
set(LIB_MESSAGE "./message")
set(LIB_STREAM "./stream")
set(LIB_NETWORK "./network")
set(LIB_REQUESTER "./requester")
set(LIB_RESPONDER "./responder")
set(LIB_CORE "./core")
set(LIB_MODULE "./module")
set(LIB_DSLINK "./dslink")

# SOURCE FILES
set(ProjectSourceFiles core/link_strand.cc core/link_strand.h)

# EXTERNAL LIBRARIES
set(ExtraLibs)

include(${LIB_UTIL}/CMakeListsInclude.txt)
include(${LIB_VARIANT}/CMakeListsInclude.txt)
include(${LIB_CRYPTO}/CMakeListsInclude.txt)
include(${LIB_MESSAGE}/CMakeListsInclude.txt)
include(${LIB_STREAM}/CMakeListsInclude.txt)
include(${LIB_NETWORK}/CMakeListsInclude.txt)
include(${LIB_REQUESTER}/CMakeListsInclude.txt)
include(${LIB_RESPONDER}/CMakeListsInclude.txt)
include(${LIB_CORE}/CMakeListsInclude.txt)
include(${LIB_MODULE}/CMakeListsInclude.txt)
include(${LIB_DSLINK}/CMakeListsInclude.txt)

add_library(dsa_sdk STATIC ${ProjectSourceFiles} dsa_common.cc dsa_common.h
        $<TARGET_OBJECTS:msgpackc-object>
        $<TARGET_OBJECTS:jansson-object>)
target_link_libraries(dsa_sdk ${EXTRA_LIBS})
target_compile_features(dsa_sdk PRIVATE cxx_range_for)
install(TARGETS dsa_sdk<commit_msg>fix compilation issue with jansson.h on Linux<commit_after>cmake_minimum_required(VERSION 3.6.2)

# Add external cmake modules
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../cmake")

# DEPENDENCIES
## OpenSSL v1.0.2l
if (MACOSX)
    set(OPENSSL_ROOT_DIR "/usr/local/Cellar/openssl/1.0.2l")
elseif (UNIX)
    set(OPENSSL_ROOT_DIR "/usr/local/ssl")
endif ()
find_package(OpenSSL REQUIRED)
include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})

## Boost Library v1.64
find_package(Threads)
set(EXTRA_LIBS ${EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
if (UNIX)
    set(BOOST_INCLUDEDIR "/usr/local/Cellar/boost/1.64.0_1/include")
    set(BOOST_LIBRARYDIR "/usr/local/Cellar/boost/1.64.0_1/lib")
endif ()
find_package(Boost 1.6 REQUIRED COMPONENTS system thread date_time program_options)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})

# Standard DSA v2 headers
include_directories(".")
include_directories(${PROJECT_INCLUDE_DIR})

# LIBRARIES:
set(LIB_UTIL "./util")
set(LIB_VARIANT "./variant")
set(LIB_CRYPTO "./crypto")
set(LIB_MESSAGE "./message")
set(LIB_STREAM "./stream")
set(LIB_NETWORK "./network")
set(LIB_REQUESTER "./requester")
set(LIB_RESPONDER "./responder")
set(LIB_CORE "./core")
set(LIB_MODULE "./module")
set(LIB_DSLINK "./dslink")

# SOURCE FILES
set(ProjectSourceFiles core/link_strand.cc core/link_strand.h)

# EXTERNAL LIBRARIES
set(ExtraLibs)

include(${LIB_UTIL}/CMakeListsInclude.txt)
include(${LIB_VARIANT}/CMakeListsInclude.txt)
include(${LIB_CRYPTO}/CMakeListsInclude.txt)
include(${LIB_MESSAGE}/CMakeListsInclude.txt)
include(${LIB_STREAM}/CMakeListsInclude.txt)
include(${LIB_NETWORK}/CMakeListsInclude.txt)
include(${LIB_REQUESTER}/CMakeListsInclude.txt)
include(${LIB_RESPONDER}/CMakeListsInclude.txt)
include(${LIB_CORE}/CMakeListsInclude.txt)
include(${LIB_MODULE}/CMakeListsInclude.txt)
include(${LIB_DSLINK}/CMakeListsInclude.txt)

if (WIN32)
  set_source_files_properties(${LIB_VARIANT}/json.cc PROPERTIES COMPILE_FLAGS "/permissive-")
else ()
  set_source_files_properties(${LIB_VARIANT}/json.cc PROPERTIES COMPILE_FLAGS "-fpermissive")
endif ()

add_library(dsa_sdk STATIC ${ProjectSourceFiles} dsa_common.cc dsa_common.h
        $<TARGET_OBJECTS:msgpackc-object>
        $<TARGET_OBJECTS:jansson-object>)
target_link_libraries(dsa_sdk ${EXTRA_LIBS})
target_compile_features(dsa_sdk PRIVATE cxx_range_for)
install(TARGETS dsa_sdk
{'fraction_non_alphanumeric': 0.13777191825972313, 'fraction_numerical': 0.011426060206548011, 'mean_word_length': 7.42962962962963, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '1321729', 'n_tokens_mistral': 1783, 'n_tokens_neox': 1694, 'n_words': 242}