vcpkg/ports/fontconfig/portfile.cmake
Stefano Sinigardi 5898891125 [openexr,openimageio,suitesparse,theia] updates for non-win32 (#6371)
* [openexr,openimageio,suitesparse,theia] updates for non-win32

* [theia] use only valid cmake symbols

* [suitesparse] Fix build

* [lapack] still not properly integrating with other ports

* [lapack] intercept cmake module calls and substitute them with our defs

* [suitesparse,clapack] fixes for proper integration

* [ceres,clapack] bump CONTROL

* [suitesparse] remove unnecessary defs

* [clapack] improve wrapper logic

* [WIN32] remove wrong symbol

* [clapack] fix wrapper integration

* [Accelerate] use best framework when available

* [clapack] separate config from wrapper

* [clapack] fix paths and filenames

* [mlpack,armadillo,clapack] improve library handling

* [mlpack] remove unnecessary cmake option

* [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32

* [openmvg] fix for case-sensitive filesystems

* [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps

* [sophus] Force rebuild

* [theia] fixes for linux, part1

* [io2d] remove broken sintax

* [fontconfig] bump version to remove CI cached failure

* [theia] fixes for linux, part2

* [theia] remove unnecessary empty folders and comments from portfile

* [theia] use correct build type removing forced vars in cmakelists.txt

* [openmvg] add missing suitesparse target detection

* [sophus] fix Suitesparse dependency

* [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems

* [suitesparse] fixes for case-sensitive filesystems

* [openmvg] use correct Eigen3 name for case-sensitive filesystems

* [sophus] trigger rebuild

* [shogun] use modern vcpkg style

* [shogun] add missing cmake system processor symbol
2019-05-31 15:48:17 -07:00

52 lines
1.9 KiB
CMake

include(vcpkg_common_functions)
set(FONTCONFIG_VERSION 2.12.4)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz"
FILENAME "fontconfig-${FONTCONFIG_VERSION}.tar.gz"
SHA512 2be3ee0e8e0e3b62571135a3cae06e456c289dd1ad40ef2a7c780406418ee5efce863a833eca5a8ef55bc737a0ea04ef562bba6fd27e174ae43e42131b52810d
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${FONTCONFIG_VERSION}
PATCHES fcobjtypehash.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DFC_INCLUDE_DIR=${CMAKE_CURRENT_LIST_DIR}/include
OPTIONS_DEBUG
-DFC_SKIP_TOOLS=ON
-DFC_SKIP_HEADERS=ON
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-fontconfig TARGET_PATH share/unofficial-fontconfig)
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
foreach(HEADER fcfreetype.h fontconfig.h)
file(READ ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} FC_HEADER)
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
string(REPLACE "#define FcPublic" "#define FcPublic __declspec(dllimport)" FC_HEADER "${FC_HEADER}")
else()
string(REPLACE "#define FcPublic" "#define FcPublic __attribute__((visibility(\"default\")))" FC_HEADER "${FC_HEADER}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} "${FC_HEADER}")
endforeach()
endif()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright)
vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig)