Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expat] Update the version to 2.2.9 (add support for uwp) #9146

Merged
merged 33 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a8f32c5
[expat] Update the version to 2.2.9(support uwp)
Nov 29, 2019
4be1814
[readosm] Fix expat.lib cannot be found
Dec 3, 2019
5d5893e
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Dec 27, 2019
18737a7
Remove expat:arm-uwp and expat:x64-uwp from fail list in ci.baseline.txt
Dec 27, 2019
afbe324
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Apr 16, 2020
ed54804
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Jun 9, 2020
de21165
[apr-util,io2d,skia] Fix expat cannot be found and also update expat
Jun 10, 2020
5e57c7e
[many ports] Add supports and fix the regressions
Jun 29, 2020
99fd507
Fix new regressions
Jun 30, 2020
058da90
Fix typo
Jun 30, 2020
4f91dd9
[io2d] Update expat patch
Jun 30, 2020
e411e1d
[io2d,libkml,skia] Fix expat cannot find and also fix typo
Jul 1, 2020
95e37c9
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Jul 1, 2020
d5c015a
[expat] Remove usage
Jul 1, 2020
b4c22af
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Jul 2, 2020
1f2dda0
[libkml,vtk] Update expat patch and fix static build
Jul 2, 2020
7aa4f9d
[wxwidgets] Fix static build caused by expat cannot found
Jul 2, 2020
3ccc246
Update as review suggestion
Jul 6, 2020
feacf48
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Jul 7, 2020
f9aaa23
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Jul 10, 2020
38bf44f
Add Port-Version
Jul 22, 2020
44572d6
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Jul 24, 2020
b399459
Remove evpp:x64-osx=fail from ci.baseline.txt
Jul 24, 2020
c5833c8
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Aug 3, 2020
90749f8
[wxwidgest] Remove unnecessary spaces
Aug 3, 2020
ea98684
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Aug 6, 2020
8d1c723
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Aug 7, 2020
f6fdd81
[itk] Fix expat cannot be found
Aug 7, 2020
dccc91e
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Aug 12, 2020
82e0a92
fix cmake test port
strega-nil Aug 13, 2020
7636224
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
Aug 17, 2020
c6ebfe9
[wxwidgets] Update Port-Version
Aug 17, 2020
fcde474
Merge branch 'dev/NancyLi/3174-update-expat' of https://github.com/Na…
Aug 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ports/apr-util/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: apr-util
Version: 1.6.1-1
Version: 1.6.1
Port-Version: 2
Homepage: https://apr.apache.org/
Description: Apache Portable Runtime (APR) project mission is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementation
Build-Depends: expat, apr, openssl
240 changes: 124 additions & 116 deletions ports/apr-util/use-vcpkg-expat.patch
Original file line number Diff line number Diff line change
@@ -1,116 +1,124 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ae90b19..b0e86e2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,8 +29,9 @@ OPTION(APR_HAS_LDAP "LDAP support" ON)
OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON)
OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF)
OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF)
-SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR include files")
-SET(APR_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib" CACHE STRING "APR library to link with")
+
+find_path(APR_INCLUDE_DIR apr.h)
+find_library(APR_LIBRARIES NAMES libapr-1 apr-1)

IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h")
MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.")
@@ -65,8 +66,8 @@ IF(NOT EXPAT_FOUND)
MESSAGE(FATAL_ERROR "Expat is required, and it wasn't found!")
ENDIF()

-SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS})
-SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES})
+find_path(XMLLIB_INCLUDE_DIR expat.h)
+find_library(XMLLIB_LIBRARIES NAMES expat)

SET(LDAP_LIBRARIES)
IF(APR_HAS_LDAP)
@@ -229,17 +230,21 @@ SET(dbd_drivers)
# Note: The WINNT definition on some targets is used only by libaprutil.rc.

# libaprutil-1 is shared, aprutil-1 is static
+if(BUILD_SHARED_LIBS)
ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc)
SET(install_targets ${install_targets} libaprutil-1)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb)
TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES})
-SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT")
+SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_IMPORT;XML_STATIC;WINNT")

+else(BUILD_SHARED_LIBS)
ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
SET(install_targets ${install_targets} aprutil-1)
TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES})
SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC")
-
+endif(BUILD_SHARED_LIBS)
+
+if(BUILD_SHARED_LIBS)
IF(APU_HAVE_CRYPTO)
IF(NOT OPENSSL_FOUND)
MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build")
@@ -249,7 +254,7 @@ IF(APU_HAVE_CRYPTO)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb)
SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}")
SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_DEFINITIONS "WINNT")
- SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_crypto_openssl")
+ SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_crypto_openssl")
TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF()

@@ -260,8 +265,8 @@ IF(APU_HAVE_ODBC)
SET(dbd_drivers ${dbd_drivers} odbc)
TARGET_LINK_LIBRARIES(apr_dbd_odbc-1 libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32)
SET_PROPERTY(TARGET apr_dbd_odbc-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver)
- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD;WINNT")
- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_dbd_odbc")
+ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_IMPORT;APR_DECLARE_IMPORT;APU_DSO_MODULE_BUILD;WINNT")
+ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_dbd_odbc")
ENDIF()

