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