libbson provides CMake targets: find_package(bson-1.0 CONFIG REQUIRED) target_link_libraries(main PRIVATE $,mongo::bson_static,mongo::bson_shared>)