aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-07 22:36:25 +0200
committerdan-shaw <51385773+dan-shaw@users.noreply.github.com>2019-06-07 13:36:24 -0700
commit388d219f256b75452c088b4cc2e16fd38f7f6995 (patch)
tree8d4d97b4a150fa7d17141790c2f71f8aa04e9ad6
parent1f3964f18b18bbffbf7064fe3ddc6d6f420d804b (diff)
downloadvcpkg-388d219f256b75452c088b4cc2e16fd38f7f6995.tar.gz
vcpkg-388d219f256b75452c088b4cc2e16fd38f7f6995.zip
Fix freetype cmake config files (#6754)
The way of including freetype headers is by using #include <ft2build.h> #include FT_FREETYPE_H along with $root/include/freetype which has $root/include/freetype/ft2build.h and then the rest of the headers under $root/include/freetype/freetype2/*.h. The portfile.cmake moves the headers one directory up into $root/include so that there's $root/include/ft2build.h and the rest of the headers under $root/include/freetype/. This in turn means that the above way of including header files requires $root/include to be in the include search path. That's not the case by default and the generated freetype-config.cmake also doesn't include that. Therefore the freetype config approach results in failing builds when applications wants to use it. This is easy to reproduce using find_package(Freetype CONFIG REQUIRED) ... target_link_libraries(foo PRIVATE freetype) As a remedy, this patch fixes the freetype-config.cmake file to add $root/include in the include search path.
-rw-r--r--ports/freetype/CONTROL2
-rw-r--r--ports/freetype/portfile.cmake2
2 files changed, 2 insertions, 2 deletions
diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL
index 7e18d1a7c..15c9caffd 100644
--- a/ports/freetype/CONTROL
+++ b/ports/freetype/CONTROL
@@ -1,4 +1,4 @@
Source: freetype
-Version: 2.9.1-1
+Version: 2.9.1-2
Build-Depends: zlib, bzip2, libpng
Description: A library to render fonts.
diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake
index 73cb6b317..654cff2b9 100644
--- a/ports/freetype/portfile.cmake
+++ b/ports/freetype/portfile.cmake
@@ -70,7 +70,7 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
else() #if(VCPKG_BUILD_TYPE STREQUAL "release")
file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE)
endif()
-string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}")
+string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include;\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)