vcpkg/ports/exiv2/expat.patch

46 lines
1.4 KiB
Diff
Raw Normal View History

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