I\'m a new guy to c++ and cmake here. I decided to test out cLion and cMake. I\'m trying to write a simple email client for the command line. Other sources told me that the
My CMakeLists.txt
for using Poco looks like this:
cmake_minimum_required(VERSION 3.10.0)
project(MyProject VERSION 0.1.0)
find_package(Poco REQUIRED COMPONENTS Foundation Net Zip )
add_executable(my_exe main.cpp)
target_link_libraries(my_exe PUBLIC Poco::Foundation Poco::Zip Poco::Net)
This configuration automatically add the needed include directories and libraries.
The Foundation
component is mandatory, it seems it provides the include directories.
Don't add Poco
to target_link_libraries
, the linker will then look for a 'Poco' library.