-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
31 lines (26 loc) · 982 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 3.0.0)
project(KnowledgeCool VERSION 2023.04.03 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
include_directories("${CMAKE_SOURCE_DIR}/include/")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
endif()
add_executable(${PROJECT_NAME}
src/handle/Baidu/Baidu.cpp
src/handle/Yinfu/Yinfu.cpp
src/utils/base64/base64.cpp
src/utils/crypto/crypto.cpp
src/main.cpp
)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32)
target_link_libraries(${PROJECT_NAME} PRIVATE crypt32)
target_link_libraries(${PROJECT_NAME} PRIVATE cryptui)
endif()
# cpp-httplib only support 1.1.1 or 3.0.0 version OpenSSL
find_package(OpenSSL REQUIRED)
if(OpenSSL_FOUND)
target_link_directories(${PROJECT_NAME} PRIVATE ${OPENSSL_LIBRARIES})
target_include_directories(${PROJECT_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL OpenSSL::Crypto)
endif()