61 lines
1.9 KiB
CMake
61 lines
1.9 KiB
CMake
# ------------------------------
|
|
# cmake config / project
|
|
# ------------------------------
|
|
include(FetchContent)
|
|
|
|
cmake_minimum_required(VERSION 4.1.0)
|
|
|
|
project(tinymitm LANGUAGES CXX)
|
|
|
|
# ------------------------------
|
|
# options
|
|
# ------------------------------
|
|
option(TINYMITM_TEST "Add test project" OFF)
|
|
|
|
# ---------------------
|
|
# external dependencies
|
|
# ---------------------
|
|
FetchContent_Declare(
|
|
seallib
|
|
GIT_REPOSITORY https://git.neru.rip/neru/seallib
|
|
GIT_TAG a2784e50c7a969466fef01f9ddc8bc8c642a0a62
|
|
)
|
|
|
|
FetchContent_Declare(
|
|
wolfssl
|
|
GIT_REPOSITORY https://github.com/wolfSSL/wolfssl
|
|
GIT_TAG eecb8cc601f7b3987917e3ff1fa2212d5927d405
|
|
)
|
|
|
|
set(SEALLIB_EVENTS ON CACHE BOOL "" FORCE)
|
|
FetchContent_GetProperties(seallib)
|
|
FetchContent_MakeAvailable(seallib)
|
|
|
|
set(WOLFSSL_KEY_GEN ON CACHE BOOL "" FORCE)
|
|
set(WOLFSSL_CERT_GEN ON CACHE BOOL "" FORCE)
|
|
set(WOLFSSL_CERT_EXT ON CACHE BOOL "" FORCE)
|
|
set(WOLFSSL_RSA ON CACHE BOOL "" FORCE)
|
|
set(WOLFSSL_ALT_NAMES ON CACHE BOOL "" FORCE)
|
|
FetchContent_GetProperties(wolfssl)
|
|
FetchContent_MakeAvailable(wolfssl)
|
|
|
|
# ------------------------------
|
|
# proxy
|
|
# ------------------------------
|
|
file(GLOB_RECURSE TINYMITM_SOURCES CONFIGURE_DEPENDS "src/proxy/*.cpp" "src/proxy/*.h")
|
|
add_library(tinymitm STATIC ${TINYMITM_SOURCES})
|
|
target_include_directories(tinymitm PUBLIC src/proxy)
|
|
target_compile_features(tinymitm PUBLIC cxx_std_20)
|
|
target_link_libraries(tinymitm PRIVATE wolfssl)
|
|
target_link_libraries(tinymitm PUBLIC seallib)
|
|
set_target_properties(tinymitm PROPERTIES CXX_EXTENSIONS OFF)
|
|
|
|
# ------------------------------
|
|
# test
|
|
# ------------------------------
|
|
if (TINYMITM_TEST)
|
|
file(GLOB_RECURSE TINYMITM_TEST_SOURCES CONFIGURE_DEPENDS "src/test/*.h" "src/test/*.cpp")
|
|
add_executable(tinymitm-test ${TINYMITM_TEST_SOURCES})
|
|
target_include_directories(tinymitm-test PRIVATE "src/test")
|
|
target_link_libraries(tinymitm-test PRIVATE tinymitm)
|
|
endif() |