2019-12-12 14:34:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(Net)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
|
|
include_directories(include/)
|
|
|
|
include_directories(utils/)
|
|
|
|
|
2020-06-26 09:25:10 +00:00
|
|
|
find_package(Boost REQUIRED)
|
2019-12-14 15:23:09 +00:00
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
|
|
|
|
message(STATUS SSL ${OPENSSL_LIBRARIES})
|
2019-12-12 14:34:09 +00:00
|
|
|
|
|
|
|
include(GoogleTest)
|
|
|
|
|
2019-12-14 15:23:09 +00:00
|
|
|
set(OPENSSL_LIBS /usr/local/lib/libssl.dylib /usr/local/lib/libcrypto.dylib)
|
2019-12-12 14:34:09 +00:00
|
|
|
set(GTEST_LIB /usr/local/lib/)
|
|
|
|
set(GTEST_LIBS gtest pthread dl)
|
|
|
|
|
2019-12-14 15:23:09 +00:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${SQLiteCpp_INCLUDE_DIRS})
|
2019-12-12 14:34:09 +00:00
|
|
|
link_directories(${GTEST_LIB})
|
|
|
|
|
|
|
|
aux_source_directory(src SOURCE_ALL)
|
|
|
|
|
2020-01-30 07:56:27 +00:00
|
|
|
add_executable(NetTest test/test_main.cpp)
|
2019-12-12 14:34:09 +00:00
|
|
|
|
2020-01-30 07:56:27 +00:00
|
|
|
gtest_add_tests(TARGET NetTest
|
2019-12-12 14:34:09 +00:00
|
|
|
TEST_SUFFIX .noArgs
|
|
|
|
TEST_LIST noArgsTests)
|
|
|
|
|
|
|
|
add_library(m_error STATIC src/error.cpp)
|
2019-12-14 15:23:09 +00:00
|
|
|
add_library(m_rsa STATIC src/rsa_cpp_binding.cpp)
|
2019-12-12 14:34:09 +00:00
|
|
|
|
2020-01-30 07:56:27 +00:00
|
|
|
target_link_libraries(NetTest m_rsa m_error ${GTEST_LIBS} ssl crypto boost_program_options)
|
|
|
|
set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
|