[matplotplusplus,nodesoup] update to v1.2.0,add new port (#31796)

* [matplotplusplus] update to 2023-02-17

* [matplotplusplus] fix installation of matplot_opengl

* [matplotplusplus] remove the opengl patch as it merged upstream

* [matplotplusplus] try to fix filesystem for osx

* fix deps

* fix deps

* fix deps

* [matplotplusplus]: update to v1.2.0

* fix deps

* disable sanitizer

* fix opengl feature

* fix-dependencies

* [nodesoup]: add new port

* nodesoup

* fix deps

* fix nodesoup namespace

* fix deps

* fix deps

* fix

* fix

* fix deps

* fix deps

* fix deps

* fix deps

---------

Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
This commit is contained in:
Jia Yue Hua
2023-06-15 03:50:43 +08:00
committed by GitHub
parent 2774d2bd27
commit 382746822d
12 changed files with 251 additions and 33 deletions

View File

@@ -1,8 +1,81 @@
diff --git a/Matplot++Config.cmake.in b/Matplot++Config.cmake.in
index fc9ceca..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,12 +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}")
- find_dependency(Filesystem COMPONENTS Experimental Final)
list(POP_BACK CMAKE_MODULE_PATH)
endif()
diff --git a/source/3rd_party/CMakeLists.txt b/source/3rd_party/CMakeLists.txt
index ab58bbd..f9fed7e 100644
index b5656e1..7ff4046 100644
--- a/source/3rd_party/CMakeLists.txt
+++ b/source/3rd_party/CMakeLists.txt
@@ -67,57 +67,69 @@ find_package(PkgConfig)
@@ -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)
@@ -47,6 +48,7 @@ if(MASTER_PROJECT AND NOT BUILD_SHARED_LIBS)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/Matplot++)
endif()
+endif()
#######################################################
### CImg ###
@@ -69,57 +71,69 @@ 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
@@ -94,3 +167,66 @@ index ab58bbd..f9fed7e 100644
endif()
else()
message("No CMAKE_MODULE_PATH path for OpenCV configured")
diff --git a/source/matplot/CMakeLists.txt b/source/matplot/CMakeLists.txt
index fe9ad53..b06ed7e 100644
--- a/source/matplot/CMakeLists.txt
+++ b/source/matplot/CMakeLists.txt
@@ -1,5 +1,4 @@
if(NOT MINGW)
-find_package(Filesystem REQUIRED COMPONENTS Experimental Final)
endif()
#######################################################
@@ -102,12 +101,13 @@ target_include_directories(matplot
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
# Dependencies
+find_package(nodesoup CONFIG REQUIRED)
if(NOT MINGW)
-target_link_libraries_system(matplot
- PRIVATE cimg nodesoup std::filesystem)
+target_link_libraries(matplot
+ PRIVATE cimg nodesoup::nodesoup)
else()
-target_link_libraries_system(matplot
- PRIVATE cimg nodesoup)
+target_link_libraries(matplot
+ PRIVATE cimg nodesoup::nodesoup)
endif()
# Required compiler features required
@@ -134,7 +134,6 @@ maybe_target_pedantic_warnings(matplot)
# Use experimental filesystem if std::filesystem is not available yet
if(NOT MINGW)
if (CXX_FILESYSTEM_IS_EXPERIMENTAL)
- target_compile_definitions(matplot PRIVATE CXX_FILESYSTEM_IS_EXPERIMENTAL)
endif()
endif()
# Some hack to not depend on FILE* internals
@@ -217,7 +216,7 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
find_package(OpenGL REQUIRED)
# https://github.com/Dav1dde/glad
- find_package(GLAD QUIET)
+ find_package(GLAD name glad CONFIG REQUIRED)
if (NOT GLAD_FOUND AND NOT TARGET glad)
# Use CPM only if not found, to avoid ODR violations
# find_package(GLAD REQUIRE) would suffice if it worked well
@@ -233,7 +232,7 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
endif ()
# https://github.com/glfw/glfw
- find_package(glfw3 QUIET)
+ find_package(GLFW3 name glfw3 CONFIG REQUIRED)
if (NOT GLFW3_FOUND AND NOT TARGET glfw)
# Use CPM only if not found, to avoid ODR violations
# find_package(glfw3 REQUIRE) would suffice if it worked well
@@ -247,7 +246,7 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
backend/opengl.h
backend/opengl.cpp
)
- target_link_libraries(matplot_opengl PUBLIC matplot glad glfw ${CMAKE_DL_LIBS})
+ target_link_libraries(matplot_opengl PUBLIC matplot glad::glad glfw ${CMAKE_DL_LIBS})
list(APPEND TARGETS matplot_opengl)
endif()

View File

@@ -1,15 +0,0 @@
diff --git a/source/3rd_party/CMakeLists.txt b/source/3rd_party/CMakeLists.txt
index bef0c08..e7521a7 100644
--- a/source/3rd_party/CMakeLists.txt
+++ b/source/3rd_party/CMakeLists.txt
@@ -41,7 +41,9 @@ endif()
if(MASTER_PROJECT AND NOT BUILD_SHARED_LIBS)
install(TARGETS nodesoup
EXPORT Matplot++Targets
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/Matplot++)
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
endif()