IF(APR_HAS_LDAP)
@@ -271,11 +276,12 @@ IF(APR_HAS_LDAP)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb)
TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1 ${APR_LIBRARIES} ${LDAP_LIBRARIES})
SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_DEFINITIONS "WINNT")
- SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_ldap")
+ SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_ldap")
SET(apr_ldap_libraries apr_ldap-1)
ELSE()
SET(apr_ldap_libraries)
ENDIF()
+endif(BUILD_SHARED_LIBS)

IF(APR_BUILD_TESTAPR)
ENABLE_TESTING()
@@ -289,7 +295,7 @@ IF(APR_BUILD_TESTAPR)
${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml
${PROJECT_BINARY_DIR}/data/billion-laughs.xml)

- IF(TEST_STATIC_LIBS)
+ IF(NOT BUILD_SHARED_LIBS)
SET(whichapr aprutil-1)
SET(apiflag "-DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC")
ELSE()
@@ -325,13 +331,15 @@ INSTALL(TARGETS ${install_targets}
ARCHIVE DESTINATION lib
)

-IF(INSTALL_PDB)
- INSTALL(FILES ${install_bin_pdb}
- DESTINATION bin
- CONFIGURATIONS RelWithDebInfo Debug)
-ENDIF()
+#IF(INSTALL_PDB)
+# INSTALL(FILES ${install_bin_pdb}
+# DESTINATION bin
+# CONFIGURATIONS RelWithDebInfo Debug)
+#ENDIF()

-INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include)
+if(NOT DISABLE_INSTALL_HEADERS)
+ INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include)
+endif()

STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
MESSAGE(STATUS "")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ae90b1..71a50b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,16 +21,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

FIND_PACKAGE(OpenSSL)

-FIND_PACKAGE(expat)
-
OPTION(APU_HAVE_CRYPTO "Crypto support" OFF)
OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON)
OPTION(APR_HAS_LDAP "LDAP support" ON)
OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON)
OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF)
OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF)
-SET(APR_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR include files")
-SET(APR_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/libapr-1.lib" CACHE STRING "APR library to link with")
+find_path(APR_INCLUDE_DIR apr.h)
+find_library(APR_LIBRARIES NAMES libapr-1 apr-1)

IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h")
MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.")
@@ -61,13 +59,13 @@ IF(APR_HAS_LDAP)
SET(apr_has_ldap_10 1)
ENDIF()

-IF(NOT EXPAT_FOUND)
+find_path(XMLLIB_INCLUDE_DIR expat.h)
+find_library(XMLLIB_LIBRARIES NAMES libexpat libexpatMD)
+
+IF(NOT XMLLIB_LIBRARIES)
MESSAGE(FATAL_ERROR "Expat is required, and it wasn't found!")
ENDIF()

-SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS})
-SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES})
-
SET(LDAP_LIBRARIES)
IF(APR_HAS_LDAP)
SET(LDAP_LIBRARIES wldap32)
@@ -229,17 +227,21 @@ SET(dbd_drivers)
# Note: The WINNT definition on some targets is used only by libaprutil.rc.

# libaprutil-1 is shared, aprutil-1 is static
+if(BUILD_SHARED_LIBS)
ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc)
SET(install_targets ${install_targets} libaprutil-1)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb)
TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES})
-SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT")
+SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_IMPORT;XML_STATIC;WINNT")

+else(BUILD_SHARED_LIBS)
ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
SET(install_targets ${install_targets} aprutil-1)
TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES})
SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC")
+endif(BUILD_SHARED_LIBS)

+if(BUILD_SHARED_LIBS)
IF(APU_HAVE_CRYPTO)
IF(NOT OPENSSL_FOUND)
MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build")
@@ -249,7 +251,7 @@ IF(APU_HAVE_CRYPTO)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb)
SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}")
SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_DEFINITIONS "WINNT")
- SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_crypto_openssl")
+ SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_crypto_openssl")
TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF()

@@ -260,8 +262,8 @@ IF(APU_HAVE_ODBC)
SET(dbd_drivers ${dbd_drivers} odbc)
TARGET_LINK_LIBRARIES(apr_dbd_odbc-1 libaprutil-1 ${APR_LIBRARIES} odbc32 odbccp32)
SET_PROPERTY(TARGET apr_dbd_odbc-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver)
- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD;WINNT")
- SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_dbd_odbc")
+ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APU_DECLARE_IMPORT;APR_DECLARE_IMPORT;APU_DSO_MODULE_BUILD;WINNT")
+ SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_dbd_odbc")
ENDIF()

IF(APR_HAS_LDAP)
@@ -271,11 +273,12 @@ IF(APR_HAS_LDAP)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb)
TARGET_LINK_LIBRARIES(apr_ldap-1 libaprutil-1 ${APR_LIBRARIES} ${LDAP_LIBRARIES})
SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_DEFINITIONS "WINNT")
- SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_ldap")
+ SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_IMPORT -DAPU_DECLARE_IMPORT -DDLL_NAME=apr_ldap")
SET(apr_ldap_libraries apr_ldap-1)
ELSE()
SET(apr_ldap_libraries)
ENDIF()
+endif(BUILD_SHARED_LIBS)

