The package matplotplusplus provides CMake targets: find_package(Matplot++ CONFIG REQUIRED) target_link_libraries(main PRIVATE Matplot++::cimg Matplot++::matplot)