View File

@@ -9,18 +9,17 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO alandefreitas/matplotplusplus
REF 36d8dc6c3b94b7a71c4f129763f2c6ad8fc0b54a
SHA512 ac8902e953a2a9f6bd62e14e2eb0bd42e407bae6c0b2921ad16ce547e4921ba2c8d8a9cc68e75831676dce3cd89cdf8294862710e838510b68e20f8a6cdf806f
REF "v${VERSION}"
SHA512 9193381fd9d4925259f28a03da33231b3da1273237e7510b93da1ca076610455746feb4ea0d8aa9a4a9e46a5f5f344fc1322f7ffc57963837dbe8b0be0b811ac
HEAD_REF master
PATCHES
install-3rd-libraries.patch # Remove this patch when nodesoup is added in vcpkg
fix-dependencies.patch
fix-dependencies.patch
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
opengl BUILD_EXPERIMENTAL_OPENGL_BACKEND
opengl MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND
jpeg WITH_JPEG
tiff WITH_TIFF
zlib WITH_ZLIB
@@ -33,14 +32,14 @@ vcpkg_check_features(
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DCPM_USE_LOCAL_PACKAGES=ON
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTS=OFF
-DBUILD_INSTALLER=ON
-DBUILD_PACKAGE=OFF
-DBUILD_WITH_PEDANTIC_WARNINGS=OFF
-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
-DBUILD_HIGH_RESOLUTION_WORLD_MAP=${BUILD_WORLD_MAP}
-DMATPLOTPP_BUILD_HIGH_RESOLUTION_WORLD_MAP=${BUILD_WORLD_MAP}
-DMATPLOTPP_BUILD_WITH_SANITIZERS=OFF
)
vcpkg_cmake_install()
@@ -52,3 +51,4 @@ 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/")

View File

@@ -0,0 +1,4 @@
The package matplotplusplus provides CMake targets:
find_package(Matplot++ CONFIG REQUIRED)
target_link_libraries(main PRIVATE Matplot++::cimg Matplot++::matplot)

View File

@@ -1,13 +1,13 @@
{
"name": "matplotplusplus",
"version-date": "2021-04-11",
"port-version": 6,
"version": "1.2.0",
"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

View File

@@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be6aa9d..26e59f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,7 +34,7 @@ install(
ARCHIVE DESTINATION lib
INCLUDES
DESTINATION include
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nodesoup)
+ PUBLIC_HEADER DESTINATION include)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dbd43b9..44164c9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,7 +5,9 @@ add_library(nodesoup::nodesoup ALIAS nodesoup)
target_include_directories(
nodesoup
PUBLIC $<BUILD_INTERFACE:${nodesoup_SOURCE_DIR}/include>
- PRIVATE $<BUILD_INTERFACE:${nodesoup_SOURCE_DIR}/src>)
+ $<INSTALL_INTERFACE:include>
+ PRIVATE $<BUILD_INTERFACE:${nodesoup_SOURCE_DIR}/src>
+)
target_compile_features(nodesoup PUBLIC cxx_std_14)

View File

@@ -0,0 +1,27 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO olvb/nodesoup
REF 3158ad082bb0cd1abee75418b12b35522dbca74f
SHA512 be98cd5a1106fb1b6e6cb6b880229f590c2d4c4cc176dcceb2e2226ff3f2344ccb4510fb3a0911e9329701af50f076ee2efb9a3afc9e985b4d9c3fb92c12102d
HEAD_REF master
PATCHES
fix-cmakelists.patch
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_DEMO=OFF
)
vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_cmake_config_fixup(PACKAGE_NAME nodesoup CONFIG_PATH lib/cmake/nodesoup)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/nodesoup/" RENAME copyright)
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/nodesoup/")

4
ports/nodesoup/usage Normal file
View File

@@ -0,0 +1,4 @@
The package nodesoup provides CMake targets:
find_package(nodesoup CONFIG REQUIRED)
target_link_libraries(main PRIVATE nodesoup::nodesoup)

16
ports/nodesoup/vcpkg.json Normal file
View File

@@ -0,0 +1,16 @@
{
"name": "nodesoup",
"version-date": "2023-06-12",
"description": "Force-directed graph layout with Fruchterman-Reingold",
"license": "Unlicense",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@@ -5177,8 +5177,8 @@
"port-version": 2
},
"matplotplusplus": {
"baseline": "2021-04-11",
"port-version": 6
"baseline": "1.2.0",
"port-version": 0
},
"matroska": {
"baseline": "1.7.1",
@@ -5692,6 +5692,10 @@
"baseline": "1.0.0",
"port-version": 1
},
"nodesoup": {
"baseline": "2023-06-12",
"port-version": 0
},
"nonius": {
"baseline": "2019-04-20",
"port-version": 4

View File

@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4e65bffccaa1a5061002c38b7bdf6a0e464caf39",
"version": "1.2.0",
"port-version": 0
},
{
"git-tree": "8554ae7ec807245bdcd27b44ddebd39608edfe53",
"version-date": "2021-04-11",

View File

@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "43d30f8e5e0cd4b45a590027d0c9ea5036f0ba40",
"version-date": "2023-06-12",
"port-version": 0
}
]
}