The package spdlog provides CMake targets: find_package(spdlog CONFIG REQUIRED) target_link_libraries(main PRIVATE spdlog::spdlog) # Or use the header-only version find_package(spdlog CONFIG REQUIRED) target_link_libraries(main PRIVATE spdlog::spdlog_header_only)