62 lines
1.6 KiB
CMake
62 lines
1.6 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(Kylin)
|
|
|
|
option(INDEPENDENT_BUILD "build self." OFF)
|
|
option(UNIT_TEST "do unit test" OFF)
|
|
|
|
if(INDEPENDENT_BUILD)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(KYLIN_WITH_FLUENT ON)
|
|
if(WIN32)
|
|
set(Projects_ROOT E:/Projects)
|
|
set(Libraries_ROOT ${Projects_ROOT}/Libraries)
|
|
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_86_0_msvc2022_64bit)
|
|
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include/boost-1_86)
|
|
add_compile_definitions(
|
|
BOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN10
|
|
)
|
|
|
|
set(OpenSSL_ROOT D:/Qt/Tools/OpenSSLv3/Win_x64)
|
|
set(OPENSSL_INCLUDE_DIR ${OpenSSL_ROOT}/include)
|
|
set(OpenSSL_LIBRARY_DIRS ${OpenSSL_ROOT}/lib)
|
|
set(OpenSSL_LIBRARIES libssl libcrypto)
|
|
else()
|
|
execute_process(
|
|
COMMAND sh -c "echo $HOME"
|
|
OUTPUT_VARIABLE USER_HOME
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
set(Projects_ROOT ${USER_HOME}/Projects)
|
|
set(Libraries_ROOT /opt/Libraries)
|
|
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_86_0)
|
|
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include)
|
|
endif()
|
|
option(Boost_USE_STATIC_LIBS OFF)
|
|
|
|
add_subdirectory(Examples)
|
|
endif()
|
|
|
|
find_package(Boost REQUIRED COMPONENTS log serialization)
|
|
|
|
set(OpenSSL_LIBRARY ssl crypto)
|
|
|
|
add_subdirectory(DataStructure)
|
|
|
|
if(TARGET Boost::serialization)
|
|
add_subdirectory(Encrypt)
|
|
endif()
|
|
|
|
add_subdirectory(HttpProxy)
|
|
|
|
if(KYLIN_WITH_FLUENT)
|
|
add_subdirectory(Fluent)
|
|
endif()
|
|
|
|
add_subdirectory(Universal)
|
|
|
|
if(UNIT_TEST)
|
|
add_subdirectory(UnitTest)
|
|
endif() |