The package DuckDB provides CMake targets: find_package(DuckDB CONFIG REQUIRED) target_link_libraries(main PRIVATE $,duckdb,duckdb_static>)