IF(APR_BUILD_TESTAPR)
ENABLE_TESTING()
@@ -289,7 +292,7 @@ IF(APR_BUILD_TESTAPR)
${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml
${PROJECT_BINARY_DIR}/data/billion-laughs.xml)

- IF(TEST_STATIC_LIBS)
+ IF(NOT BUILD_SHARED_LIBS)
SET(whichapr aprutil-1)
SET(apiflag "-DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC")
ELSE()
@@ -325,13 +328,9 @@ INSTALL(TARGETS ${install_targets}
ARCHIVE DESTINATION lib
)

-IF(INSTALL_PDB)
- INSTALL(FILES ${install_bin_pdb}
- DESTINATION bin
- CONFIGURATIONS RelWithDebInfo Debug)
-ENDIF()
-
-INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include)
+if(NOT DISABLE_INSTALL_HEADERS)
+ INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include)
+endif()

STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype)
MESSAGE(STATUS "")
8 changes: 7 additions & 1 deletion ports/exiv2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
Source: exiv2
Version: 0.27.3
Build-Depends: zlib, expat, libiconv, gettext
Port-Version: 1
Build-Depends: zlib, libiconv, gettext
Description: Image metadata library and tools
Homepage: https://www.exiv2.org
Supports: !uwp

Feature: unicode
Description: Compile with unicode support on windows

Feature: xmp
Description: Build with XMP metadata support
Build-Depends: expat
45 changes: 45 additions & 0 deletions ports/exiv2/expat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake
index 9caffcf..deb01a0 100644
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -33,7 +33,7 @@ if (EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP)
message(FATAL_ERROR "EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP are mutually exclusive. You can only choose one of them")
else()
if (EXIV2_ENABLE_XMP)
- find_package(EXPAT REQUIRED)
+ find_package(expat CONFIG REQUIRED)
elseif (EXIV2_ENABLE_EXTERNAL_XMP)
find_package(XmpSdk REQUIRED)
endif ()
diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt
index ae011dc..7390d26 100644
--- a/xmpsdk/CMakeLists.txt
+++ b/xmpsdk/CMakeLists.txt
@@ -26,16 +26,21 @@ add_library(exiv2-xmp STATIC
include/XMP_Version.h
)

-target_link_libraries(exiv2-xmp
- PRIVATE
- ${EXPAT_LIBRARY}
-)
+if(WIN32 AND NOT MINGW)
+ target_link_libraries(exiv2-xmp
+ PRIVATE
+ expat::libexpat
+ )
+else()
+ target_link_libraries(exiv2-xmp
+ PRIVATE
+ expat::expat
+ )
+endif()

target_include_directories(exiv2-xmp
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/xmpsdk/include>
- PRIVATE
- ${EXPAT_INCLUDE_DIR}
)

# Prevent a denial-service-attack related to XML entity expansion
26 changes: 18 additions & 8 deletions ports/exiv2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
#https://github.com/Exiv2/exiv2/issues/1063
vcpkg_fail_port_install(ON_TARGET "uwp")

if("xmp" IN_LIST FEATURES)
set(EXPAT_PATCH ${CMAKE_CURRENT_LIST_DIR}/expat.patch)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Exiv2/exiv2
REF 194bb65ac568a5435874c9d9d73b1c8a68e4edec #v0.27.3
SHA512 35a5a41e0a6cfe04d1ed005c8116ad4430516402b925db3d4f719e2385e2cfb09359eb7ab51853bc560138f221900778cd2e2d39f108c513b3e7d22dbb9bf503
HEAD_REF master
PATCHES ${EXPAT_PATCH}
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
unicode EXIV2_ENABLE_WIN_UNICODE
xmp EXIV2_ENABLE_XMP
)

if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND ("unicode" IN_LIST FEATURES))
set(enable_win_unicode TRUE)
elseif()
set(enable_win_unicode FALSE)
if("unicode" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "Feature unicode only supports Windows platform.")
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DEXIV2_ENABLE_WIN_UNICODE:BOOL=${enable_win_unicode}
${FEATURE_OPTIONS}
-DEXIV2_BUILD_EXIV2_COMMAND:BOOL=FALSE
-DEXIV2_BUILD_UNIT_TESTS:BOOL=FALSE
-DEXIV2_BUILD_SAMPLES:BOOL=FALSE
Expand All @@ -27,7 +38,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/exiv2)

configure_file(
${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake
${CURRENT_PACKAGES_DIR}/share/exiv2
${CURRENT_PACKAGES_DIR}/share/${PORT}
@ONLY
)

Expand All @@ -42,5 +53,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
endif()

# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/exiv2)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/exiv2/COPYING ${CURRENT_PACKAGES_DIR}/share/exiv2/copyright)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
5 changes: 2 additions & 3 deletions ports/expat/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Source: expat
Version: 2.2.7
Version: 2.2.9
Homepage: https://github.com/libexpat/libexpat
Description: XML parser library written in C
Supports: !uwp
Description: XML parser library written in C
Loading