diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5dcd7635..1abc7eac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,7 +188,7 @@ if (EXIV2_ENABLE_XMP OR EXIV2_ENABLE_EXTERNAL_XMP) endif() if (EXIV2_ENABLE_XMP) - target_link_libraries(exiv2lib PRIVATE exiv2-xmp) + target_sources(exiv2lib PRIVATE $) elseif(EXIV2_ENABLE_EXTERNAL_XMP) target_link_libraries(exiv2lib PUBLIC ${XMPSDK_LIBRARY}) target_include_directories(exiv2lib PUBLIC ${XMPSDK_INCLUDE_DIR}) diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt index 9c148a61..87c59c07 100644 --- a/xmpsdk/CMakeLists.txt +++ b/xmpsdk/CMakeLists.txt @@ -26,14 +26,10 @@ add_library(exiv2-xmp OBJECT include/XMP_Version.h ) -target_link_libraries(exiv2-xmp - PRIVATE - EXPAT::EXPAT -) - target_include_directories(exiv2-xmp SYSTEM - PRIVATE + PRIVATE ${PROJECT_SOURCE_DIR}/xmpsdk/include + ${EXPAT_INCLUDE_DIRS} ) # Prevent a denial-service-attack related to XML entity expansion @@ -41,7 +37,7 @@ target_include_directories(exiv2-xmp SYSTEM # See https://bugzilla.redhat.com/show_bug.cgi?id=888769 target_compile_definitions(exiv2-xmp PRIVATE BanAllEntityUsage=1) -if (MSVC) +if (WIN32) target_compile_definitions(exiv2-xmp PRIVATE XML_STATIC) endif() @@ -53,10 +49,3 @@ endif() if (BUILD_SHARED_LIBS) set_property(TARGET exiv2-xmp PROPERTY POSITION_INDEPENDENT_CODE ON) endif() - -# The private dependencies of a static library still need to be exported because they are needed to properly link the consumers of the static library. -install(TARGETS exiv2-xmp EXPORT exiv2Config - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -)