diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0f0a2d8..ea5ea353 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,8 +173,10 @@ target_include_directories(exiv2lib SYSTEM PRIVATE $ ) -target_include_directories(exiv2lib PRIVATE ${EXPAT_INCLUDE_DIR}) -target_link_libraries(exiv2lib PRIVATE EXPAT::EXPAT) +if (EXIV2_ENABLE_XMP OR EXIV2_ENABLE_EXTERNAL_XMP) + target_include_directories(exiv2lib PRIVATE ${EXPAT_INCLUDE_DIR}) + target_link_libraries(exiv2lib PRIVATE EXPAT::EXPAT) +endif() if (EXIV2_ENABLE_XMP) target_link_libraries(exiv2lib PRIVATE exiv2-xmp) diff --git a/src/xmp.cpp b/src/xmp.cpp index 7146105c..dc0dfff2 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -43,6 +43,7 @@ # include #endif // EXV_HAVE_XMP_TOOLKIT +#ifdef EXV_HAVE_XMP_TOOLKIT // This anonymous namespace contains a class named XMLValidator, which uses // libexpat to do a basic validation check on an XML document. This is to // reduce the chance of hitting a bug in the (third-party) xmpsdk @@ -203,7 +204,7 @@ namespace { } }; } // namespace - +#endif // EXV_HAVE_XMP_TOOLKIT // ***************************************************************************** // local declarations