aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/matplotplusplus
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/matplotplusplus
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/matplotplusplus')
-rw-r--r--vcpkg/ports/matplotplusplus/fix-dependencies.patch191
-rw-r--r--vcpkg/ports/matplotplusplus/portfile.cmake54
-rw-r--r--vcpkg/ports/matplotplusplus/usage4
-rw-r--r--vcpkg/ports/matplotplusplus/vcpkg.json67
4 files changed, 316 insertions, 0 deletions
diff --git a/vcpkg/ports/matplotplusplus/fix-dependencies.patch b/vcpkg/ports/matplotplusplus/fix-dependencies.patch
new file mode 100644
index 0000000..71fcad7
--- /dev/null
+++ b/vcpkg/ports/matplotplusplus/fix-dependencies.patch
@@ -0,0 +1,191 @@
+diff --git a/Matplot++Config.cmake.in b/Matplot++Config.cmake.in
+index 5c402ad..1601015 100644
+--- a/Matplot++Config.cmake.in
++++ b/Matplot++Config.cmake.in
+@@ -1,4 +1,5 @@
+ @PACKAGE_INIT@
++include(CMakeFindDependencyMacro)
+
+ # How this Matplot++ installation was built
+ set(MATPLOT_BUILT_SHARED "@MATPLOTPP_BUILD_SHARED_LIBS@")
+@@ -10,16 +11,44 @@ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL MATPLOT_BUILT_CXX_COMPILER_ID)
+ message(WARNING "This installation of Matplot++ was built with ${MATPLOT_BUILT_CXX_COMPILER_ID}.")
+ endif()
+
++if ("@MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND@")
++ find_dependency(glad CONFIG)
++ find_dependency(glfw3 CONFIG)
++endif()
++find_dependency(nodesoup CONFIG )
++if ("@WITH_JPEG@")
++find_dependency(JPEG)
++endif()
++
++if ("@WITH_TIFF@")
++find_dependency(TIFF)
++endif()
++
++if ("@WITH_ZLIB@")
++find_dependency(ZLIB)
++find_dependency(libpng CONFIG)
++endif()
++
++if ("@WITH_LAPACK@")
++find_dependency(LAPACK)
++endif()
++
++if ("@WITH_BLAS@")
++find_dependency(BLAS)
++endif()
++
++if ("@WITH_FFTW3@")
++find_dependency(FFTW3 CONFIG)
++endif()
++
++if ("@WITH_OPENCV@")
++find_dependency(OpenCV CONFIG)
++endif()
++
+ # Find dependencies
+ if(NOT ${MATPLOT_BUILT_SHARED})
+- include(CMakeFindDependencyMacro)
+ list(APPEND CMAKE_MODULE_PATH ${MATPLOT_CONFIG_INSTALL_DIR})
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
+- # OpenGL backend
+- if (@MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND@)
+- find_dependency(glad)
+- find_dependency(glfw3)
+- endif()
+ list(POP_BACK CMAKE_MODULE_PATH)
+ endif()
+
+diff --git a/source/3rd_party/CMakeLists.txt b/source/3rd_party/CMakeLists.txt
+index b5656e1..7c2d1f3 100644
+--- a/source/3rd_party/CMakeLists.txt
++++ b/source/3rd_party/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ #######################################################
+ ### NodeSoup ###
+ #######################################################
++if(0)
+ if(WITH_SYSTEM_NODESOUP)
+ find_path(NODESOUP_INCLUDE_DIR nodesoup.hpp REQUIRED)
+ find_library(NODESOUP_LIB nodesoup REQUIRED)
+@@ -46,7 +47,7 @@ if(MASTER_PROJECT AND NOT BUILD_SHARED_LIBS)
+ EXPORT Matplot++Targets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/Matplot++)
+ endif()
+-
++endif()
+
+ #######################################################
+ ### CImg ###
+@@ -69,57 +70,52 @@ find_package(PkgConfig)
+ # Lots of optional packages are not a good idea in general.
+ # It makes the library much less "packagable" (https://youtu.be/sBP17HQAQjk)
+ # and much more difficult to make sure it works on multiple OSs
+-find_package(JPEG)
+-if(JPEG_FOUND)
++if(WITH_JPEG)
++ find_package(JPEG REQUIRED)
+ target_compile_definitions(cimg INTERFACE cimg_use_jpeg)
+ target_link_libraries(cimg INTERFACE ${JPEG_LIBRARIES})
+ target_include_directories(cimg INTERFACE ${JPEG_INCLUDE_DIRS})
+ endif()
+
+-find_package(TIFF)
+-if(TIFF_FOUND)
++if(WITH_TIFF)
++ find_package(TIFF REQUIRED)
+ target_compile_definitions(cimg INTERFACE cimg_use_tiff)
+ target_link_libraries(cimg INTERFACE ${TIFF_LIBRARIES})
+ target_include_directories(cimg INTERFACE ${TIFF_INCLUDE_DIRS})
+ endif()
+
+-find_package(ZLIB)
+-if(ZLIB_FOUND)
+- find_package(PNG)
+- if (PNG_FOUND)
+- target_compile_definitions(cimg INTERFACE cimg_use_zlib cimg_use_png)
+- target_include_directories(cimg INTERFACE ${ZLIB_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS})
+- target_link_libraries(cimg INTERFACE ${ZLIB_LIBRARIES} ${PNG_LIBRARIES})
+- endif ()
++if(WITH_ZLIB)
++ find_package(ZLIB REQUIRED)
++ find_package(libpng CONFIG REQUIRED)
++ target_compile_definitions(cimg INTERFACE cimg_use_zlib cimg_use_png)
++ target_link_libraries(cimg INTERFACE ZLIB::ZLIB png)
+ endif()
+
+-find_package(LAPACK)
+-if(LAPACK_FOUND)
++if(WITH_LAPACK)
++ find_package(LAPACK REQUIRED)
+ target_compile_definitions(cimg INTERFACE cimg_use_lapack)
+ target_link_libraries(cimg INTERFACE ${LAPACK_LIBRARIES})
+ target_include_directories(cimg INTERFACE ${LAPACK_INCLUDE_DIRS})
+ endif()
+
+-find_package(BLAS)
+-if(BLAS_FOUND)
++if(WITH_BLAS)
++ find_package(BLAS REQUIRED)
+ target_compile_definitions(cimg INTERFACE cimg_use_blas)
+ target_link_libraries(cimg INTERFACE ${BLAS_LIBRARIES})
+ target_include_directories(cimg INTERFACE ${BLAS_INCLUDE_DIRS})
+ endif()
+
+-find_package(FFTW)
+-if(FFTW_FOUND)
++if(WITH_FFTW3)
++ find_package(FFTW3 CONFIG REQUIRED)
+ target_compile_definitions(cimg INTERFACE cimg_use_fftw3)
+- target_link_libraries(cimg INTERFACE ${FFTW_LIBRARIES})
+- target_include_directories(cimg INTERFACE ${FFTW_INCLUDE_DIRS})
++ target_link_libraries(cimg INTERFACE FFTW3::fftw3)
+ endif()
+
+ if (CMAKE_MODULE_PATH)
+- find_package(OpenCV QUIET)
+- if (OpenCV_FOUND)
++ if (WITH_OPENCV)
++ find_package(OpenCV CONFIG REQUIRED)
+ target_compile_definitions(cimg INTERFACE cimg_use_opencv)
+- target_link_libraries(cimg INTERFACE ${OpenCV_LIBRARIES})
+- target_include_directories(cimg INTERFACE ${OpenCV_INCLUDE_DIRS})
++ target_link_libraries(cimg INTERFACE opencv_core)
+ endif()
+ else()
+ message("No CMAKE_MODULE_PATH path for OpenCV configured")
+diff --git a/source/matplot/CMakeLists.txt b/source/matplot/CMakeLists.txt
+index a0428ac..b6abc8e 100644
+--- a/source/matplot/CMakeLists.txt
++++ b/source/matplot/CMakeLists.txt
+@@ -112,7 +112,8 @@ target_include_directories(matplot
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matplot/detail/exports.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/matplot/detail)
+
+ # Dependencies
+-target_link_libraries_system(matplot PRIVATE cimg nodesoup)
++find_package(nodesoup CONFIG REQUIRED)
++target_link_libraries_system(matplot PRIVATE cimg nodesoup::nodesoup)
+
+ # Required compiler features required
+ # https://cmake.org/cmake/help/v3.14/manual/cmake-compile-features.7.html#requiring-language-standards
+@@ -215,7 +216,7 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
+ find_package(OpenGL)
+
+ # https://github.com/Dav1dde/glad
+- find_package(glad CONFIG)
++ find_package(GLAD NAMES glad CONFIG REQUIRED)
+ if (NOT glad_FOUND)
+ find_package(GLAD QUIET)
+ endif()
+@@ -238,7 +239,7 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
+ endif()
+
+ # https://github.com/glfw/glfw
+- find_package(glfw3 QUIET)
++ find_package(GLFW3 NAMES glfw3 CONFIG REQUIRED)
+ if ((NOT glfw3_FOUND AND NOT GLFW3_FOUND) OR NOT TARGET glfw)
+ # Use CPM only if not found, to avoid ODR violations
+ # find_package(glfw3 REQUIRE) would suffice if it worked well
diff --git a/vcpkg/ports/matplotplusplus/portfile.cmake b/vcpkg/ports/matplotplusplus/portfile.cmake
new file mode 100644
index 0000000..dfd2f95
--- /dev/null
+++ b/vcpkg/ports/matplotplusplus/portfile.cmake
@@ -0,0 +1,54 @@
+message(STATUS " ${PORT}'s gnuplot backend currently requires Gnuplot 5.2.6+.
+ Windows users may get a pre-built binary installer from http://www.gnuplot.info/download.html.
+ Linux and MacOS users may install it from the system package manager.
+ Please visit https://alandefreitas.github.io/matplotplusplus/ for more information."
+)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO alandefreitas/matplotplusplus
+ REF "v${VERSION}"
+ SHA512 8ecb13fa206ff6762dec74c4de0778bf275e1ebf11ec1b48e8c0e544cf2990220e1be2b3bc9c658f06cb6714c9cc103fa81f10c079a32128218ebdaf265514d5
+ HEAD_REF master
+ PATCHES
+ fix-dependencies.patch
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ opengl MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND
+ jpeg WITH_JPEG
+ tiff WITH_TIFF
+ zlib WITH_ZLIB
+ lapack WITH_LAPACK
+ blas WITH_BLAS
+ fftw3 WITH_FFTW3
+ opencv WITH_OPENCV
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${FEATURE_OPTIONS}
+ -DMATPLOTPP_BUILD_EXAMPLES=OFF
+ -DMATPLOTPP_BUILD_TESTS=OFF
+ -DMATPLOTPP_BUILD_INSTALLER=ON
+ -DMATPLOTPP_BUILD_PACKAGE=OFF
+ -DMATPLOTPP_BUILD_WITH_PEDANTIC_WARNINGS=OFF
+ -DWITH_SYSTEM_CIMG=ON
+ -DMATPLOTPP_BUILD_HIGH_RESOLUTION_WORLD_MAP=${BUILD_WORLD_MAP}
+ -DMATPLOTPP_BUILD_WITH_SANITIZERS=OFF
+)
+
+vcpkg_cmake_install()
+
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME matplot++ CONFIG_PATH lib/cmake/Matplot++)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/matplotplusplus/")
diff --git a/vcpkg/ports/matplotplusplus/usage b/vcpkg/ports/matplotplusplus/usage
new file mode 100644
index 0000000..75a127b
--- /dev/null
+++ b/vcpkg/ports/matplotplusplus/usage
@@ -0,0 +1,4 @@
+The package matplotplusplus provides CMake targets:
+
+ find_package(Matplot++ CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Matplot++::cimg Matplot++::matplot)
diff --git a/vcpkg/ports/matplotplusplus/vcpkg.json b/vcpkg/ports/matplotplusplus/vcpkg.json
new file mode 100644
index 0000000..c60556e
--- /dev/null
+++ b/vcpkg/ports/matplotplusplus/vcpkg.json
@@ -0,0 +1,67 @@
+{
+ "name": "matplotplusplus",
+ "version": "1.2.1",
+ "description": "A C++ graphics library for data visualization",
+ "homepage": "https://alandefreitas.github.io/matplotplusplus/",
+ "license": "MIT",
+ "supports": "!uwp & !(windows & arm)",
+ "dependencies": [
+ "cimg",
+ "nodesoup",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "blas": {
+ "description": "BLAS support for Matplot++",
+ "dependencies": [
+ "blas"
+ ]
+ },
+ "fftw": {
+ "description": "fftw3 support for Matplot++",
+ "dependencies": [
+ "fftw3"
+ ]
+ },
+ "jpeg": {
+ "description": "JPEG support for Matplot++",
+ "dependencies": [
+ "libjpeg-turbo"
+ ]
+ },
+ "lapack": {
+ "description": "LAPACK support for Matplot++",
+ "dependencies": [
+ "lapack"
+ ]
+ },
+ "opencv": {
+ "description": "opencv support for Matplot++",
+ "dependencies": [
+ "opencv"
+ ]
+ },
+ "opengl": {
+ "description": "OpenGL backend for Matplot++",
+ "dependencies": [
+ "glad",
+ "glfw3",
+ "opengl"
+ ]
+ },
+ "zlib": {
+ "description": "ZLIB and libpng support for Matplot++",
+ "dependencies": [
+ "libpng",
+ "zlib"
+ ]
+ }
+ }
+}