# 修改后的CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(ServerProject) # 设置C++标准 set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) # 查找必要的包 find_package(OpenCV REQUIRED) find_package(PkgConfig REQUIRED) pkg_check_modules(ZMQ REQUIRED libzmq) find_package(nlohmann_json REQUIRED) # 设置源文件和头文件 file(GLOB SOURCES src/*.cpp) file(GLOB HEADERS src/*.h) # 添加可执行文件 add_executable(TEST001 ${SOURCES} ${HEADERS} ) # 链接库(添加pthread) target_link_libraries(TEST001 ${OpenCV_LIBS} ${ZMQ_LIBRARIES} nlohmann_json::nlohmann_json pthread )