The package chartdir provides CMake targets:

    find_package(chartdir CONFIG REQUIRED)
    target_link_libraries(main PRIVATE chartdir)