Refactoring autotools to support ADOBE_XMPSDK (Work in Progress)
This commit is contained in:
parent
ad512ec4b5
commit
935421c855
5
Makefile
5
Makefile
@ -134,7 +134,8 @@ config:
|
||||
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
|
||||
|
||||
xmpsdk: config/config.mk
|
||||
if test "x$(ENABLE_XMP)" = "x1"; then cd xmpsdk/src && $(MAKE) $@; fi;
|
||||
if test "x$(ENABLE_XMP)" = "x1"; then cd xmpsdk/src && $(MAKE) $@; fi;
|
||||
if test "x$(ENABLE_XMP)" = "x2016" -o "x$(ENABLE_XMP)" = "x2014"; then xmpsdk/buildXMPsdk.sh $(ENABLE_XMP) $(MAKECMDGOALS); fi;
|
||||
|
||||
mostlyclean clean: config/config.mk
|
||||
cd src && $(MAKE) $(MAKECMDGOALS)
|
||||
@ -145,6 +146,8 @@ mostlyclean clean: config/config.mk
|
||||
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
|
||||
cd po && $(MAKE) $(MAKECMDGOALS)
|
||||
rm -f include/exiv2/exv_conf.h
|
||||
if [ -e xmpsdk/Adobe ]; then rm -rf xmpsdk/Adobe ; fi
|
||||
|
||||
|
||||
# `make distclean' also removes files created by configuring
|
||||
# the program. Running `make all distclean' prepares the project
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
########################################################################
|
||||
|
||||
SHELL = /bin/sh
|
||||
ENABLE_XMP = 1
|
||||
ENABLE_XMP = @ENABLE_XMP@
|
||||
|
||||
.PHONY: all doc config samples xmpsdk \
|
||||
mostlyclean clean distclean maintainer-clean \
|
||||
@ -134,7 +134,8 @@ config:
|
||||
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
|
||||
|
||||
xmpsdk: config/config.mk
|
||||
if test "x$(ENABLE_XMP)" = "x1"; then cd xmpsdk/src && $(MAKE) $@; fi;
|
||||
if test "x$(ENABLE_XMP)" = "x1"; then cd xmpsdk/src && $(MAKE) $@; fi;
|
||||
if test "x$(ENABLE_XMP)" = "x2016" -o "x$(ENABLE_XMP)" = "x2014"; then xmpsdk/buildXMPsdk.sh $(ENABLE_XMP) $(MAKECMDGOALS); fi;
|
||||
|
||||
mostlyclean clean: config/config.mk
|
||||
cd src && $(MAKE) $(MAKECMDGOALS)
|
||||
@ -145,6 +146,8 @@ mostlyclean clean: config/config.mk
|
||||
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
|
||||
cd po && $(MAKE) $(MAKECMDGOALS)
|
||||
rm -f include/exiv2/exv_conf.h
|
||||
if [ -e xmpsdk/Adobe ]; then rm -rf xmpsdk/Adobe ; fi
|
||||
|
||||
|
||||
# `make distclean' also removes files created by configuring
|
||||
# the program. Running `make all distclean' prepares the project
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
# Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
|
||||
# History: 10-Dec-03, ahu: created
|
||||
#
|
||||
# Description:
|
||||
# Description:
|
||||
# Exiv2 system configuration file.
|
||||
#
|
||||
|
||||
@ -90,19 +90,44 @@ endif
|
||||
# **********************************************************************
|
||||
# XMP support
|
||||
ENABLE_XMP = @ENABLE_XMP@
|
||||
CPPFLAGS_MORE=-Wundef -pedantic
|
||||
|
||||
ifdef ENABLE_XMP
|
||||
XMPSDK_LIBRARY = xmpsdk
|
||||
XMPSDK_DIR = $(top_srcdir)/xmpsdk
|
||||
XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/include
|
||||
XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/src
|
||||
XMPSDK_LIBS = -l$(XMPSDK_LIBRARY)
|
||||
else
|
||||
# Enable additional warnings. XMP Toolkit doesn't compile
|
||||
# with these.
|
||||
ifeq ($(GXX),yes)
|
||||
CXXFLAGS += -Wundef -pedantic
|
||||
endif
|
||||
ifeq ($(ENABLE_XMP),1)
|
||||
XMPSDK_LIBRARY = xmpsdk
|
||||
XMPSDK_DIR = $(top_srcdir)/xmpsdk
|
||||
XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/include -DMAC_ENV=1
|
||||
XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/src
|
||||
XMPSDK_LIBS = -l$(XMPSDK_LIBRARY)
|
||||
CPPFLAGS_MORE = X
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_XMP),2016)
|
||||
XMPSDK_LIBRARY = xmpsdk
|
||||
XMPSDK_DIR = $(top_srcdir)/xmpsdk
|
||||
XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/Adobe/XMP-Toolkit-SDK-CC201607 \
|
||||
-I$(XMPSDK_DIR)/Adobe/XMP-Toolkit-SDK-CC201607/public/include \
|
||||
-DEXV_ADOBE_XMPSDK=2016
|
||||
XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/Adobe/
|
||||
# XMPSDK_LIBS = -lXMPCore.a -lXMPFiles.a
|
||||
# XMPSDK_LIBS = $(XMPSDK_DIR)/Adobe/libXMPCore.a $(XMPSDK_DIR)/Adobe/libXMPFiles.a
|
||||
CPPFLAGS_MORE = X
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_XMP),2014)
|
||||
XMPSDK_LIBRARY = xmpsdk
|
||||
XMPSDK_DIR = $(top_srcdir)/xmpsdk
|
||||
XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/Adobe/XMP-Toolkit-SDK-CC201412 \
|
||||
-I$(XMPSDK_DIR)/Adobe/XMP-Toolkit-SDK-CC201412/public/include \
|
||||
-DEXV_ADOBE_XMPSDK=2014
|
||||
XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/Adobe/
|
||||
CPPFLAGS_MORE = X
|
||||
endif
|
||||
|
||||
# Enable additional warnings. XMP Toolkit doesn't compile with these.
|
||||
ifeq ($(GXX),yes)
|
||||
ifneq ($(CPPFLAGS_MORE),X)
|
||||
CXXFLAGS += $(CPPFLAGS_MORE)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Libcurl need for httpIO if it's selected
|
||||
@ -140,7 +165,7 @@ ifdef DEP_TRACKING
|
||||
# Directory for dependency files
|
||||
DEPDIR = .deps
|
||||
|
||||
# Command to run the compiler or preprocessor to produce
|
||||
# Command to run the compiler or preprocessor to produce
|
||||
# dependencies. If you're not using gcc, you may need to change
|
||||
# this to something suitable for your compiler or simply unset
|
||||
# the variable. See the link above for suggestions.
|
||||
@ -153,7 +178,7 @@ ifdef DEP_TRACKING
|
||||
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(DEPDIR)/$*.d; \
|
||||
$(RM) $*.d; fi
|
||||
|
||||
# Compiler flags to generate dependency files at the same time
|
||||
# Compiler flags to generate dependency files at the same time
|
||||
# as object files (for gcc)
|
||||
ifeq ($(GXX),yes)
|
||||
CXXFLAGS += -MMD
|
||||
|
||||
@ -356,7 +356,7 @@ AC_DEFUN([AX_GCC_VERSION], [
|
||||
])
|
||||
|
||||
AC_ARG_WITH(std,
|
||||
[--with-std use --with-std for c++11. options: --with-std=11|14|c++11|c++14 default/--without-std is c++98],
|
||||
[ --with-std use --with-std for c++11. options: --with-std=11|14|c++11|c++14 default/--without-std is c++98],
|
||||
STD=$withval,
|
||||
STD=default)
|
||||
|
||||
@ -386,6 +386,22 @@ else
|
||||
CPPFLAGS="${CPPFLAGS} -std=$STD"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(adobe,
|
||||
[ --with-adobe[[=OPT]] use --with-adobe for Adobe XMPsdk. OPT: 2016|2014 default/--without-adobe is xmpsdk/src],
|
||||
ADOBE=$withval,
|
||||
ADOBE=xmpsdk/src)
|
||||
if test "$ADOBE" == "yes"; then ADOBE=2016; fi
|
||||
|
||||
if test "$ADOBE" = "2016" -o "$ADOBE" = "2014" ; then
|
||||
ADOBE_SDK=XMP-Toolkit-SDK-CC201607
|
||||
if test "$ADOBE" == "2014" ; then ADOBE_SDK=XMP-Toolkit-SDK-CC2014.12; fi
|
||||
ENABLE_XMP=$ADOBE
|
||||
XMPSDK_CPPFLAGS='-Ixmpsdk/Adobe/$ADOBE_SDK/public/include'
|
||||
XMPSDK_LDFLAGS='-Lxmpsdk/Adobe/'
|
||||
XMPSDK_LIBS=''
|
||||
# '-lXMPCore.a -lXMPFiles.a'
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Create output files.
|
||||
# ---------------------------------------------------------------------------
|
||||
@ -441,7 +457,7 @@ yes) echo "-- Nikon lens database............ YES" ;;
|
||||
esac
|
||||
|
||||
case "$USE_XMP_TOOLKIT" in
|
||||
yes) echo "-- XMP metadata support........... YES" ;;
|
||||
yes) echo "-- XMP metadata support........... YES (ADOBE_SDK = $ADOBE)" ;;
|
||||
*) echo "-- XMP metadata support........... NO"
|
||||
echo ""
|
||||
echo "Expat is required for XMP support. Make sure the Expat header"
|
||||
@ -486,7 +502,11 @@ x1) echo "-- Using Lib SSH.................. YES" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "CPPFLAGS= " "$CPPFLAGS"
|
||||
echo "CPPFLAGS =" "$CPPFLAGS $SSH_CPPFLAGS $CURL_CPPFLAGS $XMPSDK_CPPFLAGS"
|
||||
echo "LDFLAGS =" "$LDFLAGS $SSH_LDFLAGS $CURL_LDFLAGS $EXPAT_LDFLAGS $XMPSDK_LDFLAGS"
|
||||
echo "LIBS =" "$LIBS $SSH_LIBS $CURL_LIBS $EXPAT_LIBS $XMPSDK_LIBS"
|
||||
echo "ENABLE_XMP =" "$ENABLE_XMP"
|
||||
echo "CXX =" "$CXX"
|
||||
echo "------------------------------------------------------------------"
|
||||
echo ""
|
||||
|
||||
|
||||
@ -205,7 +205,6 @@ typedef int pid_t;
|
||||
#endif
|
||||
//////////////////////////////////////
|
||||
|
||||
|
||||
# include <stdio.h>
|
||||
#ifdef EXV_HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
@ -215,6 +214,23 @@ typedef int pid_t;
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
// Define build-env for Adobe XMPsdk
|
||||
#ifdef EXV_ADOBE_XMPSDK
|
||||
# if defined(__APPLE__)
|
||||
# ifndef MAC_ENV
|
||||
# define MAC_ENV 1
|
||||
# endif
|
||||
# elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW__)
|
||||
# ifndef WIN_ENV
|
||||
# define WIN_ENV 1
|
||||
# endif
|
||||
# else
|
||||
# ifndef UNIX_ENV
|
||||
# define UNIX_ENV 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// That's all Folks!
|
||||
#endif // _CONFIG_H_
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#include "basicio.hpp"
|
||||
#include "exif.hpp"
|
||||
#include "iptc.hpp"
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
|
||||
// + standard includes
|
||||
#include <string>
|
||||
|
||||
@ -79,7 +79,7 @@ SET( LIBEXIV2_HDR ../include/exiv2/asfvideo.hpp
|
||||
../include/exiv2/value.hpp
|
||||
../include/exiv2/version.hpp
|
||||
../include/exiv2/webpimage.hpp
|
||||
../include/exiv2/xmp.hpp
|
||||
../include/exiv2/xmp_exiv2.hpp
|
||||
../include/exiv2/xmpsidecar.hpp
|
||||
../include/exiv2/utilsvideo.hpp
|
||||
${CMAKE_BINARY_DIR}/exv_conf.h
|
||||
@ -313,8 +313,8 @@ install(TARGETS exiv2lib
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
install(FILES ${LIBEXIV2_HDR}
|
||||
DESTINATION include/exiv2
|
||||
install(FILES ${LIBEXIV2_HDR}
|
||||
DESTINATION include/exiv2
|
||||
)
|
||||
|
||||
include(../CMake_msvc.txt)
|
||||
@ -324,7 +324,7 @@ msvc_runtime_configure(${EXIV2_ENABLE_SHARED} ${EXIV2_ENABLE_DYNAMIC_RUNTIME})
|
||||
# exiv2 application
|
||||
ADD_EXECUTABLE( exiv2 ${EXIV2_SRC} ${EXIV2_HDR} )
|
||||
TARGET_LINK_LIBRARIES( exiv2 exiv2lib ${LIBINTL_LIBRARIES} )
|
||||
install(TARGETS exiv2
|
||||
install(TARGETS exiv2
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ EXIV2_RCSID("@(#) $Id: actions.cpp 4719 2017-03-08 20:42:28Z robinwmills $")
|
||||
#include "exif.hpp"
|
||||
#include "easyaccess.hpp"
|
||||
#include "iptc.hpp"
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
#include "preview.hpp"
|
||||
#include "futils.hpp"
|
||||
#include "i18n.h" // NLS support.
|
||||
|
||||
@ -32,10 +32,11 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
|
||||
// *****************************************************************************
|
||||
// included header files
|
||||
#include "config.h"
|
||||
#include "types.hpp"
|
||||
#include "exif.hpp"
|
||||
#include "iptc.hpp"
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
#include "futils.hpp"
|
||||
#include "convert.hpp"
|
||||
|
||||
@ -63,7 +64,11 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
// Adobe XMP Toolkit
|
||||
#ifdef EXV_HAVE_XMP_TOOLKIT
|
||||
# define TXMP_STRING_TYPE std::string
|
||||
# if EXV_ADOBE_XMPSDK
|
||||
# include <XMP.hpp>
|
||||
# else
|
||||
# include <XMPSDK.hpp>
|
||||
# endif
|
||||
# include <MD5.h>
|
||||
#endif // EXV_HAVE_XMP_TOOLKIT
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
#include "utils.hpp"
|
||||
#include "convert.hpp"
|
||||
#include "i18n.h" // NLS support.
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
@ -38,7 +38,7 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
#include "value.hpp"
|
||||
#include "metadatum.hpp"
|
||||
#include "i18n.h" // NLS support.
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
#include "rwlock.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -79,7 +79,7 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
|
||||
// Adobe XMP Toolkit
|
||||
#if EXV_HAVE_XMP_TOOLKIT
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
#endif
|
||||
|
||||
// + standard includes
|
||||
|
||||
41
src/xmp.cpp
41
src/xmp.cpp
@ -30,7 +30,7 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
|
||||
// *****************************************************************************
|
||||
// included header files
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
#include "types.hpp"
|
||||
#include "error.hpp"
|
||||
#include "value.hpp"
|
||||
@ -43,9 +43,13 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
#include <string>
|
||||
|
||||
// Adobe XMP Toolkit
|
||||
#ifdef EXV_HAVE_XMP_TOOLKIT
|
||||
#ifdef EXV_HAVE_XMP_TOOLKIT
|
||||
# define TXMP_STRING_TYPE std::string
|
||||
# ifdef EXV_ADOBE_XMPSDK
|
||||
# include <XMP.hpp>
|
||||
# else
|
||||
# include <XMPSDK.hpp>
|
||||
# endif
|
||||
# include <XMP.incl_cpp>
|
||||
#endif // EXV_HAVE_XMP_TOOLKIT
|
||||
|
||||
@ -401,6 +405,30 @@ namespace Exiv2 {
|
||||
xmpLockFct_ = xmpLockFct;
|
||||
pLockData_ = pLockData;
|
||||
initialized_ = SXMPMeta::Initialize();
|
||||
#ifdef EXV_ADOBE_XMPSDK
|
||||
SXMPMeta::RegisterNamespace("http://ns.adobe.com/lightroom/1.0/", "lr",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://rs.tdwg.org/dwc/index.htm", "dwc",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://purl.org/dc/terms/", "dcterms",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://www.digikam.org/ns/1.0/", "digiKam",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://www.digikam.org/ns/kipi/1.0/", "kipi",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.0/", "MicrosoftPhoto",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.acdsee.com/iptc/1.0/", "acdsee",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://iptc.org/std/Iptc4xmpExt/2008-02-29/", "iptcExt",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.useplus.org/ldf/xmp/1.0/", "plus",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.iview-multimedia.com/mediapro/1.0/", "mediapro",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.microsoft.com/expressionmedia/1.0/", "expressionmedia",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/", "MP",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/t/RegionInfo#", "MPRI",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.microsoft.com/photo/1.2/t/Region#", "MPReg",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.google.com/photos/1.0/panorama/", "GPano",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://www.metadataworkinggroup.com/schemas/regions/", "mwg-rs",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://www.metadataworkinggroup.com/schemas/keywords/", "mwg-kw",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.adobe.com/xmp/sType/Area#", "stArea",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://cipa.jp/exif/1.0/", "exifEX",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://ns.adobe.com/camera-raw-saved-settings/1.0/", "crss",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://www.audio/", "audio",NULL);
|
||||
SXMPMeta::RegisterNamespace("http://www.video/", "video",NULL);
|
||||
#else
|
||||
SXMPMeta::RegisterNamespace("http://ns.adobe.com/lightroom/1.0/", "lr");
|
||||
SXMPMeta::RegisterNamespace("http://rs.tdwg.org/dwc/index.htm", "dwc");
|
||||
SXMPMeta::RegisterNamespace("http://purl.org/dc/terms/", "dcterms");
|
||||
@ -423,6 +451,7 @@ namespace Exiv2 {
|
||||
SXMPMeta::RegisterNamespace("http://ns.adobe.com/camera-raw-saved-settings/1.0/", "crss");
|
||||
SXMPMeta::RegisterNamespace("http://www.audio/", "audio");
|
||||
SXMPMeta::RegisterNamespace("http://www.video/", "video");
|
||||
#endif
|
||||
}
|
||||
return initialized_;
|
||||
}
|
||||
@ -508,7 +537,11 @@ namespace Exiv2 {
|
||||
initialize();
|
||||
AutoLock autoLock(xmpLockFct_, pLockData_);
|
||||
SXMPMeta::DeleteNamespace(ns.c_str());
|
||||
#ifdef EXV_ADOBE_XMPSDK
|
||||
SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str(),NULL);
|
||||
#else
|
||||
SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str());
|
||||
#endif
|
||||
}
|
||||
catch (const XMP_Error& e) {
|
||||
throw Error(40, e.GetID(), e.GetErrMsg());
|
||||
@ -861,6 +894,10 @@ namespace {
|
||||
return var;
|
||||
}
|
||||
|
||||
#ifdef EXV_ADOBE_XMPSDK
|
||||
#define kXMP_WriteAliasComments 0x0400UL
|
||||
#endif
|
||||
|
||||
XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags)
|
||||
{
|
||||
XMP_OptionBits var(0);
|
||||
|
||||
@ -36,7 +36,7 @@ EXIV2_RCSID("@(#) $Id$")
|
||||
#include "image.hpp"
|
||||
#include "basicio.hpp"
|
||||
#include "error.hpp"
|
||||
#include "xmp.hpp"
|
||||
#include "xmp_exiv2.hpp"
|
||||
#include "futils.hpp"
|
||||
#include "convert.hpp"
|
||||
|
||||
|
||||
@ -19,25 +19,36 @@ case "$uname" in
|
||||
;;
|
||||
esac
|
||||
|
||||
cd $(dirname "$0") # always run this script in exiv2-dir/xmpsdk
|
||||
SDK=XMP-Toolkit-SDK-CC201607
|
||||
if [ "$1" == "2014" ]; then
|
||||
SDK=XMP-Toolkit-SDK-CC201412
|
||||
fi
|
||||
|
||||
##
|
||||
# Download the code from Adobe
|
||||
if [ ! -e Adobe ]; then (
|
||||
if [ ! -e Adobe/$SDK ]; then (
|
||||
mkdir Adobe
|
||||
cd Adobe
|
||||
curl -O http://download.macromedia.com/pub/developer/xmp/sdk/XMP-Toolkit-SDK-CC201607.zip
|
||||
unzip XMP-Toolkit-SDK-CC201607.zip
|
||||
if curl -O http://download.macromedia.com/pub/developer/xmp/sdk/$SDK.zip ; then
|
||||
unzip $SDK.zip
|
||||
fi
|
||||
) fi
|
||||
|
||||
if [ ! -d Adobe/$SDK ]; then
|
||||
echo "*** ERROR SDK = Adobe/$SDK not found" >2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
##
|
||||
# copy third-party code into SDK
|
||||
(
|
||||
find third-party -type d -maxdepth 1 -exec cp -R '{}' Adobe/XMP-Toolkit-SDK-CC201607/third-party ';'
|
||||
find third-party -type d -maxdepth 1 -exec cp -R '{}' Adobe/$SDK/third-party ';'
|
||||
)
|
||||
|
||||
##
|
||||
# generate Makefile and build
|
||||
( cd Adobe/XMP-Toolkit-SDK-CC201607/build
|
||||
result=1 # assume the build will fail
|
||||
# generate Makefile and build libraries
|
||||
( cd Adobe/$SDK/build
|
||||
##
|
||||
# Tweak the code (depends on platform)
|
||||
case "$uname" in
|
||||
@ -66,43 +77,51 @@ if [ ! -e Adobe ]; then (
|
||||
if [ -e $f.orig ]; then mv $f.orig $f ; fi ; cp $f $f.orig
|
||||
|
||||
sed -E -e $'s?// Writeable?// Writeable~#include <windows.h>~#ifndef PATH_MAX~#define PATH_MAX 512~#endif?' $f.orig | tr "~" "\n" > $f
|
||||
result=1 # build failed. Can't build Cygwin yet!
|
||||
;;
|
||||
|
||||
Darwin)
|
||||
cmake . -G "Unix Makefiles" \
|
||||
if [ ! -e ../../$SDK/public/libraries/macintosh/intel_64/release/libXMPCoreStatic.a ]; then
|
||||
cmake . -G "Unix Makefiles" \
|
||||
-DXMP_ENABLE_SECURE_SETTINGS=OFF \
|
||||
-DXMP_BUILD_STATIC=1 \
|
||||
-DCMAKE_CL_64=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
make
|
||||
result=$?
|
||||
make
|
||||
result=$?
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
result=1 # build failed
|
||||
;;
|
||||
esac
|
||||
)
|
||||
|
||||
##
|
||||
# copy headers and build libraries
|
||||
# copy headers and built libraries
|
||||
if [ -z "$result" ]; then (
|
||||
rm -rf include
|
||||
cp -R Adobe/XMP-Toolkit-SDK-CC201607/public/include include
|
||||
|
||||
cp Adobe/$SDK/third-party/zuid/interfaces/MD5.h Adobe/$SDK/public/include/MD5.h
|
||||
|
||||
# report archives we can see
|
||||
cd Adobe/XMP-Toolkit-SDK-CC201607
|
||||
cd Adobe/$SDK
|
||||
find public -name "*.a" -o -name "*.ar" | xargs ls -alt
|
||||
cd ../..
|
||||
cd ../
|
||||
|
||||
# move the library/archives into xmpsdk
|
||||
case "$uname" in
|
||||
Linux)
|
||||
find Adobe/XMP-Toolkit-SDK-CC201607/public -name "*.ar" -exec cp {} . ';'
|
||||
mv staticXMPCore.ar libXMPCore.a
|
||||
mv staticXMPFiles.ar libXMPFiles.a
|
||||
rm -rf *.a *.ar
|
||||
find $SDK/public -name "*.ar" -exec cp {} . ';'
|
||||
mv staticXMPCore.ar libXMPCore.a
|
||||
mv staticXMPFiles.ar libXMPFiles.a
|
||||
;;
|
||||
|
||||
Darwin)
|
||||
find Adobe/XMP-Toolkit-SDK-CC201607/public -name "*.a" -exec cp {} . ';'
|
||||
mv libXMPCoreStatic.a libXMPCore.a
|
||||
mv libXMPFilesStatic.a libXMPFiles.a
|
||||
rm -rf *.a *.ar
|
||||
find $SDK/public -name "*.a" -exec cp {} . ';'
|
||||
mv libXMPCoreStatic.a libXMPCore.a
|
||||
mv libXMPFilesStatic.a libXMPFiles.a
|
||||
;;
|
||||
esac
|
||||
ls -alt *.a
|
||||
|
||||
@ -41,9 +41,9 @@
|
||||
#if defined WIN32 && !defined __CYGWIN__
|
||||
# define WIN_ENV 1
|
||||
/* Todo: How to correctly recognize a Mac platform? */
|
||||
#elif defined macintosh || defined MACOS_CLASSIC || defined MACOS_X_UNIX || defined MACOS_X || defined MACOS
|
||||
#elif defined macintosh || defined MACOS_CLASSIC || defined MACOS_X_UNIX || defined MACOS_X || defined MACOS || defined(__APPLE__)
|
||||
# define MAC_ENV 1
|
||||
#else
|
||||
#else
|
||||
# define UNIX_ENV 1
|
||||
#endif
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
#if 0 // ! maybe someday - ! MAC_ENV
|
||||
#error "MAC_ENV must be defined so that \"#if MAC_ENV\" is true"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined ( WIN_ENV ) || defined ( UNIX_ENV )
|
||||
#error "XMP environment error - must define only one of MAC_ENV, WIN_ENV, or UNIX_ENV"
|
||||
#endif
|
||||
@ -69,7 +69,7 @@
|
||||
#if 0 // ! maybe someday - ! WIN_ENV
|
||||
#error "WIN_ENV must be defined so that \"#if WIN_ENV\" is true"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined ( UNIX_ENV )
|
||||
#error "XMP environment error - must define only one of MAC_ENV, WIN_ENV, or UNIX_ENV"
|
||||
#endif
|
||||
@ -83,7 +83,7 @@
|
||||
#if 0 // ! maybe someday - ! UNIX_ENV
|
||||
#error "UNIX_ENV must be defined so that \"#if UNIX_ENV\" is true"
|
||||
#endif
|
||||
|
||||
|
||||
#define XMP_MacBuild 0
|
||||
#define XMP_WinBuild 0
|
||||
#define XMP_UNIXBuild 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user