soci provides CMake targets: find_package(SOCI CONFIG REQUIRED) # Using core (loading backends at runtime) target_link_libraries(main PRIVATE $,SOCI::soci_core,SOCI::soci_core_static>)