vcpkg/ports/graphviz/fix-dependencies.patch
2023-09-18 09:28:07 -07:00

95 lines
2.8 KiB
Diff

diff --git a/cmake/FindCAIRO.cmake b/cmake/FindCAIRO.cmake
--- a/cmake/FindCAIRO.cmake
+++ b/cmake/FindCAIRO.cmake
@@ -1,4 +1,4 @@
include(FindPackageHandleStandardArgs)
-if(WIN32)
+if(0)
find_path(
diff --git a/cmake/FindGD.cmake b/cmake/FindGD.cmake
--- a/cmake/FindGD.cmake
+++ b/cmake/FindGD.cmake
@@ -1,3 +1,10 @@
+find_package(PkgConfig)
+pkg_check_modules(GD gdlib IMPORTED_TARGET)
+set(GD_LIBRARIES PkgConfig::GD)
+foreach(item IN ITEMS FONTCONFIG FREETYPE GIF JPEG PNG)
+ set(HAVE_GD_${item} 1)
+endforeach()
+return()
find_path(GD_INCLUDE_DIR gd.h)
find_library(GD_LIBRARY NAMES gd libgd)
find_program(GD_RUNTIME_LIBRARY libgd.dll)
diff --git a/cmake/FindLTDL.cmake b/cmake/FindLTDL.cmake
--- a/cmake/FindLTDL.cmake
+++ b/cmake/FindLTDL.cmake
@@ -15,6 +15,9 @@ endif()
mark_as_advanced(LTDL_INCLUDE_DIR LTDL_LIBRARY)
set(LTDL_INCLUDE_DIRS ${LTDL_INCLUDE_DIR})
-if(NOT WIN32 OR MINGW)
+if(1)
set(LTDL_LIBRARIES ${LTDL_LIBRARY})
endif()
+if(CMAKE_DL_LIBS AND NOT BUILD_SHARED_LIBS)
+ set(LTDL_LIBRARIES "${LTDL_LIBRARIES};${CMAKE_DL_LIBS}")
+endif()
diff --git a/cmake/FindPANGOCAIRO.cmake b/cmake/FindPANGOCAIRO.cmake
--- a/cmake/FindPANGOCAIRO.cmake
+++ b/cmake/FindPANGOCAIRO.cmake
@@ -1,6 +1,6 @@
include(FindPackageHandleStandardArgs)
-if(WIN32)
+if(0)
find_path(PANGOCAIRO_INCLUDE_DIR pango/pangocairo.h PATH_SUFFIXES pango-1.0)
find_path(GLIB_INCLUDE_DIR glib.h PATH_SUFFIXES glib-2.0)
find_path(GLIBCONFIG_INCLUDE_DIR glibconfig.h
@@ -78,7 +78,8 @@ if(WIN32)
)
else()
find_package(PkgConfig)
- pkg_check_modules(PANGOCAIRO pangocairo)
+ pkg_check_modules(PANGOCAIRO pangocairo IMPORTED_TARGET)
+ set(PANGOCAIRO_LINK_LIBRARIES PkgConfig::PANGOCAIRO) # https://gitlab.kitware.com/cmake/cmake/-/issues/16154
find_package_handle_standard_args(PANGOCAIRO DEFAULT_MSG
PANGOCAIRO_INCLUDE_DIRS
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -114,7 +114,6 @@ endif()
find_package(GD)
find_package(GS)
-find_package(GTS)
if(enable_ltdl)
find_package(LTDL)
@@ -126,9 +125,10 @@ endif()
find_package(PANGOCAIRO)
find_package(PkgConfig)
if(PkgConfig_FOUND)
+ pkg_check_modules(GTS gts REQUIRED)
pkg_check_modules(POPPLER poppler-glib)
- pkg_check_modules(RSVG librsvg-2.0)
- pkg_check_modules(WEBP libwebp)
+ pkg_check_modules(librsvg REQUIRED IMPORTED_TARGET librsvg)
+ # pkg_check_modules(WEBP libwebp)
else()
set(POPPLER_FOUND 0)
set(RSVG_FOUND 0)
diff --git a/cmd/dot/CMakeLists.txt b/cmd/dot/CMakeLists.txt
--- a/cmd/dot/CMakeLists.txt
+++ b/cmd/dot/CMakeLists.txt
@@ -88,7 +88,7 @@ endif()
if(PANGOCAIRO_FOUND)
target_link_libraries(dot_builtins PRIVATE gvplugin_pango)
if(PkgConfig_FOUND)
- pkg_check_modules(WEBP libwebp)
+ # pkg_check_modules(WEBP libwebp)
if(WEBP_FOUND)
target_link_libraries(dot_builtins PRIVATE gvplugin_webp)
endif()