aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-01-18 10:45:34 -0800
committerRobert Schumacher <roschuma@microsoft.com>2018-01-18 10:57:30 -0800
commit353d635b97df5c80f270ec200d16a6664c4d6ab6 (patch)
tree6aaacfe77b9c96638ac143dd8aeb377a133e71cc
parentd35866018a43c108b2fa04587917c8d53740d4e6 (diff)
downloadvcpkg-353d635b97df5c80f270ec200d16a6664c4d6ab6.tar.gz
vcpkg-353d635b97df5c80f270ec200d16a6664c4d6ab6.zip
[freetype][harfbuzz] Fix static freetype dependency.
-rw-r--r--ports/freetype/usage3
-rw-r--r--ports/harfbuzz/find-package-freetype.patch13
-rw-r--r--ports/harfbuzz/portfile.cmake4
-rw-r--r--scripts/buildsystems/vcpkg.cmake11
4 files changed, 28 insertions, 3 deletions
diff --git a/ports/freetype/usage b/ports/freetype/usage
index 3b42b86e4..458a9dd88 100644
--- a/ports/freetype/usage
+++ b/ports/freetype/usage
@@ -1,5 +1,4 @@
The package freetype is compatible with built-in CMake targets:
find_package(Freetype REQUIRED)
- target_link_libraries(main PRIVATE ${FREETYPE_LIBRARIES})
- target_include_directories(main PRIVATE ${FREETYPE_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE Freetype::Freetype)
diff --git a/ports/harfbuzz/find-package-freetype.patch b/ports/harfbuzz/find-package-freetype.patch
new file mode 100644
index 000000000..a556d1377
--- /dev/null
+++ b/ports/harfbuzz/find-package-freetype.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 24ccb6f..21df836 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -201,7 +201,7 @@ set(project_headers
+ ## Find and include needed header folders and libraries
+ if (HB_HAVE_FREETYPE)
+
+- include(FindFreetype)
++ find_package(Freetype REQUIRED)
+ if (NOT FREETYPE_FOUND)
+ message(FATAL_ERROR "HB_HAVE_FREETYPE was set, but we failed to find it. Maybe add a CMAKE_PREFIX_PATH= to your Freetype2 install prefix")
+ endif()
diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake
index 6e58997c1..c4bdbca22 100644
--- a/ports/harfbuzz/portfile.cmake
+++ b/ports/harfbuzz/portfile.cmake
@@ -10,7 +10,9 @@ vcpkg_from_github(
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
- PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-uwp-build.patch"
+ PATCHES
+ "${CMAKE_CURRENT_LIST_DIR}/0001-fix-uwp-build.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/find-package-freetype.patch"
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake
index f157d3236..8ee21d411 100644
--- a/scripts/buildsystems/vcpkg.cmake
+++ b/scripts/buildsystems/vcpkg.cmake
@@ -206,6 +206,17 @@ macro(find_package name)
if(TIFF_LIBRARIES)
list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES})
endif()
+ elseif("${name}" STREQUAL "Freetype")
+ _find_package(${ARGV})
+ find_package(ZLIB)
+ find_package(PNG)
+ find_package(BZip2)
+ if(TARGET Freetype::Freetype)
+ set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2 PNG::PNG ZLIB::ZLIB)
+ endif()
+ if(FREETYPE_LIBRARIES)
+ list(APPEND FREETYPE_LIBRARIES ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES})
+ endif()
elseif("${name}" STREQUAL "tinyxml2")
_find_package(${ARGV})
if(TARGET tinyxml2_static AND NOT TARGET tinyxml2)