The package quickfix provides CMake targets: find_package(quickfix CONFIG REQUIRED) target_link_libraries(main PRIVATE quickfix)