cmake_minimum_required(VERSION 3.0) project(YourProjectName) set(CMAKE_CXX_STANDARD 11) find_package(Poco REQUIRED Foundation Util Net) add_executable(YourExecutableName YourSourceFiles.cpp) target_link_libraries(YourExecutableName Poco::Foundation Poco::Util Poco::Net) 将"YourProjectName"替换为你...
The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems. - poco/cmake/FindAvahi.cmake at main · pocoproject/poco
一个好消息是 CMake 官方为我们写好了很多 Find file,在CMake Documentation这一页面可以看到,OpenGL,OpenMP,SDL 这些知名的库官方都为我们写好了 Find 脚本,因此直接调用 find_package 命令即可。但由于库的安装位置并不是固定的,这些 Find 脚本不一定能找到库,此时根据 CMake 报错的提示设置对应变量即可,通常是...
find_package(Poco REQUIRED COMPONENTS Net Util) add_executable(MyEXE)target_source(MyEXE PRIVATE "main.cpp")target_link_library(MyEXE PRIVATE Poco::Net Poco::Util)target_compile_definition(MyEXE PRIVATE std_cxx_14) Target 和围绕 Target 的配置 一个C/C...
/usr/lib/cmake/Poco/PocoRedisConfig.cmake /usr/lib/x86_64-linux-gnu/cmake/Hiredis/HiredisConfig.cmake 1. 2. 3. 4. 5. 6. 7. 可以发现,实际上也是有的,只不过所在位置为/urs/local/x86_64-linux-gnu目录下,而这个目录估计不在Cmake的find_package的查找路径下。因此,针对hiredis这个配置,除了前...
检查CMakeLists.txt文件:在项目的CMakeLists.txt文件中,确保已正确设置了FindPOCO脚本的路径。可以使用以下命令来查找FindPOCO脚本的位置: 检查CMakeLists.txt文件:在项目的CMakeLists.txt文件中,确保已正确设置了FindPOCO脚本的路径。可以使用以下命令来查找FindPOCO脚本的位置: ...
set(CMAKE_INCLUDE_CURRENT_DIR ON) # Set the output folder where your program will be created set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) # Find Poco package 1.8.1 find_package(Poco ...
find_package(Poco REQUIRED COMPONENTS Net Util) add_executable(MyEXE) target_source(MyEXE PRIVATE "main.cpp") target_link_library(MyEXE PRIVATE Poco::Net Poco::Util) target_compile_definition(MyEXE PRIVATE std_cxx_14) Target 和围绕 Target 的配置 ...
# set(ENV{Poco_DIR} path/to/poco/sdk) # find_package(Poco REQUIRED OSP Data Crypto) # # On completion, the script defines the following variables: # # - Compound variables: # Poco_FOUND # - true if all requested components were found. # Poco_LIBRARIES # - contains ...
(EXECUTABLE_OUTPUT_PATH${CMAKE_BINARY_DIR})set(LIBRARY_OUTPUT_PATH${CMAKE_BINARY_DIR})# Find Poco package 1.8.1find_package(Poco REQUIRED COMPONENTS Foundation Util Net XML JSON)# no Poco_INCLUDE_DIRS, we have to set by handif(MSVC)# WIN32SET(Poco_INCLUDE_DIRS"C:/Program Files/Poco/...