Fixed build without XMP support. See README-XMP.

This commit is contained in:
Andreas Huggel
2007-09-20 14:23:18 +00:00
parent a9fa6688bf
commit 2c16464268
4 changed files with 26 additions and 11 deletions
+3 -1
View File
@@ -8,7 +8,9 @@ has a new interface to access the raw XMP packet.
Todo: XMP support is controlled with the ENABLE_XMP directive
in config/config.mk.in. This will be a configure option
eventually.
eventually. For now, comment the line "ENABLE_XMP = 1" either
in config.mk.in before running ./configure or in config.mk to
build without XMP support.
Exiv2 uses the Adobe XMP toolkit (XMP SDK) to parse
and serialize XMP packets (only the XMPCore component).
+6 -6
View File
@@ -91,11 +91,9 @@ CCSRC += rafimage.cpp \
tiffvisitor.cpp \
types.cpp \
value.cpp \
version.cpp
ifdef ENABLE_XMP
CCSRC += properties.cpp \
version.cpp \
properties.cpp \
xmp.cpp
endif
# Add library C source files to this list
ifndef HAVE_TIMEGM
@@ -121,9 +119,11 @@ BINSRC = addmoddel.cpp \
taglist.cpp \
write-test.cpp \
write2-test.cpp \
tiffparse.cpp \
xmpparse.cpp \
tiffparse.cpp
ifdef ENABLE_XMP
BINSRC += xmpparse.cpp \
xmpparser-test.cpp
endif
# Main source file of the Exiv2 application
EXIV2MAIN = exiv2.cpp
+10 -4
View File
@@ -365,7 +365,11 @@ namespace Exiv2 {
bool XmpParser::initialize()
{
if (!initialized_) {
#ifdef EXV_HAVE_XMP_TOOLKIT
initialized_ = SXMPMeta::Initialize();
#else
initialized_ = true;
#endif
}
return initialized_;
}
@@ -373,7 +377,9 @@ namespace Exiv2 {
void XmpParser::terminate()
{
if (initialized_) {
#ifdef EXV_HAVE_XMP_TOOLKIT
SXMPMeta::Terminate();
#endif
initialized_ = false;
}
}
@@ -516,7 +522,7 @@ namespace Exiv2 {
return 3;
}} // XmpParser::decode
#else
int XmpParser::decode( XmpData& /*xmpData*/,
int XmpParser::decode( XmpData& xmpData,
const std::string& xmpPacket)
{
xmpData.clear();
@@ -603,16 +609,16 @@ namespace Exiv2 {
return 3;
}} // XmpParser::decode
#else
void XmpParser::encode( std::string& xmpPacket,
const XmpData& xmpData)
int XmpParser::encode( std::string& xmpPacket,
const XmpData& xmpData)
{
xmpPacket.clear();
if (!xmpData.empty()) {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: XMP toolkit support not compiled in.\n";
#endif
return 1;
}
return 1;
} // XmpParser::encode
#endif // !EXV_HAVE_XMP_TOOLKIT
+7
View File
@@ -1,6 +1,13 @@
#! /bin/sh
# XMP parser test driver
# ----------------------------------------------------------------------
# Check if xmpparser-test exists
if [ ! -x ../../src/xmpparser-test ] ; then
echo "xmpparser-test not found. Assuming XMP support is not enabled."
exit 0
fi
# ----------------------------------------------------------------------
# Setup
results="./tmp/xmpparser-test.out"