openmanus.cpp/CMakeLists.txt

44 lines
1.3 KiB
CMake
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

cmake_minimum_required(VERSION 3.10)
project(OpenManusCpp VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 查找OpenSSL库尝试查找3.0.0版本,但如果找不到,也接受其他版本
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
message(STATUS "OpenSSL include directory: ${OPENSSL_INCLUDE_DIR}")
message(STATUS "OpenSSL libraries: ${OPENSSL_LIBRARIES}")
include_directories(${OPENSSL_INCLUDE_DIR})
add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT)
else()
message(FATAL_ERROR "OpenSSL not found. Please install OpenSSL development libraries.")
endif()
# 添加MCP库
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mcp)
# 添加包含目录
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mcp/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mcp/common)
# 查找必要的包
find_package(Threads REQUIRED)
# 添加源文件
file(GLOB_RECURSE SOURCES
"src/*.cpp"
"src/*.cc"
)
# 添加可执行文件
add_executable(openmanus_cpp ${SOURCES} main.cpp)
# 链接库
target_link_libraries(openmanus_cpp PRIVATE Threads::Threads mcp ${OPENSSL_LIBRARIES})
# 安装目标
install(TARGETS openmanus_cpp DESTINATION bin)