From 426cb8f354a3c1cfc8848366570a8e91d807ae37 Mon Sep 17 00:00:00 2001 From: clanmills Date: Thu, 24 Aug 2017 13:34:23 +0100 Subject: [PATCH 01/29] Fix Visual Studio build breaker. --- src/xmp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmp.cpp b/src/xmp.cpp index 3c93f202..95a28a2e 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -543,7 +543,7 @@ namespace Exiv2 { SXMPMeta::RegisterNamespace(ns.c_str(), prefix.c_str()); #endif } - catch (const XMP_Error& e) { + catch (const XMP_Error& /* e */) { // throw Error(40, e.GetID(), e.GetErrMsg()); } } // XmpParser::registerNs From 1ff0391563781abe367279731d24f88a091d9d5b Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Thu, 24 Aug 2017 10:36:17 +0100 Subject: [PATCH 02/29] Work in progress edits. Going off to cut the grass! --- xmpsdk/buildXMPsdk.cmd | 139 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 xmpsdk/buildXMPsdk.cmd diff --git a/xmpsdk/buildXMPsdk.cmd b/xmpsdk/buildXMPsdk.cmd new file mode 100644 index 00000000..c46d1783 --- /dev/null +++ b/xmpsdk/buildXMPsdk.cmd @@ -0,0 +1,139 @@ +#!/bin/bash + +## +# buildXMPsdk.sh +# TODO: +# 1) Cygwin support (in progress) +# 2) Write buildXMPsdk.cmd (for MSVC) +## + +syntaxError() { + echo "usage: $0 [--help|-?|--2013|--2014|--2016|--32|--64]" + exit 1 +} + +uname=$(uname -a | cut -d' ' -f 1 | cut -d_ -f 1) +case "$uname" in + Darwin|Linux|CYGWIN) ;; + *) echo "*** unsupported platform $uname ***" + exit 1 + ;; +esac + +## +# always run this script in /xmpsdk +cd $(dirname "$0") + +## +# parse command-line +bits=64 +SDK=2016 + +while [ $# -ne 0 ]; do + case "$1" in + -h|--help|-\?) syntaxError; exit 0;; + --64|64) bits=64 ; shift ;; + --32|32) bits=32 ; shift ;; + --2013|2013) SDK=2013 ; shift ;; + --2014|2014) SDK=2014 ; shift ;; + --2016|2016) SDK=2016 ; shift ;; + install) exit 0 ;; # argument passed by make + + *) syntaxError; exit 1;; + esac +done + +if [ "$SDK" == "2013" ] ; then SDK=XMP-Toolkit-SDK-CC201306 ; ZIP=XMP-Toolkit-SDK-CC-201306 ;fi +if [ "$SDK" == "2014" ] ; then SDK=XMP-Toolkit-SDK-CC201412 ; ZIP=$SDK; fi +if [ "$SDK" == "2016" ] ; then SDK=XMP-Toolkit-SDK-CC201607 ; ZIP=$SDK; fi + +## +# if it's already built, we're done +if [ -e Adobe/$SDK/libXMPCore.a ]; then ls -alt Adobe/$SDK/libXMPCore.a ; exit 0 ; fi + +## +# Download the code from Adobe +if [ ! -e Adobe/$SDK ]; then ( + mkdir -p Adobe + cd Adobe + if curl -O http://download.macromedia.com/pub/developer/xmp/sdk/$ZIP.zip ; then + unzip $ZIP.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/$SDK/third-party ';' +) + +## +# generate Makefile and build libraries +( cd Adobe/$SDK/build + ## + # Tweak the code (depends on platform) and build using adobe tools + case "$uname" in + Linux) + target=StaticRelease64 + if [ "$BITS" == "32" ]; then target=StaticRelease32 ; fi + make "$target" + result=$? + ;; + + CYGWIN) + f=../source/Host_IO-POSIX.cpp + if [ -e $f.orig ]; then mv $f.orig $f ; fi ; cp $f $f.orig + + sed -E -e $'s?// Writeable?// Writeable~#include ~#ifndef PATH_MAX~#define PATH_MAX 512~#endif?' $f.orig | tr "~" "\n" > $f + result=1 # build failed. Can't build Cygwin yet! + ;; + + Darwin) + if [ ! -e ../../$SDK/public/libraries/macintosh/intel_64/release/libXMPCoreStatic.a ]; then + target=5 # (5=64 bit build for 2013 and 2014, 3 = 64 bit build for 2016) + if [ "$SDK" == "XMP-Toolkit-SDK-CC201607" ]; then target=3; fi + echo $target | ./GenerateXMPToolkitSDK_mac.sh + + project=XMPToolkitSDK64.xcodeproj + find . -name "$project" -execdir xcodebuild -project {} -target XMPCoreStatic -configuration Release \; + result=$? + fi + ;; + *) + result=1 # build failed + ;; + esac +) + +## +# copy headers and built libraries +if [ -z "$result" ]; then ( + + cp Adobe/$SDK/third-party/zuid/interfaces/MD5.h Adobe/$SDK/public/include/MD5.h + + # report archives we can see + cd Adobe/$SDK + rm -rf *.a *.ar # clean up from previous build + find public -name "*.a" -o -name "*.ar" | xargs ls -alt + + # move the library/archives into xmpsdk/Adobe/$SDK + case "$uname" in + Linux) + find public -name "*.ar" -exec cp {} . ';' + mv staticXMPCore.ar libXMPCore.a + ;; + + Darwin) + find public -name "libXMPCoreStatic.a" -exec cp {} libXMPCore.a ';' + ;; + esac + ls -alt *.a +) ; fi + +# That's all Folks! +## From 9da376a12510225b57a2b621b07d20acff6ce414 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Thu, 24 Aug 2017 13:26:55 +0100 Subject: [PATCH 03/29] xmpsdk/buildXMPsdk.cmd - first working version --- xmpsdk/buildXMPsdk.cmd | 272 +++++++++++++++++++++-------------------- 1 file changed, 137 insertions(+), 135 deletions(-) diff --git a/xmpsdk/buildXMPsdk.cmd b/xmpsdk/buildXMPsdk.cmd index c46d1783..fdc06b90 100644 --- a/xmpsdk/buildXMPsdk.cmd +++ b/xmpsdk/buildXMPsdk.cmd @@ -1,139 +1,141 @@ -#!/bin/bash - -## -# buildXMPsdk.sh -# TODO: -# 1) Cygwin support (in progress) -# 2) Write buildXMPsdk.cmd (for MSVC) -## - -syntaxError() { - echo "usage: $0 [--help|-?|--2013|--2014|--2016|--32|--64]" - exit 1 -} - -uname=$(uname -a | cut -d' ' -f 1 | cut -d_ -f 1) -case "$uname" in - Darwin|Linux|CYGWIN) ;; - *) echo "*** unsupported platform $uname ***" - exit 1 - ;; -esac - -## -# always run this script in /xmpsdk -cd $(dirname "$0") - -## -# parse command-line -bits=64 -SDK=2016 - -while [ $# -ne 0 ]; do - case "$1" in - -h|--help|-\?) syntaxError; exit 0;; - --64|64) bits=64 ; shift ;; - --32|32) bits=32 ; shift ;; - --2013|2013) SDK=2013 ; shift ;; - --2014|2014) SDK=2014 ; shift ;; - --2016|2016) SDK=2016 ; shift ;; - install) exit 0 ;; # argument passed by make - - *) syntaxError; exit 1;; - esac -done - -if [ "$SDK" == "2013" ] ; then SDK=XMP-Toolkit-SDK-CC201306 ; ZIP=XMP-Toolkit-SDK-CC-201306 ;fi -if [ "$SDK" == "2014" ] ; then SDK=XMP-Toolkit-SDK-CC201412 ; ZIP=$SDK; fi -if [ "$SDK" == "2016" ] ; then SDK=XMP-Toolkit-SDK-CC201607 ; ZIP=$SDK; fi - -## -# if it's already built, we're done -if [ -e Adobe/$SDK/libXMPCore.a ]; then ls -alt Adobe/$SDK/libXMPCore.a ; exit 0 ; fi - -## -# Download the code from Adobe -if [ ! -e Adobe/$SDK ]; then ( - mkdir -p Adobe - cd Adobe - if curl -O http://download.macromedia.com/pub/developer/xmp/sdk/$ZIP.zip ; then - unzip $ZIP.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/$SDK/third-party ';' +@echo off +REM buildXMPsdk.cmd +setlocal enableextensions + +GOTO main +:help +echo Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 +exit /b 0 + +:main +REM +rem always run this script in /xmpsdk +cd %~dp0 + +set "_BUILDDIR_=%CD%" +set _SDK_=2016 +set _BIT_=64 + +:GETOPTS +if /I "%1" == "--2013" set "_SDK_=2013" +if /I "%1" == "--2014" set "_SDK_=2014" +if /I "%1" == "--2016" set "_SDK_=2016" +if /I "%1" == "2013" set "_SDK_=2013" +if /I "%1" == "2014" set "_SDK_=2014" +if /I "%1" == "2016" set "_SDK_=2016" + +if /I "%1" == "--32" set "_BIT_=32" +if /I "%1" == "--64" set "_BIT_=64" +if /I "%1" == "32" set "_BIT_=32" +if /I "%1" == "64" set "_BIT_=64" + +if /I "%1" == "--verbose" echo on + +if /I "%1" == "--help" call:help && goto end + +shift +if not (%1) EQU () goto GETOPTS + +if /I "%_SDK_%" == "2013" ( + set "_SDK_=XMP-Toolkit-SDK-CC201306" + set "_ZIP_=XMP-Toolkit-SDK-CC-201306" +) +if /I "%_SDK_%" == "2014" ( + set "_SDK_=XMP-Toolkit-SDK-CC201412" + set "_ZIP_=XMP-Toolkit-SDK-CC201412" +) +if /I "%_SDK_%" == "2016" ( + set "_SDK_=XMP-Toolkit-SDK-CC201607" + set "_ZIP_=XMP-Toolkit-SDK-CC201607" +) + +REM +rem if it's already built, we're done +if EXIST Adobe\%_SDK_%\libXMPCore.lib ( + dir Adobe\%_SDK_%\libXMPCore.lib + exit /b 0 +) + +REM +rem Test the VC Environment +IF NOT DEFINED VSINSTALLDIR ( + echo "VSINSTALLDIR not set. Run vcvars32.bat or vcvarsall.bat or vcvars.bat ***" + GOTO error_end +) +IF NOT EXIST "%VSINSTALLDIR%" ( + echo "VSINSTALLDIR %VSINSTALLDIR% does not exist. Run vcvars32.bat or vcvarsall.bat ***" + GOTO error_end +) + +call:report + +REM +rem Download the code from Adobe +if NOT EXIST Adobe\%_SDK_% ( + if NOT EXIST Adobe mkdir Adobe + cd Adobe + if NOT EXIST %_ZIP_%.zip copy/y y:\temp\XMP-Toolkit-SDK-CC201607.zip + if NOT EXIST %_ZIP_%.zip curl -O http://download.macromedia.com/pub/developer/xmp/sdk/%_ZIP_%.zip + IF NOT ERRORLEVEL 1 7z x %_ZIP_%.zip 2>nul + cd .. ) -## -# generate Makefile and build libraries -( cd Adobe/$SDK/build - ## - # Tweak the code (depends on platform) and build using adobe tools - case "$uname" in - Linux) - target=StaticRelease64 - if [ "$BITS" == "32" ]; then target=StaticRelease32 ; fi - make "$target" - result=$? - ;; - - CYGWIN) - f=../source/Host_IO-POSIX.cpp - if [ -e $f.orig ]; then mv $f.orig $f ; fi ; cp $f $f.orig - - sed -E -e $'s?// Writeable?// Writeable~#include ~#ifndef PATH_MAX~#define PATH_MAX 512~#endif?' $f.orig | tr "~" "\n" > $f - result=1 # build failed. Can't build Cygwin yet! - ;; - - Darwin) - if [ ! -e ../../$SDK/public/libraries/macintosh/intel_64/release/libXMPCoreStatic.a ]; then - target=5 # (5=64 bit build for 2013 and 2014, 3 = 64 bit build for 2016) - if [ "$SDK" == "XMP-Toolkit-SDK-CC201607" ]; then target=3; fi - echo $target | ./GenerateXMPToolkitSDK_mac.sh - - project=XMPToolkitSDK64.xcodeproj - find . -name "$project" -execdir xcodebuild -project {} -target XMPCoreStatic -configuration Release \; - result=$? - fi - ;; - *) - result=1 # build failed - ;; - esac +if NOT EXIST Adobe\%_SDK_% ( + echo *** ERROR SDK = Adobe\%_SDK_% not found" >2 + GOTO error_end ) -## -# copy headers and built libraries -if [ -z "$result" ]; then ( - - cp Adobe/$SDK/third-party/zuid/interfaces/MD5.h Adobe/$SDK/public/include/MD5.h - - # report archives we can see - cd Adobe/$SDK - rm -rf *.a *.ar # clean up from previous build - find public -name "*.a" -o -name "*.ar" | xargs ls -alt - - # move the library/archives into xmpsdk/Adobe/$SDK - case "$uname" in - Linux) - find public -name "*.ar" -exec cp {} . ';' - mv staticXMPCore.ar libXMPCore.a - ;; - - Darwin) - find public -name "libXMPCoreStatic.a" -exec cp {} libXMPCore.a ';' - ;; - esac - ls -alt *.a -) ; fi - -# That's all Folks! -## +REM +rem Copy in the third-party files +xcopy/yesihq third-party\zlib Adobe\%_SDK_%\third-party\zlib +xcopy/yesihq third-party\expat\lib Adobe\%_SDK_%\third-party\expat\lib +xcopy/yesihq third-party\zuid\interfaces Adobe\%_SDK_%\third-party\zuid\interfaces + +REM +rem generate the build the SDK +cd Adobe\%_SDK_%\build +dir +c:\cygwin64\bin\echo -n 5 | call GenerateXMPToolkitSDK_win.bat +cd .. +REM +rem build it! +echo --------------------------------------- +echo devenv XMPCore\build\vc14\static\windows_x64\XMPCore64.sln /Build "Release|x64" +echo --------------------------------------- + devenv XMPCore\build\vc14\static\windows_x64\XMPCore64.sln /Build "Release|x64" +dir/s *.lib + + +REM +rem normal end +:end +endlocal +exit /b 0 + +REM ----------------------------------------- +rem Functions +REM +rem echo (or don't if --silent). syntax: call:echo args ... +:echo +if NOT DEFINED _SILENT_ echo %*% +exit /b 0 + +REM +rem end with an error syntax: call:error_end +:error_end +endlocal +exit /b 1 + +REM +rem report settings +:report +echo.sdk = %_SDK_% +echo.bit = %_BIT_% +echo.zip = %_ZIP_% +echo.builddir = %_BUILDDIR_% +echo.vsinstalldir = %VSINSTALLDIR% +echo ---------------------------------- +exit /b 0 + +rem That's all Folks! +REM From b715da1fcdbb9eafb9cf02cc4d6b383447c99c73 Mon Sep 17 00:00:00 2001 From: clanmills Date: Thu, 24 Aug 2017 17:39:48 +0100 Subject: [PATCH 04/29] buildXMPsdk.cmd code complete. --- xmpsdk/buildXMPsdk.cmd | 133 +++++++++++++++++++++++++++++++---------- xmpsdk/my_echo.cpp | 10 ++++ 2 files changed, 110 insertions(+), 33 deletions(-) create mode 100644 xmpsdk/my_echo.cpp diff --git a/xmpsdk/buildXMPsdk.cmd b/xmpsdk/buildXMPsdk.cmd index fdc06b90..43f4b6f5 100644 --- a/xmpsdk/buildXMPsdk.cmd +++ b/xmpsdk/buildXMPsdk.cmd @@ -1,14 +1,17 @@ @echo off -REM buildXMPsdk.cmd +rem ---- +rem buildXMPsdk.cmd setlocal enableextensions +set "_THIS_=%0%" GOTO main :help -echo Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 +echo %_THIS_% [Options] +echo Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 ^| --rebuild exit /b 0 :main -REM +rem ---- rem always run this script in /xmpsdk cd %~dp0 @@ -30,8 +33,9 @@ if /I "%1" == "32" set "_BIT_=32" if /I "%1" == "64" set "_BIT_=64" if /I "%1" == "--verbose" echo on - +if /I "%1" == "--silent" set _SILENT_=1 if /I "%1" == "--help" call:help && goto end +if /I "%1" == "--rebuild" set _REBUILD_=1 shift if not (%1) EQU () goto GETOPTS @@ -39,24 +43,32 @@ if not (%1) EQU () goto GETOPTS if /I "%_SDK_%" == "2013" ( set "_SDK_=XMP-Toolkit-SDK-CC201306" set "_ZIP_=XMP-Toolkit-SDK-CC-201306" + set "_VC_=vc10" ) if /I "%_SDK_%" == "2014" ( set "_SDK_=XMP-Toolkit-SDK-CC201412" set "_ZIP_=XMP-Toolkit-SDK-CC201412" + set "_VC_=vc11" ) if /I "%_SDK_%" == "2016" ( set "_SDK_=XMP-Toolkit-SDK-CC201607" set "_ZIP_=XMP-Toolkit-SDK-CC201607" + set "_VC_=vc14" ) -REM +if DEFINED _REBUILD_ if EXIST Adobe\%_SDK_% rmdir/s/q Adobe\%_SDK_% + +rem ---- rem if it's already built, we're done -if EXIST Adobe\%_SDK_%\libXMPCore.lib ( - dir Adobe\%_SDK_%\libXMPCore.lib - exit /b 0 +set "_TARGET_=Adobe\%_SDK_%\public\doesntexist +if /I %_BIT_% == 64 set "_TARGET_=Adobe\%_SDK_%\public\libraries\windows_x64\Release\XMPCoreStatic.lib" +if /I %_BIT_% == 32 set "_TARGET_=Adobe\%_SDK_%\public\libraries\windows\Release\XMPCoreStatic.lib" +if EXIST %_TARGET_% ( + dir %_TARGET_% + GOTO end ) -REM +rem ---- rem Test the VC Environment IF NOT DEFINED VSINSTALLDIR ( echo "VSINSTALLDIR not set. Run vcvars32.bat or vcvarsall.bat or vcvars.bat ***" @@ -67,9 +79,35 @@ IF NOT EXIST "%VSINSTALLDIR%" ( GOTO error_end ) +rem ---- +call:echo testing 7z is on path +7z > NUL +IF ERRORLEVEL 1 ( + echo "*** please ensure 7z.exe is on the PATH ***" + GOTO error_end +) + +rem ---- +call:echo testing curl is on path +curl --version > NUL +IF ERRORLEVEL 1 ( + echo "*** please ensure cmake.exe is on the PATH ***" + GOTO error_end +) + +rem ---- +call:echo testing my_echo is on path +if NOT EXIST my_echo.exe cl my_echo.cpp /o my_echo.exe + +my_echo --version > NUL +IF ERRORLEVEL 1 ( + echo "*** please ensure my_echo.exe is on the PATH ***" + GOTO error_end +) + call:report -REM +rem ---- rem Download the code from Adobe if NOT EXIST Adobe\%_SDK_% ( if NOT EXIST Adobe mkdir Adobe @@ -81,52 +119,81 @@ if NOT EXIST Adobe\%_SDK_% ( ) if NOT EXIST Adobe\%_SDK_% ( - echo *** ERROR SDK = Adobe\%_SDK_% not found" >2 + echo *** ERROR SDK = Adobe\%_SDK_% not found" GOTO error_end ) -REM +rem ---- rem Copy in the third-party files xcopy/yesihq third-party\zlib Adobe\%_SDK_%\third-party\zlib xcopy/yesihq third-party\expat\lib Adobe\%_SDK_%\third-party\expat\lib xcopy/yesihq third-party\zuid\interfaces Adobe\%_SDK_%\third-party\zuid\interfaces -REM -rem generate the build the SDK +rem ---- +rem generate and build the SDK cd Adobe\%_SDK_%\build -dir -c:\cygwin64\bin\echo -n 5 | call GenerateXMPToolkitSDK_win.bat -cd .. -REM -rem build it! -echo --------------------------------------- -echo devenv XMPCore\build\vc14\static\windows_x64\XMPCore64.sln /Build "Release|x64" -echo --------------------------------------- - devenv XMPCore\build\vc14\static\windows_x64\XMPCore64.sln /Build "Release|x64" -dir/s *.lib - - -REM +set + +if /I %_BIT_% == 64 ( + %_BUILDDIR_%\my_echo 5 | call GenerateXMPToolkitSDK_win.bat + devenv %_VC_%\static\windows_x64\XMPToolkitSDK64.sln /Build "Release|x64" /ProjectConfig XMPCoreStatic +) + +if /I %_BIT_% == 32 ( + %_BUILDDIR_%\my_echo 3 | call GenerateXMPToolkitSDK_win.bat + devenv %_VC_%\static\windows\XMPToolkitSDK.sln /Build "Release|Win32" /ProjectConfig XMPCoreStatic +) +cd ..\..\.. + +rem ------------------------------------------------------------------------------ +rem The Adobe script GeneratXMPToolkitSDK_win.bat +rem use the CMake Generators "Visual Studio 14 2015 Win64" and "Visual Studio 14 2015" +rem CMake provides more generators +rem Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. +rem Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. +rem Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. +rem Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. +rem Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. +rem Visual Studio 8 2005 [arch] = Generates Visual Studio 2005 project files. +rem Adobe generate the Visual Studio Solution with the CMake command: +rem cmake ../../../. ^ +rem -G"Visual Studio 14 2015 Win64" ^ or -G"Visual Studio 14 2015 Win64" +rem -DXMP_CMAKEFOLDER_NAME="vc14/static/windows_x64" ^ +rem -DCMAKE_CL_64=ON ^ +rem -DCMAKE_ARCH=x64 ^ or -DCMAKE_ARCH=x64=x86 +rem -DXMP_BUILD_WARNING_AS_ERROR=ON ^ +rem -DXMP_BUILD_STATIC=ON +rem -DCMAKE_BUILD_TYPE=Release +rem I believe it's possible to build for other versions of Visual Studio +rem However I have never been tested this +rem ------------------------------------------------------------------------------ + +cd "%_BUILDDIR_%" +dir/s XMPCoreStatic.lib +GOTO end + +rem ----------------------------------------- +rem Functions + +rem ---- rem normal end :end endlocal exit /b 0 -REM ----------------------------------------- -rem Functions -REM +rem ---- rem echo (or don't if --silent). syntax: call:echo args ... :echo if NOT DEFINED _SILENT_ echo %*% exit /b 0 -REM +rem ---- rem end with an error syntax: call:error_end :error_end endlocal exit /b 1 -REM +rem ---- rem report settings :report echo.sdk = %_SDK_% @@ -138,4 +205,4 @@ echo ---------------------------------- exit /b 0 rem That's all Folks! -REM +rem ---- diff --git a/xmpsdk/my_echo.cpp b/xmpsdk/my_echo.cpp new file mode 100644 index 00000000..98930558 --- /dev/null +++ b/xmpsdk/my_echo.cpp @@ -0,0 +1,10 @@ +#include +int main(int argc,const char** argv) +{ + int args = argc; + while ( --argc ) { + printf("%s",argv[args-argc]); + if ( argc > 1 ) printf(" "); + } + return 0; +} \ No newline at end of file From 23aff3a11a0e022da37f92c3d2272aa5bbe94fd6 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 25 Aug 2017 11:49:18 +0100 Subject: [PATCH 05/29] buildXMPsdk.cmd testing/work-in-progress. --- xmpsdk/buildXMPsdk.cmd | 117 +++++++++++++++++++++++++---------------- xmpsdk/my_echo.cpp | 10 ---- 2 files changed, 71 insertions(+), 56 deletions(-) delete mode 100644 xmpsdk/my_echo.cpp diff --git a/xmpsdk/buildXMPsdk.cmd b/xmpsdk/buildXMPsdk.cmd index 43f4b6f5..a48dda5c 100644 --- a/xmpsdk/buildXMPsdk.cmd +++ b/xmpsdk/buildXMPsdk.cmd @@ -7,7 +7,8 @@ set "_THIS_=%0%" GOTO main :help echo %_THIS_% [Options] -echo Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 ^| --rebuild +echo.Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 ^| --rebuild ^| --dryrun +echo --sdk [2013^|2014^|2016] ^| --bit [32^|64] ^| --vs [2005^|2008^|2010^|2012^|2013^|2015^|2017] exit /b 0 :main @@ -18,6 +19,7 @@ cd %~dp0 set "_BUILDDIR_=%CD%" set _SDK_=2016 set _BIT_=64 +set _VS_=2015 :GETOPTS if /I "%1" == "--2013" set "_SDK_=2013" @@ -32,10 +34,16 @@ if /I "%1" == "--64" set "_BIT_=64" if /I "%1" == "32" set "_BIT_=32" if /I "%1" == "64" set "_BIT_=64" +if /I "%1" == "--vs" set "_VS_=%2"&shift +if /I "%1" == "--sdk" set "_SDK_=%2"&shift +if /I "%1" == "--bit" set "_BIT_=%2"&shift + if /I "%1" == "--verbose" echo on if /I "%1" == "--silent" set _SILENT_=1 if /I "%1" == "--help" call:help && goto end if /I "%1" == "--rebuild" set _REBUILD_=1 +if /I "%1" == "--distclean" set _DISTCLEAN_=1 +if /I "%1" == "--dryrun" set _DRYRUN_=1 shift if not (%1) EQU () goto GETOPTS @@ -43,20 +51,31 @@ if not (%1) EQU () goto GETOPTS if /I "%_SDK_%" == "2013" ( set "_SDK_=XMP-Toolkit-SDK-CC201306" set "_ZIP_=XMP-Toolkit-SDK-CC-201306" - set "_VC_=vc10" ) if /I "%_SDK_%" == "2014" ( set "_SDK_=XMP-Toolkit-SDK-CC201412" set "_ZIP_=XMP-Toolkit-SDK-CC201412" - set "_VC_=vc11" ) if /I "%_SDK_%" == "2016" ( set "_SDK_=XMP-Toolkit-SDK-CC201607" set "_ZIP_=XMP-Toolkit-SDK-CC201607" - set "_VC_=vc14" ) -if DEFINED _REBUILD_ if EXIST Adobe\%_SDK_% rmdir/s/q Adobe\%_SDK_% +if /I "%_VS_%" == "2015" set "_VC_=14" +if /I "%_VS_%" == "2013" set "_VC_=12" +if /I "%_VS_%" == "2012" set "_VC_=11" +if /I "%_VS_%" == "2010" set "_VC_=10" +if /I "%_VS_%" == "2008" set "_VC_=9" +if /I "%_VS_%" == "2005" set "_VC_=8" + set "_GENERATOR_=Visual Studio %_VC_% %_VS_%" +IF /I "%_BIT_%" == "64" set "_GENERATOR_=Visual Studio %_VC_% %_VS_% Win64" +if DEFINED _DRYRUN_ ( + call:report + GOTO end +) + +if DEFINED _REBUILD_ if EXIST Adobe\%_SDK_% rmdir/s/q Adobe\%_SDK_% +if DEFINED _DISTCLEAN_ if EXIST Adobe rmdir/s/q Adobe rem ---- rem if it's already built, we're done @@ -68,17 +87,6 @@ if EXIST %_TARGET_% ( GOTO end ) -rem ---- -rem Test the VC Environment -IF NOT DEFINED VSINSTALLDIR ( - echo "VSINSTALLDIR not set. Run vcvars32.bat or vcvarsall.bat or vcvars.bat ***" - GOTO error_end -) -IF NOT EXIST "%VSINSTALLDIR%" ( - echo "VSINSTALLDIR %VSINSTALLDIR% does not exist. Run vcvars32.bat or vcvarsall.bat ***" - GOTO error_end -) - rem ---- call:echo testing 7z is on path 7z > NUL @@ -96,15 +104,14 @@ IF ERRORLEVEL 1 ( ) rem ---- -call:echo testing my_echo is on path -if NOT EXIST my_echo.exe cl my_echo.cpp /o my_echo.exe - -my_echo --version > NUL +call:echo testing cmake.exe is on path +cmake.exe > NUL IF ERRORLEVEL 1 ( - echo "*** please ensure my_echo.exe is on the PATH ***" + echo "*** please ensure cmake.exe is on the PATH ***" GOTO error_end ) + call:report rem ---- @@ -112,7 +119,6 @@ rem Download the code from Adobe if NOT EXIST Adobe\%_SDK_% ( if NOT EXIST Adobe mkdir Adobe cd Adobe - if NOT EXIST %_ZIP_%.zip copy/y y:\temp\XMP-Toolkit-SDK-CC201607.zip if NOT EXIST %_ZIP_%.zip curl -O http://download.macromedia.com/pub/developer/xmp/sdk/%_ZIP_%.zip IF NOT ERRORLEVEL 1 7z x %_ZIP_%.zip 2>nul cd .. @@ -134,39 +140,55 @@ rem generate and build the SDK cd Adobe\%_SDK_%\build set -if /I %_BIT_% == 64 ( - %_BUILDDIR_%\my_echo 5 | call GenerateXMPToolkitSDK_win.bat - devenv %_VC_%\static\windows_x64\XMPToolkitSDK64.sln /Build "Release|x64" /ProjectConfig XMPCoreStatic -) - -if /I %_BIT_% == 32 ( - %_BUILDDIR_%\my_echo 3 | call GenerateXMPToolkitSDK_win.bat - devenv %_VC_%\static\windows\XMPToolkitSDK.sln /Build "Release|Win32" /ProjectConfig XMPCoreStatic -) -cd ..\..\.. - rem ------------------------------------------------------------------------------ rem The Adobe script GeneratXMPToolkitSDK_win.bat rem use the CMake Generators "Visual Studio 14 2015 Win64" and "Visual Studio 14 2015" -rem CMake provides more generators -rem Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. -rem Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. -rem Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. -rem Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. -rem Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. -rem Visual Studio 8 2005 [arch] = Generates Visual Studio 2005 project files. rem Adobe generate the Visual Studio Solution with the CMake command: rem cmake ../../../. ^ -rem -G"Visual Studio 14 2015 Win64" ^ or -G"Visual Studio 14 2015 Win64" +rem -G"Visual Studio 14 2015 Win64" ^ or -G"Visual Studio 14 2015" rem -DXMP_CMAKEFOLDER_NAME="vc14/static/windows_x64" ^ rem -DCMAKE_CL_64=ON ^ -rem -DCMAKE_ARCH=x64 ^ or -DCMAKE_ARCH=x64=x86 +rem -DCMAKE_ARCH=x64 ^ or -DCMAKE_ARCH=x86 rem -DXMP_BUILD_WARNING_AS_ERROR=ON ^ rem -DXMP_BUILD_STATIC=ON rem -DCMAKE_BUILD_TYPE=Release -rem I believe it's possible to build for other versions of Visual Studio -rem However I have never been tested this rem ------------------------------------------------------------------------------ +rem Building with the Adobe batch file GenerateXMPToolkitSDK_win.bat +TODO: Test the CMake.exe code and decide how to proceed + It's possible SDK=2016 demands VS=2015 (SDK=2014 & VS=2012) (SDK 2013 & VS=2010) +if /I %_BIT_% == 64 ( + echo 5|GenerateXMPToolkitSDK_win.bat + call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% + devenv vc%_VC_%\static\windows_x64\XMPToolkitSDK64.sln /Build "Release|x64" /ProjectConfig XMPCoreStatic +) + +if /I %_BIT_% == 32 ( + echo 3|GenerateXMPToolkitSDK_win.bat + call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% + devenv vc%_VC_%\static\windows\XMPToolkitSDK.sln /Build "Release|Win32" /ProjectConfig XMPCoreStatic +) + +rem set "_CL64_=-DCMAKE_CL_64=ON" +rem set "_ARCH_=-DCMAKE_ARCH=x64" +rem set "_OUT_=%_VS_%/static/windows_x64" +rem set "_BUILD_=Release|x64" +rem set "_SLN_=XMPToolkitSDK64.sln" +rem if /I "%_BIT_%" == "32" ( +rem set "_CL64_=-DCMAKE_CL_64=OFF" +rem set "_ARCH_=-DCMAKE_ARCH=x86" +rem set "_OUT_=%_VS_%/static/windows" +rem set "_BUILD_="Release|Win32" +rem set "_SLN_=XMPToolkitSDK.sln" +rem ) +rem @echo on +rem cmake.exe --version +rem call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% +rem cmake.exe . "-G%_GENERATOR_%" "%_CL64_%" "%_ARCH_%" -DXMP_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release "-DXMP_CMAKEFOLDER_NAME=%_OUT_%" +rem rem cmake.exe . --build +rem devenv "%_SLN_%" /Build "%_BUILD_%" /ProjectConfig XMPCoreStatic + +cd ..\..\.. +@echo off cd "%_BUILDDIR_%" dir/s XMPCoreStatic.lib @@ -196,11 +218,14 @@ exit /b 1 rem ---- rem report settings :report -echo.sdk = %_SDK_% +cmake.exe > NUL +IF NOT ERRORLEVEL 1 cmake.exe --version +echo.vs = %_VS_% echo.bit = %_BIT_% +echo.sdk = %_SDK_% +echo.generator = %_GENERATOR_% echo.zip = %_ZIP_% echo.builddir = %_BUILDDIR_% -echo.vsinstalldir = %VSINSTALLDIR% echo ---------------------------------- exit /b 0 diff --git a/xmpsdk/my_echo.cpp b/xmpsdk/my_echo.cpp deleted file mode 100644 index 98930558..00000000 --- a/xmpsdk/my_echo.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -int main(int argc,const char** argv) -{ - int args = argc; - while ( --argc ) { - printf("%s",argv[args-argc]); - if ( argc > 1 ) printf(" "); - } - return 0; -} \ No newline at end of file From f281556e85a913403b7c07b69168389324b5448e Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sun, 27 Aug 2017 12:50:30 +0100 Subject: [PATCH 06/29] xmpsdk/buildXMPsdk.cmd work-in-progress --- contrib/cmake/msvc/vcvars.bat | 12 ++++++- xmpsdk/buildXMPsdk.cmd | 68 ++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/contrib/cmake/msvc/vcvars.bat b/contrib/cmake/msvc/vcvars.bat index b22f2a64..3feb3a9f 100755 --- a/contrib/cmake/msvc/vcvars.bat +++ b/contrib/cmake/msvc/vcvars.bat @@ -8,7 +8,7 @@ set "_ARG_=%1" rem help if "%_ARG_%" EQU "" ( - echo syntax: %0 [2005 ^| 2008 ^| 2010 ^| 2012 ^| 2013 ^| 2015] [64] + echo syntax: %0 [2005 ^| 2008 ^| 2010 ^| 2012 ^| 2013 ^| 2015] ^| 2017] [64] goto eof ) @@ -41,6 +41,16 @@ if "%_ARG_%" EQU "2005" ( goto eof ) +if "%_ARG_%" EQU "2017" ( + @echo on + pushd "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools" + if "%_OPT_%" EQU "64" call vsdevcmd.bat -arch=amd64 + if "%_OPT_%" EQU "32" call vsdevcmd.bat -arch=x86 + popd + goto eof +) + + rem set the variable _VC_ set _VC_= diff --git a/xmpsdk/buildXMPsdk.cmd b/xmpsdk/buildXMPsdk.cmd index a48dda5c..0985f567 100644 --- a/xmpsdk/buildXMPsdk.cmd +++ b/xmpsdk/buildXMPsdk.cmd @@ -7,7 +7,7 @@ set "_THIS_=%0%" GOTO main :help echo %_THIS_% [Options] -echo.Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 ^| --rebuild ^| --dryrun +echo.Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 ^| --rebuild ^| --dryrun ^| --distclean echo --sdk [2013^|2014^|2016] ^| --bit [32^|64] ^| --vs [2005^|2008^|2010^|2012^|2013^|2015^|2017] exit /b 0 @@ -61,6 +61,7 @@ if /I "%_SDK_%" == "2016" ( set "_ZIP_=XMP-Toolkit-SDK-CC201607" ) +if /I "%_VS_%" == "2017" set "_VC_=15" if /I "%_VS_%" == "2015" set "_VC_=14" if /I "%_VS_%" == "2013" set "_VC_=12" if /I "%_VS_%" == "2012" set "_VC_=11" @@ -138,7 +139,8 @@ xcopy/yesihq third-party\zuid\interfaces Adobe\%_SDK_%\third-par rem ---- rem generate and build the SDK cd Adobe\%_SDK_%\build -set +del CMakeCache.txt +if EXIST CMakeFiles rmdir/s/q CMakeFiles rem ------------------------------------------------------------------------------ rem The Adobe script GeneratXMPToolkitSDK_win.bat @@ -154,38 +156,38 @@ rem -DXMP_BUILD_STATIC=ON rem -DCMAKE_BUILD_TYPE=Release rem ------------------------------------------------------------------------------ rem Building with the Adobe batch file GenerateXMPToolkitSDK_win.bat -TODO: Test the CMake.exe code and decide how to proceed - It's possible SDK=2016 demands VS=2015 (SDK=2014 & VS=2012) (SDK 2013 & VS=2010) -if /I %_BIT_% == 64 ( - echo 5|GenerateXMPToolkitSDK_win.bat - call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% - devenv vc%_VC_%\static\windows_x64\XMPToolkitSDK64.sln /Build "Release|x64" /ProjectConfig XMPCoreStatic -) - -if /I %_BIT_% == 32 ( - echo 3|GenerateXMPToolkitSDK_win.bat - call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% - devenv vc%_VC_%\static\windows\XMPToolkitSDK.sln /Build "Release|Win32" /ProjectConfig XMPCoreStatic -) - -rem set "_CL64_=-DCMAKE_CL_64=ON" -rem set "_ARCH_=-DCMAKE_ARCH=x64" -rem set "_OUT_=%_VS_%/static/windows_x64" -rem set "_BUILD_=Release|x64" -rem set "_SLN_=XMPToolkitSDK64.sln" -rem if /I "%_BIT_%" == "32" ( -rem set "_CL64_=-DCMAKE_CL_64=OFF" -rem set "_ARCH_=-DCMAKE_ARCH=x86" -rem set "_OUT_=%_VS_%/static/windows" -rem set "_BUILD_="Release|Win32" -rem set "_SLN_=XMPToolkitSDK.sln" +rem TODO: Test the CMake.exe code and decide how to proceed +rem It's possible SDK=2016 demands VS=2015 (SDK=2014 & VS=2012) (SDK 2013 & VS=2010) +rem if /I %_BIT_% == 64 ( +rem echo 5|GenerateXMPToolkitSDK_win.bat +rem call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% +rem devenv vc%_VC_%\static\windows_x64\XMPToolkitSDK64.sln /Build "Release|x64" /ProjectConfig XMPCoreStatic rem ) -rem @echo on -rem cmake.exe --version -rem call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% -rem cmake.exe . "-G%_GENERATOR_%" "%_CL64_%" "%_ARCH_%" -DXMP_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release "-DXMP_CMAKEFOLDER_NAME=%_OUT_%" -rem rem cmake.exe . --build -rem devenv "%_SLN_%" /Build "%_BUILD_%" /ProjectConfig XMPCoreStatic +rem +rem if /I %_BIT_% == 32 ( +rem echo 3|GenerateXMPToolkitSDK_win.bat +rem call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% +rem devenv vc%_VC_%\static\windows\XMPToolkitSDK.sln /Build "Release|Win32" /ProjectConfig XMPCoreStatic +rem ) + + set "_CL64_=-DCMAKE_CL_64=ON" + set "_ARCH_=-DCMAKE_ARCH=x64" + set "_OUT_=%_VS_%/static/windows_x64" + set "_BUILD_=Release|x64" + set "_SLN_=XMPToolkitSDK64.sln" +if /I "%_BIT_%" == "32" ( + set "_CL64_=-DCMAKE_CL_64=OFF" + set "_ARCH_=-DCMAKE_ARCH=x86" + set "_OUT_=%_VS_%/static/windows" + set "_BUILD_=Release|Win32" + set "_SLN_=XMPToolkitSDK.sln" +) +@echo on +cmake.exe --version +call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% +cmake.exe . "-G%_GENERATOR_%" "%_CL64_%" "%_ARCH_%" -DXMP_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release "-DXMP_CMAKEFOLDER_NAME=%_OUT_%" +rem cmake.exe . --build +devenv "%_SLN_%" /Build "%_BUILD_%" /ProjectConfig XMPCoreStatic cd ..\..\.. @echo off From 68effb1772cb9e5b950a47cf5dd6ce5e55586767 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Mon, 28 Aug 2017 20:42:48 +0100 Subject: [PATCH 07/29] xmpsdk/buildXMPsdk.cmd work-in-progress --- xmpsdk/buildXMPsdk.cmd | 134 +++++++++++++++++++++----------- xmpsdk/third-party/zlib/zconf.h | 4 + 2 files changed, 94 insertions(+), 44 deletions(-) diff --git a/xmpsdk/buildXMPsdk.cmd b/xmpsdk/buildXMPsdk.cmd index 0985f567..aada74bc 100644 --- a/xmpsdk/buildXMPsdk.cmd +++ b/xmpsdk/buildXMPsdk.cmd @@ -7,8 +7,8 @@ set "_THIS_=%0%" GOTO main :help echo %_THIS_% [Options] -echo.Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 ^| --rebuild ^| --dryrun ^| --distclean -echo --sdk [2013^|2014^|2016] ^| --bit [32^|64] ^| --vs [2005^|2008^|2010^|2012^|2013^|2015^|2017] +echo.Options: --help ^| --2016 ^| --2014 ^| --2013 ^| --64 ^| --32 ^| --rebuild ^| --dryrun ^| --distclean ^| --generate +echo --sdk [2013^|2014^|2016] ^| --bit [32^|64] ^| --vs [2005^|2008^|2010^|2012^|2013^|2015^|2017] ^| --log [path] exit /b 0 :main @@ -17,9 +17,9 @@ rem always run this script in /xmpsdk cd %~dp0 set "_BUILDDIR_=%CD%" -set _SDK_=2016 -set _BIT_=64 -set _VS_=2015 +if NOT DEFINED _SDK_ set _SDK_=2016 +if NOT DEFINED _BIT_ set _BIT_=64 +if NOT DEFINED _VS_ set _VS_=2015 :GETOPTS if /I "%1" == "--2013" set "_SDK_=2013" @@ -37,6 +37,7 @@ if /I "%1" == "64" set "_BIT_=64" if /I "%1" == "--vs" set "_VS_=%2"&shift if /I "%1" == "--sdk" set "_SDK_=%2"&shift if /I "%1" == "--bit" set "_BIT_=%2"&shift +if /I "%1" == "--log" set "_LOG_=%2"&shift if /I "%1" == "--verbose" echo on if /I "%1" == "--silent" set _SILENT_=1 @@ -44,6 +45,7 @@ if /I "%1" == "--help" call:help && goto end if /I "%1" == "--rebuild" set _REBUILD_=1 if /I "%1" == "--distclean" set _DISTCLEAN_=1 if /I "%1" == "--dryrun" set _DRYRUN_=1 +if /I "%1" == "--generate" set _GENERATE_=1 shift if not (%1) EQU () goto GETOPTS @@ -112,7 +114,6 @@ IF ERRORLEVEL 1 ( GOTO error_end ) - call:report rem ---- @@ -139,8 +140,9 @@ xcopy/yesihq third-party\zuid\interfaces Adobe\%_SDK_%\third-par rem ---- rem generate and build the SDK cd Adobe\%_SDK_%\build -del CMakeCache.txt -if EXIST CMakeFiles rmdir/s/q CMakeFiles + +if EXIST CMakeCache.txt del CMakeCache.txt +if EXIST CMakeFiles rmdir/s/q CMakeFiles rem ------------------------------------------------------------------------------ rem The Adobe script GeneratXMPToolkitSDK_win.bat @@ -155,45 +157,14 @@ rem -DXMP_BUILD_WARNING_AS_ERROR=ON ^ rem -DXMP_BUILD_STATIC=ON rem -DCMAKE_BUILD_TYPE=Release rem ------------------------------------------------------------------------------ -rem Building with the Adobe batch file GenerateXMPToolkitSDK_win.bat -rem TODO: Test the CMake.exe code and decide how to proceed -rem It's possible SDK=2016 demands VS=2015 (SDK=2014 & VS=2012) (SDK 2013 & VS=2010) -rem if /I %_BIT_% == 64 ( -rem echo 5|GenerateXMPToolkitSDK_win.bat -rem call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% -rem devenv vc%_VC_%\static\windows_x64\XMPToolkitSDK64.sln /Build "Release|x64" /ProjectConfig XMPCoreStatic -rem ) -rem -rem if /I %_BIT_% == 32 ( -rem echo 3|GenerateXMPToolkitSDK_win.bat -rem call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% -rem devenv vc%_VC_%\static\windows\XMPToolkitSDK.sln /Build "Release|Win32" /ProjectConfig XMPCoreStatic -rem ) - - set "_CL64_=-DCMAKE_CL_64=ON" - set "_ARCH_=-DCMAKE_ARCH=x64" - set "_OUT_=%_VS_%/static/windows_x64" - set "_BUILD_=Release|x64" - set "_SLN_=XMPToolkitSDK64.sln" -if /I "%_BIT_%" == "32" ( - set "_CL64_=-DCMAKE_CL_64=OFF" - set "_ARCH_=-DCMAKE_ARCH=x86" - set "_OUT_=%_VS_%/static/windows" - set "_BUILD_=Release|Win32" - set "_SLN_=XMPToolkitSDK.sln" -) -@echo on -cmake.exe --version -call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% -cmake.exe . "-G%_GENERATOR_%" "%_CL64_%" "%_ARCH_%" -DXMP_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release "-DXMP_CMAKEFOLDER_NAME=%_OUT_%" -rem cmake.exe . --build -devenv "%_SLN_%" /Build "%_BUILD_%" /ProjectConfig XMPCoreStatic +if DEFINED _GENERATE_ call:generate +if NOT DEFINED _GENERATE_ call:cmakebuild cd ..\..\.. -@echo off cd "%_BUILDDIR_%" -dir/s XMPCoreStatic.lib +if DEFINED _LOG_ call:log >> "%_LOG_%" +call:log GOTO end rem ----------------------------------------- @@ -231,5 +202,80 @@ echo.builddir = %_BUILDDIR_% echo ---------------------------------- exit /b 0 -rem That's all Folks! rem ---- +rem log +:log +echo VS = %_VS_% BIT = %_BIT_% GENERATE = %_GENERATE_% +dir/s XMPCoreStatic.lib +echo.------------------------------------------------- +exit /b 0 + +rem ---- +rem generate +:generate +rem Building with the Adobe batch file GenerateXMPToolkitSDK_win.bat +rem SDK=2016 demands VS=2015/14.0 (SDK=2014 => VS=2012/11.0) (SDK 2013 => VS=2010/10.0) +set _VS_=2015 +set _VC_=14 +if /I %_SDK_% == XMP-Toolkit-SDK-CC201412 ( + set _VS_=2012 + set _VC_=11 +) +if /I %_SDK_% == XMP-Toolkit-SDK-CC201306 ( + set _VS_=2010 + set _VC_=10 +) + +if /I %_BIT_% == 64 ( + echo 5|GenerateXMPToolkitSDK_win.bat + call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% + devenv vc%_VC_%\static\windows_x64\XMPToolkitSDK64.sln /Build "Release|x64" /ProjectConfig XMPCoreStatic +) +if /I %_BIT_% == 32 ( + echo 3|GenerateXMPToolkitSDK_win.bat + call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% + devenv vc%_VC_%\static\windows\XMPToolkitSDK.sln /Build "Release|Win32" /ProjectConfig XMPCoreStatic +) +exit /b 0 + +rem ---- +rem cmakebuild +:cmakebuild + set "_CL64_=ON" + set "_ARCH_=x64" + set "_OUT_=%_VS_%/static/windows_x64" + set "_BUILD_=Release|x64" + set "_SLN_=XMPToolkitSDK64.sln" +if /I "%_BIT_%" == "32" ( + set "_CL64_=OFF" + set "_ARCH_==x86" + set "_OUT_=%_VS_%/static/windows" + set "_BUILD_=Release|Win32" + set "_SLN_=XMPToolkitSDK.sln" +) + +cmake.exe . "-G%_GENERATOR_%" "-DCMAKE_CL_64=%_CL64_%" "-DCMAKE_ARCH=%_ARCH_%" -DXMP_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release "-DXMP_CMAKEFOLDER_NAME=%_OUT_%" +rem cmake.exe . --build +call "%_BUILDDIR_%\..\contrib\cmake\msvc\vcvars.bat" %_VS_% %_BIT_% +devenv "%_SLN_%" /Build "%_BUILD_%" /ProjectConfig XMPCoreStatic + +exit /b 0 + +rem That's all Folks! +rem --- + +:-------------------------------------------------------------------------: +:Results (XMPCoreStatic.lib in bytes) : +:SDK 2016 (100mb) 2014 (19mb) 2013 (16mb) : +:BIT 64 32 64 32 64 32 : +:--generate 101641740 102822984 19286538 19450862 16460768 16401436 : +:--vs 2017 98051466 99325340 21777156 22077510 21742182 22042920 : +:--vs 2015 101639620 102822984 22062886 22146768 22029954 22112392 : +:--vs 2013 87074304 87437858 19390614 19373912 19358838 19340578 : +:--vs 2012 19286538 FAILS 19286538 88888888 FAILS 88888888 : +:--vs 2010 FAILS FAILS 16490010 88888888 16460768 88888888 : +:--vs 2008 88888888 88888888 88888888 88888888 88888888 88888888 : +:--vs 2005 88888888 88888888 88888888 88888888 88888888 88888888 : +:-------------------------------------------------------------------------: +:88888888 = Not tested + diff --git a/xmpsdk/third-party/zlib/zconf.h b/xmpsdk/third-party/zlib/zconf.h index a3a6b54f..6939aa3e 100644 --- a/xmpsdk/third-party/zlib/zconf.h +++ b/xmpsdk/third-party/zlib/zconf.h @@ -446,6 +446,10 @@ typedef uLong FAR uLongf; # undef _LARGEFILE64_SOURCE #endif +#if defined(_MSC_VER) && defined(Z_HAVE_UNISTD_H) +#undef Z_HAVE_UNISTD_H +#endif + #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) # define Z_HAVE_UNISTD_H #endif From 60d436c96960fa314e2d12d017440253ce280d51 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Tue, 5 Sep 2017 21:36:56 +0100 Subject: [PATCH 08/29] Many changes to CMakeLists.txt and cmakeBuild.cmd to support unicode, static linking, passing shared library build flags. --- CMakeLists.txt | 25 ++-- config/compilerFlags.cmake | 4 +- config/printSummary.cmake | 9 +- contrib/cmake/msvc/ReadMe.txt | 102 +++++++++----- contrib/cmake/msvc/cmakeBuild.cmd | 42 ++++-- contrib/cmake/msvc/cmakeDefaults.cmd | 4 +- po/CMakeLists.txt | 48 +++---- samples/CMakeLists.txt | 105 ++++++++------ src/CMakeLists.txt | 200 ++++++--------------------- xmpsdk/CMakeLists.txt | 40 +----- 10 files changed, 252 insertions(+), 327 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b14d1962..1bcdcb3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,4 @@ -# CMake build system for exiv2 library and executables -# Copyright 2015- Daniel Kaneider -# Copyright 2010-2012 Gilles Caulier -# Copyright 2008 Patrick Spendrin - -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# CMakeLists.txt for exiv2 library cmake_minimum_required( VERSION 3.1.0 ) project( exiv2 ) @@ -30,7 +24,6 @@ set( GENERIC_LIB_VERSION "26.0.0" ) set( GENERIC_LIB_SOVERSION "26" ) # options and their default values -option( EXIV2_ENABLE_SHARED "Build exiv2 as a shared library (dll)" ON ) option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) @@ -38,8 +31,6 @@ option( EXIV2_ENABLE_NLS "Build native language support (requires gett option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) option( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) -option( EXIV2_ENABLE_BUILD_SAMPLES "Build the unit tests" ON ) -option( EXIV2_ENABLE_BUILD_PO "Build translations files" OFF ) option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) @@ -51,7 +42,9 @@ else() option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON ) option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) endif() -option( EXIV2_ENABLE_TOOLS "Build exiv2 executable" ON ) +option( EXIV2_BUILD_SAMPLES "Build sample applications" ON ) +option( EXIV2_BUILD_PO "Build translations files" OFF ) +option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON ) include(config/findDependencies.cmake) include(config/compilerFlags.cmake) @@ -62,7 +55,12 @@ if( EXIV2_ENABLE_COMMERCIAL ) endif() if( MSVC ) - set(CMAKE_DEBUG_POSTFIX "d") + if ( EXIV2_ENABLE_WIN_UNICODE ) + set(CMAKE_DEBUG_POSTFIX "du") + set(CMAKE_RELEASE_POSTFIX "u") + else() + set(CMAKE_DEBUG_POSTFIX "d") + endif() endif() if( EXIV2_ENABLE_XMP ) @@ -106,3 +104,6 @@ if( MINGW OR UNIX OR APPLE) endif() include( config/printSummary.cmake ) + +# That's all Folks! +## diff --git a/config/compilerFlags.cmake b/config/compilerFlags.cmake index a459da65..656ade47 100644 --- a/config/compilerFlags.cmake +++ b/config/compilerFlags.cmake @@ -23,7 +23,7 @@ if(MSVC) CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO ) - if ( ${EXIV2_ENABLE_SHARED} OR ${EXIV2_ENABLE_DYNAMIC_RUNTIME}) + if ( ${BUILD_SHARED_LIBS} OR ${EXIV2_ENABLE_DYNAMIC_RUNTIME} ) message(STATUS "MSVC -> forcing use of dynamically-linked runtime." ) foreach(variable ${variables}) if(${variable} MATCHES "/MT") @@ -51,7 +51,7 @@ if(MSVC) endforeach() # don't link msvcrt for .exe which use shared libraries (use default libcmt) - if ( NOT ${EXIV2_ENABLE_SHARED} AND NOT ${EXIV2_ENABLE_DYNAMIC_RUNTIME}) + if ( NOT ${BUILD_SHARED_LIBS} AND NOT ${EXIV2_ENABLE_DYNAMIC_RUNTIME}) set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRTD") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:MSVCRT") set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/NODEFAULTLIB:MSVCRT") diff --git a/config/printSummary.cmake b/config/printSummary.cmake index e5b1cc1e..cb82ec89 100644 --- a/config/printSummary.cmake +++ b/config/printSummary.cmake @@ -18,19 +18,16 @@ message( STATUS "Compiler info: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) message( STATUS "------------------------------------------------------------------" ) message( STATUS "${PACKAGE_STRING} configure results <${PACKAGE_URL}>" ) +OptionOutput( "Building shared library: " BUILD_SHARED_LIBS ) OptionOutput( "Building PNG support: " EXIV2_ENABLE_PNG AND ZLIB_FOUND ) -OptionOutput( "Building shared library: " EXIV2_ENABLE_SHARED ) OptionOutput( "XMP metadata support: " EXIV2_ENABLE_XMP ) OptionOutput( "Building static libxmp: " EXIV2_ENABLE_LIBXMP ) OptionOutput( "Native language support: " EXIV2_ENABLE_NLS ) OptionOutput( "Conversion of Windows XP tags: " EXIV2_ENABLE_PRINTUCS2 ) OptionOutput( "Nikon lens database: " EXIV2_ENABLE_LENSDATA ) OptionOutput( "Commercial build: " EXIV2_ENABLE_COMMERCIAL ) -OptionOutput( "Build the unit tests: " EXIV2_ENABLE_BUILD_SAMPLES ) -OptionOutput( "Building translations files: " EXIV2_ENABLE_BUILD_PO ) OptionOutput( "Building video support: " EXIV2_ENABLE_VIDEO ) OptionOutput( "Building webready support: " EXIV2_ENABLE_WEBREADY ) - if ( EXIV2_ENABLE_WEBREADY ) OptionOutput( "USE Libcurl for HttpIo: " EXIV2_ENABLE_CURL ) OptionOutput( "USE Libssh for SshIo: " EXIV2_ENABLE_SSH ) @@ -40,5 +37,9 @@ if (WIN32) OptionOutput( "Dynamic runtime override: " EXIV2_ENABLE_DYNAMIC_RUNTIME) OptionOutput( "Unicode paths (wstring): " EXIV2_ENABLE_WIN_UNICODE ) endif() +OptionOutput( "Building exiv2 command: " EXIV2_BUILD_EXIV2_COMMAND ) +OptionOutput( "Building samples: " EXIV2_BUILD_SAMPLES ) +OptionOutput( "Building PO files: " EXIV2_BUILD_PO ) + message( STATUS "------------------------------------------------------------------" ) diff --git a/contrib/cmake/msvc/ReadMe.txt b/contrib/cmake/msvc/ReadMe.txt index 6cb601c9..4c8ce5fa 100755 --- a/contrib/cmake/msvc/ReadMe.txt +++ b/contrib/cmake/msvc/ReadMe.txt @@ -1,4 +1,4 @@ - @@@Marco@@@@@b ;mm /##Gilles###\ + @@@Luis@@@@@b ;mm /##Gilles###\ j@@@#Robin", Brad /@@@Thomas@@@@Q @@@# \ ## @@@b |@@@b @@@# .;;;;, ,;;;, ,;;;; ,;;;p .;;; 7@@ ]Alan @@ -9,7 +9,7 @@ @@@# ,@@##@@m @@@b @@@p @@C #@@#C @@@# ,/ s@@# @@@@ @@@b Volker @Tuan@ ]@@@Abhinav@@\ /@@@\ \@@@Q @@@Q %@@@# /@@@@Mahesh@@# - /@@Raphael@@@@@\ /@@@@@\ C++ Metadata Library /@Sridhar@@@v0.26\ + /@@Raphael@@@@@\ /@@@@@\ C++ Metadata Library /@Sridhar@@@v0.26.1\ exiv2/contrib/cmake/msvc/ReadMe.txt ----------------------------------- @@ -39,7 +39,7 @@ How to use this cd \contrib\cmake\cmake cmd.exe vcvars 2015 64 - cmakeBuild --help # display syntax and options + cmakeBuild --help # display syntax and options cmakeBuild --rebuild .... exit @@ -65,7 +65,42 @@ How to use this When you are building happily, you may prefer: cmakeBuild --silent -3 What gets built? +3 Options + C:\Users\rmills\gnu\github\clanmills\exiv2\contrib\cmake\msvc>cmakeBuild --help + Options: --help | --webready | --rebuild | --video | --static | --unicode | --nls + --silent | --verbose | --pause | --dryrun | --test | --trace + --exiv2 C:\Users\rmills\gnu\github\clanmills\exiv2 | --work work | --config Release | --generator generator + --zlib zlib-1.2.8 | --expat expat-2.1.0 | --curl curl-7.45.0 | --libssh libssh-0.7.2 + --bash c:\cygwin64\bin\bash.exe + + Option switches. + --help Print help message and quit + --webready Build and Link the webready feature + --rebuild Delete "relics" from a previous build such as CMakeBuild.txt + --video Build and link video support + --static Build and link static libraries and programs + --nosamples Do not build sample applications + --unicode Build UNICODE path support + --nls Build with Natural Language Support + --silent Run script with minimal "chatter" + --verbose Run script with maximum "chatter" + --trace Show commands begin executed by the script + --dryrun Don't build anything. Report and quit + --test Execute the test suite after the build + + Option/values (See section 9 below) + --zlib zlib-1.2.8 + --expath expat-2.1.0 + --curl curl-7.44.0 + --libssh libssh-0.7.2 + + Other build key/value pairs: + --config Release | Debug + --generator The script default is almost always correct and is passed as -G "Generator" to CMake + --work The "work" directory in which the build will be performed (see 4 below) + --bash Path to bash.exe to be used when --test is specified. + +4 What gets built? The build is performed in work The output is generated in dist dist\..mumble..\bin contains *.exe and *.dll files @@ -79,7 +114,7 @@ How to use this dll = shared library dll/static Release = configuration Release/Debug/RelWithDebInfo/MinSizeRel -4 Building manually with CMake +5 Building manually with CMake The cmake option -G Generator should be chosen for the version of Visual Studio installed. cmake --help for more information @@ -124,7 +159,7 @@ How to use this cmake --build . --config Release cmake --build . --config Release --target install -5 About webready support libraries (openssl, libssh and curl) +6 About webready support libraries (openssl, libssh and curl) a) openssl You cannot build openssl with CMake. However we have prebuilt binaries which @@ -165,37 +200,37 @@ How to use this The fixes are included in svn://dev.exiv2.org/svn/team/libraries/libssh-0.7.2.tar.gz A 'vanilla' version of libssh will may require those fixes to be applied. -6 Build options - You can inspect CMake options by running grep OPTION on CMakeLists.txt in +7 Build options + You can inspect CMake options by running grep options on CMakeLists.txt in C:\cygwin64\home\rmills\gnu\exiv2\build>cd ..\trunk - C:\cygwin64\home\rmills\gnu\exiv2\trunk>grep OPTION CMakeLists.txt - OPTION( EXIV2_ENABLE_SHARED "Build exiv2 as a shared library (dll)" ON ) - OPTION( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) - OPTION( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) - OPTION( EXIV2_ENABLE_VIDEO "Build with video support" OFF ) - OPTION( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) - OPTION( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) - OPTION( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) - OPTION( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) - OPTION( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) - OPTION( EXIV2_ENABLE_BUILD_SAMPLES "Build the unit tests" ON ) - OPTION( EXIV2_ENABLE_BUILD_PO "Build translations files" OFF ) - OPTION( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) - OPTION( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) - OPTION( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) - OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) - OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) - - C:\cygwin64\home\rmills\gnu\exiv2\trunk> - -7 Running the test suite + C:\cygwin64\home\rmills\gnu\github\exiv2\exiv2>grep option CMakeLists.txt + # options and their default values + option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) + option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) + option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) + option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) + option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) + option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) + option( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) + option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) + option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) + option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) + option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) + option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) + option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) + option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) + option( EXIV2_BUILD_SAMPLES "Build sample applications" ON ) + option( EXIV2_BUILD_PO "Build translations files" OFF ) + option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON ) + +8 Running the test suite http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2 You can run the test-suite directly from cmakeBuild.cmd with the argument --test You need cygwin's bash.exe to run the test suite. -8 Building with different versions of the support libraries +9 Building with different versions of the support libraries You can change the standard libraries. For example, to build with curl-7.39.0 1) set _CURL_=curl-7.39.0 2) add curl-7.39.0.tar.gz in your build directory @@ -204,14 +239,15 @@ How to use this 1) set _OPENSSL_=openssl-1.0.1j 2) add openssl-1.0.1j-vs2015.zip into your build directory -9 Rebuilding with VS 2005/8/10/12/13/15 32/64 +9 Rebuilding with VS 2005/8/10/12/13/15/17 32/64 The script cmakeBuildAll.cmd is provided for convenience: cmakeBuildAll.cmd --test > rebuildAll.txt To view progress, open another shell: tail -f rebuildAll.txt cmakeBuildAll.cmd takes about a hour if you don't specify --webready - 12 build+test cycles of about 5 minutes each. - With webready, 12 build+test cycles of 12 minutes = 2.5 hours + 14 build+test cycles of about 5 minutes each. Just over 1 hour. + With webready, 14 build+test cycles of 12 minutes = 3 hours Robin Mills robin@clanmills.com +Updated: 2017-09-05 diff --git a/contrib/cmake/msvc/cmakeBuild.cmd b/contrib/cmake/msvc/cmakeBuild.cmd index c44ca0d7..2b8fd4ff 100755 --- a/contrib/cmake/msvc/cmakeBuild.cmd +++ b/contrib/cmake/msvc/cmakeBuild.cmd @@ -17,16 +17,18 @@ if /I "%1" == "--zlib" set "_ZLIB_=%2"& shift if /I "%1" == "--help" call:Help && goto end if /I "%1" == "--dryrun" set "_DRYRUN_=1" -if /I "%1" == "--nosamples" set "_NOSAMPLES_=1" +if /I "%1" == "--samples" set "_SAMPLES_=1" if /I "%1" == "--pause" set "_PAUSE_=1" if /I "%1" == "--rebuild" set "_REBUILD_=1" if /I "%1" == "--silent" set "_SILENT_=1" if /I "%1" == "--static" set "_MODE_=static" -if /I "%1" == "--test" set "_TEST_=1" +if /I "%1" == "--test" (set "_TEST_=1" & set _SAMPLES_=1) if /I "%1" == "--trace" set ("_VERBOSE_=1 && echo on)" if /I "%1" == "--verbose" set "_VERBOSE_=1" if /I "%1" == "--video" set "_VIDEO_=1" if /I "%1" == "--webready" set "_WEBREADY_=1" +if /I "%1" == "--unicode" set "_UNICODE_=ON" +if /I "%1" == "--nls" set "_NLS_=ON" shift if not (%1) EQU () goto GETOPTS @@ -34,8 +36,8 @@ goto main :help call cmakeDefaults >NUL 2>NUL -echo Options: --help ^| --webready ^| --rebuild ^| --video ^| --static -echo. --silent ^| --verbose ^| --pause ^| --dryrun ^| --test ^| --trace +echo Options: --help ^| --webready ^| --rebuild ^| --video ^| --static ^| --unicode ^| --nls +echo. --silent ^| --verbose ^| --pause ^| --dryrun ^| --test ^| --samples ^| --trace echo. --exiv2 %_EXIV2_% ^| --work %_WORK_% ^| --config %_CONFIG_% ^| --generator generator echo. --zlib %_ZLIB_% ^| --expat %_EXPAT_% ^| --curl %_CURL_% ^| --libssh %_LIBSSH_% echo. --bash %_BASH_% @@ -56,7 +58,9 @@ echo.incpath = %_INCPATH_% echo.libpath = %_LIBPATH_% echo.libssh = %_LIBSSH_% echo.mode = %_MODE_% +echo.nls = %_NLS_% echo.openssl = %_OPENSSL_% +echo.unicode = %_UNICODE_% echo.work = %_WORK_% echo.test = %_TEST_% echo.video = %_VIDEO_% @@ -91,6 +95,7 @@ IF NOT EXIST "%VSINSTALLDIR%" ( GOTO error_end ) +if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\" set "_VS_=2017" && set "_VC_=15" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\" set "_VS_=2015" && set "_VC_=14" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\" set "_VS_=2013" && set "_VC_=12" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\" set "_VS_=2012" && set "_VC_=11" @@ -287,12 +292,12 @@ pushd "%EXIV_B%" set ENABLE_SHARED=OFF set ENABLE_DYNAMIC=OFF ) - set BUILD_SAMPLES=ON - if DEFINED _NOSAMPLES_ set BUILD_SAMPLES=OFF + set BUILD_SAMPLES=OFF + if DEFINED _SAMPLES_ set BUILD_SAMPLES=ON - call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% ^ - -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_BUILD_SAMPLES=%BUILD_SAMPLES% ^ - -DEXIV2_ENABLE_WIN_UNICODE=OFF -DEXIV2_ENABLE_SHARED=%ENABLE_SHARED% ^ + call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% ^ + -DEXIV2_ENABLE_NLS=%_NLS_% -DEXIV2_ENABLE_BUILD_SAMPLES=%BUILD_SAMPLES% ^ + -DEXIV2_ENABLE_WIN_UNICODE=%_UNICODE_% -DBUILD_SHARED_LIBS=%ENABLE_SHARED% ^ -DEXIV2_ENABLE_DYNAMIC_RUNTIME=%ENABLE_DYNAMIC% ^ %ENABLE_WEBREADY% %ENABLE_CURL% %ENABLE_LIBSSH% %ENABLE_VIDEO% ^ "%_EXIV2_%" @@ -327,12 +332,12 @@ if defined _TEST_ ( rem ----------------------------------------- rem Exit -rem end syntax: goto end +rem end syntax: GOTO end :end endlocal exit /b 0 -rem end with an error syntax: call:error_end +rem end with an error syntax: GOTO error_end :error_end endlocal exit /b 1 @@ -389,7 +394,20 @@ pushd "%LOB_B%" echo "*** warning: build errors in %LOB% ***" ) - call:run cmake --build . --config %_CONFIG_% --target install + rem --static expat fails to install on VS 2010+ + set buildLibInstallExpatStatic=0 + if /I "%_TARGET_%" == "--target expat" if /I "%_MODE_%" == "static" set buildLibInstallExpatStatic=1 + + if /I "%buildLibInstallExpatStatic%" == "1" ( + rem msvc\expat-2.1.0\lib\expat*.h => msvc\dist\2005\x64\static\Release\include + call:run copy/y "%_BUILDDIR_%\%LOB%\lib\expat*.h" "%_ONCPATH_%" + + rem msvc\work\expat-2.1.0\release\*.lib => msvc\dist\2005\x64\static\Release\lib + call:run copy/y "%_WORK_%\%LOB%\%_CONFIG_%\*.lib" "%_INSTALL_%\lib" + ) else ( + call:run cmake --build . --config %_CONFIG_% --target install + ) + IF errorlevel 1 ( echo "*** warning: install errors in %LOB% ***" ) diff --git a/contrib/cmake/msvc/cmakeDefaults.cmd b/contrib/cmake/msvc/cmakeDefaults.cmd index 8dd5aa55..ec3a9225 100755 --- a/contrib/cmake/msvc/cmakeDefaults.cmd +++ b/contrib/cmake/msvc/cmakeDefaults.cmd @@ -13,7 +13,9 @@ if NOT DEFINED _ZLIB_ SET _ZLIB_=zlib-1.2.8 if NOT DEFINED _EXPAT_ SET _EXPAT_=expat-2.1.0 if NOT DEFINED _BASH_ SET _BASH_=c:\cygwin64\bin\bash.exe if NOT DEFINED _MODE_ SET _MODE_=dll -if NOT DEFINED COPYCMD SET COPYCMD=/Y +if NOT DEFINED _UNICODE_ SET _UNICODE_=OFF +if NOT DEFINED _NLS_ SET _NLS_=OFF +if NOT DEFINED COPYCMD SET COPYCMD=/Y rem ---------- check that EXIV2 exists echo checking that %_EXIV2_% exists diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index a15da0f8..be6b8c39 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -1,29 +1,25 @@ -# CMake build system for exiv2 library and executables -# Copyright 2008 by Patrick Spendrin -# Copyright 2010-2012 by Gilles Caulier -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# CMakeLists.txt for i18n files -# automatically include all po files in the directory -FILE(GLOB PO_FILES *.po) - -UPDATE_TRANSLATIONS(exiv2 ${PO_FILES}) - -ADD_TRANSLATIONS(exiv2 ${PO_FILES}) +# include all po files in the directory +file(GLOB PO_FILES *.po) +update_translations(exiv2 ${PO_FILES}) +add_translations(exiv2 ${PO_FILES}) +## +# execute xgettext on every file add_custom_target( pot-update - COMMAND xgettext -d ${PACKAGE_NAME} - -s - -D ${CMAKE_CURRENT_SOURCE_DIR}/.. - -o ${PACKAGE_NAME}.pot - -p ${CMAKE_CURRENT_SOURCE_DIR}/ - --from-code=UTF-8 - --files-from=POTFILES.in - -j - --keyword=_ - --package-name=${PACKAGE_NAME} - --package-version=${PACKAGE_VERSION} - --copyright-holder=${PACKAGE_COPYRIGHT} - --msgid-bugs-address=${PACKAGE_BUGREPORT} - ) + COMMAND xgettext -d ${PACKAGE_NAME} + -s -D ${CMAKE_CURRENT_SOURCE_DIR}/.. + -o ${PACKAGE_NAME}.pot + -p ${CMAKE_CURRENT_SOURCE_DIR}/ + --from-code=UTF-8 --files-from=POTFILES.in + -j + --keyword=_ + --package-name=${PACKAGE_NAME} + --package-version=${PACKAGE_VERSION} + --copyright-holder=${PACKAGE_COPYRIGHT} + --msgid-bugs-address=${PACKAGE_BUGREPORT} +) + +# That's all Folks! +## diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 78119323..d7462a3a 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,41 +1,41 @@ -# CMake build system for exiv2 library and executables -# Copyright 2010-2012 Gilles Caulier -# Copyright 2008 Patrick Spendrin -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -set( SAMPLES addmoddel.cpp - convert-test.cpp - easyaccess-test.cpp - exifcomment.cpp - exifdata-test.cpp - exifdata.cpp - exifprint.cpp - exifvalue.cpp - ini-test.cpp - iotest.cpp - iptceasy.cpp - iptcprint.cpp - iptctest.cpp - key-test.cpp - largeiptc-test.cpp - mmap-test.cpp - prevtest.cpp - stringto-test.cpp - taglist.cpp - tiff-test.cpp - werror-test.cpp - write-test.cpp - write2-test.cpp - xmpparse.cpp - xmpparser-test.cpp - xmpprint.cpp - xmpsample.cpp - ) +# CMakeLists.txt for exiv2 library sample applications +set( SAMPLES + addmoddel.cpp + convert-test.cpp + easyaccess-test.cpp + exifcomment.cpp + exifdata-test.cpp + exifdata.cpp + exifprint.cpp + exifvalue.cpp + ini-test.cpp + iotest.cpp + iptceasy.cpp + iptcprint.cpp + iptctest.cpp + key-test.cpp + largeiptc-test.cpp + mmap-test.cpp + prevtest.cpp + stringto-test.cpp + taglist.cpp + tiff-test.cpp + werror-test.cpp + write-test.cpp + write2-test.cpp + xmpparse.cpp + xmpparser-test.cpp + xmpprint.cpp + xmpsample.cpp +) + +## +# build samples AND add them to the APPLICATIONS list foreach(entry ${SAMPLES}) string( REPLACE ".cpp" "" target ${entry}) add_executable( ${target} ${target}.cpp ) + list(APPEND APPLICATIONS ${target}) add_test( ${target}_test ${target} ) target_link_libraries( ${target} PRIVATE exiv2lib) install( TARGETS ${target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) @@ -44,20 +44,23 @@ endforeach() ################################### add_executable( metacopy metacopy.cpp ../src/utils.cpp) +list(APPEND APPLICATIONS metacopy) target_link_libraries( metacopy PRIVATE exiv2lib) target_include_directories(metacopy PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find utils.hpp -add_executable ( pathtest path-test.cpp ../src/utils.cpp) -set_target_properties( pathtest PROPERTIES OUTPUT_NAME path-test ) -target_link_libraries( pathtest PRIVATE exiv2lib) +add_executable( pathtest path-test.cpp ../src/utils.cpp) +list(APPEND APPLICATIONS pathtest) +set_target_properties( pathtest PROPERTIES OUTPUT_NAME path-test ) +target_link_libraries( pathtest PRIVATE exiv2lib) target_include_directories(pathtest PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find utils.hpp if(NOT EXV_HAVE_TIMEGM ) target_sources(pathtest PRIVATE ../src/localtime.c) endif() -add_executable( exiv2json exiv2json.cpp Jzon.cpp) -target_link_libraries( exiv2json PRIVATE exiv2lib) +add_executable( exiv2json exiv2json.cpp Jzon.cpp) +list(APPEND APPLICATIONS exiv2json) +target_link_libraries( exiv2json PRIVATE exiv2lib) install( TARGETS metacopy pathtest exiv2json RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) @@ -66,9 +69,10 @@ if (MSVC) target_sources(metacopy PRIVATE ../src/getopt_win32.c) endif() -if( EXIV2_ENABLE_XMP ) +if( EXPAT_FOUND ) add_executable( geotag geotag.cpp) - target_link_libraries( geotag PRIVATE exiv2lib ${ZLIB_LIBRARIES}) + list(APPEND APPLICATIONS geotag) + target_link_libraries( geotag PRIVATE exiv2lib ${EXPAT_LIBRARIES}) install( TARGETS geotag RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() @@ -76,17 +80,26 @@ endif() # connection test application add_executable(conntest conntest.cpp) target_link_libraries(conntest PRIVATE exiv2lib) - -# ****************************************************************************** -# exifprint application -# ADD_EXECUTABLE( exifprint exifprint.cpp ) -# target_link_libraries( exifprint exiv2lib ) +list(APPEND APPLICATIONS conntest) # ****************************************************************************** # remotetest application add_executable(remotetest remotetest.cpp) target_link_libraries(remotetest exiv2lib) +list(APPEND APPLICATIONS remotetest) + +# ****************************************************************************** +# set compiler -DEXV_HAVE_DLL when linking exiv2 dll +foreach(application ${APPLICATIONS}) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions(${application} PRIVATE EXV_HAVE_DLL ) + endif() +endforeach() + # ****************************************************************************** # Man page install( FILES exiv2samples.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) + +# That's all Folks! +## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4c5d7247..9984a891 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,145 +1,19 @@ -# CMake build system for exiv2 library and executables -# Copyright 2015- Daniel Kaneider -# Copyright 2010-2012 Gilles Caulier -# Copyright 2008 Patrick Spendrin - -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -# Private headers which are only needed for the library itself -set( LIBEXIV2_PRIVATE_HDR canonmn_int.hpp - casiomn_int.hpp - cr2image_int.hpp - crwimage_int.hpp - fujimn_int.hpp - makernote_int.hpp - minoltamn_int.hpp - nikonmn_int.hpp - olympusmn_int.hpp - orfimage_int.hpp - panasonicmn_int.hpp - pentaxmn_int.hpp - pngchunk_int.hpp - rcsid_int.hpp - rw2image_int.hpp - samsungmn_int.hpp - sigmamn_int.hpp - sonymn_int.hpp - tags_int.hpp - tiffcomposite_int.hpp - tifffwd_int.hpp - tiffimage_int.hpp - tiffvisitor_int.hpp - ) - -# Add standalone C++ header files to this list -set( LIBEXIV2_HDR ../include/exiv2/asfvideo.hpp - ../include/exiv2/basicio.hpp - ../include/exiv2/bmpimage.hpp - ../include/exiv2/config.h - ../include/exiv2/convert.hpp - ../include/exiv2/cr2image.hpp - ../include/exiv2/crwimage.hpp - ../include/exiv2/datasets.hpp - ../include/exiv2/easyaccess.hpp - ../include/exiv2/epsimage.hpp - ../include/exiv2/error.hpp - ../include/exiv2/exif.hpp - ../include/exiv2/exiv2.hpp - ../include/exiv2/futils.hpp - ../include/exiv2/gifimage.hpp - ../include/exiv2/http.hpp - ../include/exiv2/image.hpp - ../include/exiv2/ini.hpp - ../include/exiv2/iptc.hpp - ../include/exiv2/jp2image.hpp - ../include/exiv2/jpgimage.hpp - ../include/exiv2/matroskavideo.hpp - ../include/exiv2/metadatum.hpp - ../include/exiv2/mrwimage.hpp - ../include/exiv2/orfimage.hpp - ../include/exiv2/pgfimage.hpp - ../include/exiv2/preview.hpp - ../include/exiv2/properties.hpp - ../include/exiv2/psdimage.hpp - ../include/exiv2/quicktimevideo.hpp - ../include/exiv2/rafimage.hpp - ../include/exiv2/riffvideo.hpp - ../include/exiv2/rwlock.hpp - ../include/exiv2/rw2image.hpp - ../include/exiv2/tags.hpp - ../include/exiv2/tgaimage.hpp - ../include/exiv2/tiffimage.hpp - ../include/exiv2/types.hpp - ../include/exiv2/utilsvideo.hpp - ../include/exiv2/value.hpp - ../include/exiv2/version.hpp - ../include/exiv2/webpimage.hpp - ../include/exiv2/xmp_exiv2.hpp - ../include/exiv2/xmpsidecar.hpp - ../include/exiv2/utilsvideo.hpp - ${CMAKE_BINARY_DIR}/exv_conf.h - ) - -# Add library C++ source files to this list -set( LIBEXIV2_SRC asfvideo.cpp - basicio.cpp - bmpimage.cpp - canonmn.cpp - casiomn.cpp - convert.cpp - cr2image.cpp - crwedit.cpp - crwimage.cpp - datasets.cpp - easyaccess.cpp - epsimage.cpp - error.cpp - exif.cpp - futils.cpp - fujimn.cpp - gifimage.cpp - http.cpp - image.cpp - ini.cpp - iptc.cpp - jp2image.cpp - jpgimage.cpp - makernote.cpp - matroskavideo.cpp - metadatum.cpp - minoltamn.cpp - mrwimage.cpp - nikonmn.cpp - olympusmn.cpp - orfimage.cpp - panasonicmn.cpp - pentaxmn.cpp - pgfimage.cpp - preview.cpp - properties.cpp - psdimage.cpp - quicktimevideo.cpp - rafimage.cpp - riffvideo.cpp - rw2image.cpp - samsungmn.cpp - sigmamn.cpp - sonymn.cpp - tags.cpp - tgaimage.cpp - tiffcomposite.cpp - tiffimage.cpp - tiffvisitor.cpp - types.cpp - utilsvideo.cpp - value.cpp - version.cpp - webpimage.cpp - xmp.cpp - xmpsidecar.cpp - utilsvideo.cpp - ) +# CMakeLists.txt for exiv2 library and command-line program + +# list of public C++ include files +file(GLOB LIBEXIV2_HDR ../include/exiv2/*.hpp) +list(APPEND LIBEXIV2_HDR ${CMAKE_BINARY_DIR}/exv_conf.h) + +# list of internal include files only required to build the library +file(GLOB LIBEXIV2_PRIVATE_HDR *_int.hpp) + +# list of library C++ source files +file(GLOB LIBEXIV2_SRC *.cpp) +# remove files which are not part of the library +file(GLOB LIBEXIV2_SRC_NOT actions.cpp exiv2.cpp *test.cpp crwparse.cpp mrwthumb.cpp xmpdump.cpp) +foreach(entry ${LIBEXIV2_SRC_NOT}) + list(REMOVE_ITEM LIBEXIV2_SRC ${entry}) +endforeach() if( EXIV2_ENABLE_WEBREADY ) if( EXIV2_ENABLE_CURL) @@ -166,20 +40,24 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # exiv2lib library if( EXIV2_ENABLE_XMP AND NOT EXIV2_ENABLE_LIBXMP ) - add_library( exiv2lib ${STATIC_FLAG} ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR} $) - target_link_libraries(exiv2lib PUBLIC ${EXPAT_LIBRARIES}) + add_library( exiv2lib ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR} $) else() - add_library( exiv2lib ${STATIC_FLAG} ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR}) + add_library( exiv2lib ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR}) +endif() +if ( BUILD_SHARED_LIBS ) + target_link_libraries(exiv2lib PUBLIC ${EXPAT_LIBRARIES}) endif() set_target_properties( exiv2lib PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} - DEFINE_SYMBOL EXV_BUILDING_LIB OUTPUT_NAME exiv2 ) -target_compile_definitions(exiv2lib PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" ) +target_compile_definitions(exiv2lib PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" EXV_BUILDING_LIB ) +if ( BUILD_SHARED_LIBS ) + target_compile_definitions(exiv2lib PRIVATE EXV_HAVE_DLL ) +endif() if ( UNIX AND CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" ) set (FREEBSD 1) @@ -206,11 +84,10 @@ endif() if ( MSVC ) target_compile_definitions(exiv2lib PRIVATE PSAPI_VERSION=1) # to be compatible with <= WinVista (#905) - if ( EXIV2_ENABLE_STATIC ) - target_link_libraries( exiv2lib zlibstatic ${ZLIB_LIBRARIES} ) - else() + if( EXIV2_ENABLE_PNG ) target_link_libraries( exiv2lib PRIVATE ${ZLIB_LIBRARIES} ) endif() + source_group("Header Files" FILES ${LIBEXIV2_HDR} ) source_group("Header Files" FILES ${LIBCURL_HDR} ) source_group("Header Files" FILES ${SSH_HDR} ) @@ -218,7 +95,7 @@ if ( MSVC ) else() # TODO: Check if this is really needed. if ( UNIX AND NOT FREEBSD ) - target_link_libraries( exiv2lib PRIVATE dl) + target_link_libraries( exiv2lib PRIVATE dl) # -ldl = dynamic loader used by src/version.cpp endif() target_link_libraries( exiv2lib PRIVATE Threads::Threads) target_link_libraries( exiv2lib PUBLIC ${CURL_LIBRARIES} ${SSH_LIBRARIES}) @@ -256,18 +133,22 @@ install(FILES ${LIBEXIV2_HDR} # ****************************************************************************** # exiv2 application -set( EXIV2_SRC exiv2.cpp - exiv2app.hpp - actions.cpp - actions.hpp - utils.cpp - utils.hpp +set( EXIV2_SRC + exiv2.cpp + exiv2app.hpp + actions.cpp + actions.hpp + utils.cpp + utils.hpp ) -if(EXIV2_ENABLE_TOOLS) +if(EXIV2_BUILD_EXIV2_COMMAND) add_executable( exiv2 ${EXIV2_SRC} ) target_compile_definitions(exiv2 PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" ) target_link_libraries( exiv2 PRIVATE exiv2lib ) + if ( BUILD_SHARED_LIBS ) + target_compile_definitions(exiv2 PRIVATE EXV_HAVE_DLL ) + endif() install(TARGETS exiv2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() @@ -288,3 +169,6 @@ endif() # ****************************************************************************** # Man page install( FILES exiv2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) + +# That's all Folks! +## diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt index 68a8eab3..48258bfe 100644 --- a/xmpsdk/CMakeLists.txt +++ b/xmpsdk/CMakeLists.txt @@ -1,36 +1,7 @@ -# CMake build system for exiv2 library and executables -# Copyright 2010-2012 Gilles Caulier -# Copyright 2008 Patrick Spendrin +# CMakeLists.txt exiv2/xmpsdk -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -set(XMPSRC src/ExpatAdapter.cpp - src/MD5.cpp - src/ParseRDF.cpp - src/UnicodeConversions.cpp - src/WXMPIterator.cpp - src/WXMPMeta.cpp - src/WXMPUtils.cpp - src/XML_Node.cpp - src/XMPCore_Impl.cpp - src/XMPIterator.cpp - src/XMPMeta-GetSet.cpp - src/XMPMeta-Parse.cpp - src/XMPMeta-Serialize.cpp - src/XMPMeta.cpp - src/XMPUtils-FileInfo.cpp - src/XMPUtils.cpp - include/MD5.h - include/TXMPIterator.hpp - include/TXMPMeta.hpp - include/TXMPUtils.hpp - include/XMP_Const.h - include/XMP_Environment.h - include/XMP.incl_cpp - include/XMPSDK.hpp - include/XMP_Version.h -) +# list files to be use to build XMPsdk +file(GLOB XMPSRC src/*.cpp include/*.h include/*.hpp) foreach(_currentfile ${XMPSRC}) if(UNIX AND NOT CYGWIN) @@ -38,7 +9,7 @@ foreach(_currentfile ${XMPSRC}) endif() endforeach() -# We generate a CMake OBJECT LIBRARY (a bunch of object files) +# CMake OBJECT LIBRARY (collection of object files) add_library( xmp_object OBJECT ${XMPSRC} ) target_include_directories(xmp_object PRIVATE ${EXPAT_INCLUDE_DIR}) @@ -67,3 +38,6 @@ if( EXIV2_ENABLE_LIBXMP ) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() + +# That's all Folks! +## From b9ccc70bcc6a2e579c6d214a232d0ab686da5e3b Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 8 Sep 2017 22:44:54 +0100 Subject: [PATCH 09/29] Bug fixes in cmakeBuild.cmd. --config Debug works correctly. Documentation update. Remove 'u' postfix ABI incompatibility. --- CMakeLists.txt | 7 +- contrib/cmake/msvc/ReadMe.txt | 48 ++++---- contrib/cmake/msvc/cltest.cpp | 2 +- contrib/cmake/msvc/cmakeBuild.cmd | 161 +++++++++++++++++---------- contrib/cmake/msvc/cmakeBuildAll.cmd | 2 +- contrib/cmake/msvc/cmakeDefaults.cmd | 26 ++--- 6 files changed, 144 insertions(+), 102 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bcdcb3a..16f80809 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,12 +55,7 @@ if( EXIV2_ENABLE_COMMERCIAL ) endif() if( MSVC ) - if ( EXIV2_ENABLE_WIN_UNICODE ) - set(CMAKE_DEBUG_POSTFIX "du") - set(CMAKE_RELEASE_POSTFIX "u") - else() - set(CMAKE_DEBUG_POSTFIX "d") - endif() + set(CMAKE_DEBUG_POSTFIX "d") endif() if( EXIV2_ENABLE_XMP ) diff --git a/contrib/cmake/msvc/ReadMe.txt b/contrib/cmake/msvc/ReadMe.txt index 4c8ce5fa..b8b213ca 100755 --- a/contrib/cmake/msvc/ReadMe.txt +++ b/contrib/cmake/msvc/ReadMe.txt @@ -32,16 +32,16 @@ How to use this out of this - provided Visual Studio is installed in %ProgramFiles(x86)% %ProgramFiles(x86)% is usually c:\Program Files (x86) - vcvars 2005 # sets 2005 x86 - vcvars 2010 64 # sets 2010 x86_amd64 + vcvars 2005 32 # sets 2005 x86 + vcvars 2010 64 # sets 2010 amd64 2 Always build "out of source". I recommend: cd \contrib\cmake\cmake cmd.exe - vcvars 2015 64 - cmakeBuild --help # display syntax and options - cmakeBuild --rebuild - .... + vcvars 2015 64 + cmakeBuild --help # display syntax and options + cmakeBuild --build + .... exit +-------------------------------------------------------+ @@ -67,26 +67,28 @@ How to use this 3 Options C:\Users\rmills\gnu\github\clanmills\exiv2\contrib\cmake\msvc>cmakeBuild --help - Options: --help | --webready | --rebuild | --video | --static | --unicode | --nls - --silent | --verbose | --pause | --dryrun | --test | --trace + Options: --help | --silent | --verbose | --pause | --dryrun | --trace | --test + --build | --static | --unicode | --nls | --webready | --video | --samples --exiv2 C:\Users\rmills\gnu\github\clanmills\exiv2 | --work work | --config Release | --generator generator --zlib zlib-1.2.8 | --expat expat-2.1.0 | --curl curl-7.45.0 | --libssh libssh-0.7.2 --bash c:\cygwin64\bin\bash.exe Option switches. --help Print help message and quit - --webready Build and Link the webready feature - --rebuild Delete "relics" from a previous build such as CMakeBuild.txt - --video Build and link video support - --static Build and link static libraries and programs - --nosamples Do not build sample applications - --unicode Build UNICODE path support - --nls Build with Natural Language Support --silent Run script with minimal "chatter" --verbose Run script with maximum "chatter" - --trace Show commands begin executed by the script + --pause Pause at every build step --dryrun Don't build anything. Report and quit + --trace Show commands begin executed by the script (implies --build --samples) --test Execute the test suite after the build + + --build Build the code + --static Build and link static libraries and programs + --unicode Build UNICODE path support + --nls Build with Natural Language Support + --webready Build and Link the webready feature + --video Build and link video support + --samples Include samples in projects Option/values (See section 9 below) --zlib zlib-1.2.8 @@ -95,13 +97,13 @@ How to use this --libssh libssh-0.7.2 Other build key/value pairs: - --config Release | Debug + --config Release | Debug (shorthand = --release --debug) --generator The script default is almost always correct and is passed as -G "Generator" to CMake --work The "work" directory in which the build will be performed (see 4 below) --bash Path to bash.exe to be used when --test is specified. 4 What gets built? - The build is performed in work + The build is performed in work_Config The output is generated in dist dist\..mumble..\bin contains *.exe and *.dll files dist\..mumble..\lib contains *.lib files @@ -109,10 +111,10 @@ How to use this mumble identifies the compiler and build. Example C:\gnu\github\exiv2\contrib\cmake\msvc\dist\2013\x64\dll\Release\bin - 2013 = Visual Studio Choices: 2005/2008/2010/2012/2013/2015 - x64 = 64 bit build Win32/x64 - dll = shared library dll/static - Release = configuration Release/Debug/RelWithDebInfo/MinSizeRel + 2013 = Visual Studio Choices: 2005 | 2008 | 2010 | 2012 | 2013 | 2015 | 2017 + x64 = 64 bit build Win32 | x64 + dll = shared library dll | static + Release = configuration Release | Debug | RelWithDebInfo | MinSizeRel 5 Building manually with CMake The cmake option -G Generator should be chosen for the version of Visual Studio installed. @@ -250,4 +252,4 @@ How to use this Robin Mills robin@clanmills.com -Updated: 2017-09-05 +Updated: 2017-09-08 diff --git a/contrib/cmake/msvc/cltest.cpp b/contrib/cmake/msvc/cltest.cpp index 9d7a741a..3531ebb9 100644 --- a/contrib/cmake/msvc/cltest.cpp +++ b/contrib/cmake/msvc/cltest.cpp @@ -2,7 +2,7 @@ int main(int,const char**) { - const char* vs[] = { "unknown" , "2005", "2008", "2010", "2012", "2013", "2015" }; + const char* vs[] = { "unknown" , "2005", "2008", "2010", "2012", "2013", "2015","2017" }; int v = (_MSC_VER-1300)/100; if ( v < 0 || v >= (sizeof(vs)/sizeof(vs[0])) ) v = 0; fprintf(stderr,"_%s = %d (%s) sizeof(void*) = %d\n","MSC_VER",_MSC_VER,vs[v],(int)sizeof(void*)); diff --git a/contrib/cmake/msvc/cmakeBuild.cmd b/contrib/cmake/msvc/cmakeBuild.cmd index 2b8fd4ff..1e1d3bf9 100755 --- a/contrib/cmake/msvc/cmakeBuild.cmd +++ b/contrib/cmake/msvc/cmakeBuild.cmd @@ -1,43 +1,68 @@ @echo off setlocal enableextensions +rem ---- +rem always run this script in /contrib/cmake/msvc +cd %~dp0 + set "_BUILDDIR_=%CD%" +call:echo calling cmakeDefaults.cmd +call cmakeDefaults.cmd +IF ERRORLEVEL 1 ( + echo "*** cmakeDefaults.cmd has failed ***" >&2 + GOTO error_end +) :GETOPTS -if /I "%1" == "--bash" set "_BASH_=%2"& shift -if /I "%1" == "--config" set "_CONFIG_=%2"& shift -if /I "%1" == "--curl" set "_CURL_=%2"& shift -if /I "%1" == "--exiv2" set "_EXIV2_=%2"& shift -if /I "%1" == "--expat" set "_EXPAT_=%2"& shift -if /I "%1" == "--generator" set "_GENERATOR_=%2"& shift -if /I "%1" == "--openssl" set "_OPENSSL_=%2"& shift -if /I "%1" == "--libssh" set "_LIBSSH_=%2"& shift -if /I "%1" == "--work" set "_WORK_=%2"& shift -if /I "%1" == "--zlib" set "_ZLIB_=%2"& shift +set _CLAIMED_=0 +if /I "%1" == "--bash" call:set "_BASH_=%2"& shift +if /I "%1" == "--config" call:set "_CONFIG_=%2"& shift +if /I "%1" == "--curl" call:set "_CURL_=%2"& shift +if /I "%1" == "--exiv2" call:set "_EXIV2_=%2"& shift +if /I "%1" == "--expat" call:set "_EXPAT_=%2"& shift +if /I "%1" == "--generator" call:set "_GENERATOR_=%2"& shift +if /I "%1" == "--openssl" call:set "_OPENSSL_=%2"& shift +if /I "%1" == "--libssh" call:set "_LIBSSH_=%2"& shift +if /I "%1" == "--work" call:set "_WORK_=%2"& shift +if /I "%1" == "--zlib" call:set "_ZLIB_=%2"& shift if /I "%1" == "--help" call:Help && goto end -if /I "%1" == "--dryrun" set "_DRYRUN_=1" -if /I "%1" == "--samples" set "_SAMPLES_=1" -if /I "%1" == "--pause" set "_PAUSE_=1" -if /I "%1" == "--rebuild" set "_REBUILD_=1" -if /I "%1" == "--silent" set "_SILENT_=1" -if /I "%1" == "--static" set "_MODE_=static" -if /I "%1" == "--test" (set "_TEST_=1" & set _SAMPLES_=1) -if /I "%1" == "--trace" set ("_VERBOSE_=1 && echo on)" -if /I "%1" == "--verbose" set "_VERBOSE_=1" -if /I "%1" == "--video" set "_VIDEO_=1" -if /I "%1" == "--webready" set "_WEBREADY_=1" -if /I "%1" == "--unicode" set "_UNICODE_=ON" -if /I "%1" == "--nls" set "_NLS_=ON" +if /I "%1" == "--dryrun" call:set "_DRYRUN_=1" +if /I "%1" == "--build" call:set "_BUILD_=1" +if /I "%1" == "--samples" call:set "_SAMPLES_=1" +if /I "%1" == "--pause" call:set "_PAUSE_=1" +if /I "%1" == "--silent" call:set "_SILENT_=1" +if /I "%1" == "--static" call:set "_SHARED_=0" +if /I "%1" == "--shared" call:set "_SHARED_=1" +if /I "%1" == "--dll" call:set "_SHARED_=1" +if /I "%1" == "--test" call:set "_TEST_=1" +if /I "%1" == "--trace" call:set "_TRACE_=1" +if /I "%1" == "--verbose" call:set "_VERBOSE_=1" +if /I "%1" == "--video" call:set "_VIDEO_=1" +if /I "%1" == "--webready" call:set "_WEBREADY_=1" +if /I "%1" == "--unicode" call:set "_UNICODE_=1" +if /I "%1" == "--ascii" call:set "_UNICODE_=0" +if /I "%1" == "--nls" call:set "_NLS_=1" +if /I "%1" == "--debug" call:set "_CONFIG_=Debug" +if /I "%1" == "--release" call:set "_CONFIG_=Release" + +if /I "%_CLAIMED_%" == "0" ( + echo "*** unknown command argument %1 ***" >&2 + goto error_end +) shift if not (%1) EQU () goto GETOPTS goto main +:set +set %1 +set _CLAIMED_=1 +exit /b 0 + :help -call cmakeDefaults >NUL 2>NUL -echo Options: --help ^| --webready ^| --rebuild ^| --video ^| --static ^| --unicode ^| --nls -echo. --silent ^| --verbose ^| --pause ^| --dryrun ^| --test ^| --samples ^| --trace +echo Options: --help ^| --silent ^| --verbose ^| --pause ^| --dryrun ^| --trace ^| --test +echo. --build ^| --static ^| --unicode ^| --nls ^| --webready ^| --video ^| --samples echo. --exiv2 %_EXIV2_% ^| --work %_WORK_% ^| --config %_CONFIG_% ^| --generator generator echo. --zlib %_ZLIB_% ^| --expat %_EXPAT_% ^| --curl %_CURL_% ^| --libssh %_LIBSSH_% echo. --bash %_BASH_% @@ -48,40 +73,40 @@ echo.&&echo.&&echo. echo.------ cmakeBuild Settings ---------- echo.bash = %_BASH_% echo.binpath = %_BINPATH_% +echo.build = %_BUILD_% echo.builddir = %_BUILDDIR_% echo.config = %_CONFIG_% echo.curl = %_CURL_% +echo.dryrun = %_DRYRUN_% echo.exiv2 = %_EXIV2_% echo.expat = %_EXPAT_% echo.generator = %_GENERATOR_% +echo.install = %_INSTALL_% echo.incpath = %_INCPATH_% echo.libpath = %_LIBPATH_% echo.libssh = %_LIBSSH_% -echo.mode = %_MODE_% echo.nls = %_NLS_% echo.openssl = %_OPENSSL_% -echo.unicode = %_UNICODE_% -echo.work = %_WORK_% +echo.platform = %PLATFORM% +echo.samples = %_SAMPLES_% +echo.shared = %_SHARED_% echo.test = %_TEST_% -echo.video = %_VIDEO_% +echo.unicode = %_UNICODE_% echo.vc = %_VC_% +echo.video = %_VIDEO_% echo.vs = %_VS_% echo.webready = %_WEBREADY_% +echo.work = %_WORK_% echo.zlib = %_ZLIB_% echo.&&echo.&&echo. exit /b 0 :main +call:report if NOT DEFINED _SILENT_ set _VERBOSE_=1 set _UNSUPPORTED_= rem ---- -call:echo calling cmakeDefaults.cmd -call cmakeDefaults -IF ERRORLEVEL 1 ( - echo "*** cmakeDefaults.cmd has failed ***" >&2 - GOTO error_end -) call:echo _EXIV2_ = %_EXIV2_% rem ---- @@ -110,11 +135,17 @@ if NOT DEFINED _VS_ ( ) call:echo testing architecture -if "%PROCESSOR_ARCHITECTURE%" EQU "x86" ( +set _ARCH_=64 +if /I "%PROCESSOR_ARCHITECTURE%" == "x86" set _ARCH_=32 +if /I "%VSCMD_ARG_HOST_ARCH%" == "x86" set _ARCH_=32 + +if /I "%_ARCH_%" == "32" ( set Platform=Win32 set RawPlatform=x86 set CpuPlatform=ia32 -) ELSE ( +) + +if NOT DEFINED Platform ( set Platform=x64 set RawPlatform=x64 set CpuPlatform=intel64 @@ -169,23 +200,36 @@ IF ERRORLEVEL 1 ( GOTO error_end ) +rem ---- +call:echo fix ups +set _WORK_=%_WORK_%_%_CONFIG_% +if DEFINED _TRACE_ ( + set _VERBOSE_=1 + echo on +) +if DEFINED _TEST_ ( + set _SAMPLES_=1 + set _BUILD_=1 +) +if /I "%_SHARED_%" == "1" set _MODE_=dll +if /I "%_SHARED_%" == "0" set _MODE_=static + rem ---- call:echo testing work directory _WORK_ = %_WORK_% -if defined _REBUILD_ if EXIST "%_WORK_%" rmdir/s/q "%_WORK_%" -if defined _REBUILD_ del/s CMakeCache.txt >NUL 2>NUL +if EXIST "%_WORK_%" rmdir/s/q "%_WORK_%" +del/s CMakeCache.txt >NUL 2>NUL IF NOT EXIST "%_WORK_%" mkdir "%_WORK_%" pushd "%_WORK_%" -set "_WORK_=%CD%" +set "_WORK_=%CD%" popd -call:echo _WORK_ = %_WORK_% +call:echo _WORK_ = %_WORK_% rem ---- call:echo testing INSTALL SET _INSTALL_=dist\%_VS_%\%Platform%\%_MODE_%\%_CONFIG_% if NOT EXIST %_INSTALL_% mkdir %_INSTALL_% -IF NOT EXIST %_INSTALL_% mkdir %_INSTALL_% pushd %_INSTALL_% -set "_INSTALL_=%CD%" + set "_INSTALL_=%CD%" popd call:echo _INSTALL_ = %_INSTALL_% @@ -204,8 +248,7 @@ if defined _TEST_ if NOT EXIST "%_BASH_%" ( if NOT DEFINED _GENERATOR_ set "_GENERATOR_=%VS_CMAKE%" if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles" - -if /I "%_MODE_%" == "static" "_LINK_=-DCMAKE_LINK=static" +if /I "%_SHARED_%" == "0" set _LINK_="-DCMAKE_LINK=static" call:cltest call:report @@ -218,10 +261,10 @@ call:buildLib %_ZLIB_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% echo ---------- EXPAT building with cmake ----------------- set "_TARGET_=--target expat" -if /I "%_MODE_%" == "static" ( - call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DBUILD_shared=0 -DCMAKE_C_FLAGS_RELEASE=/MT -DBUILD_examples=0 -DBUILD_tests=0 +if /I "%_SHARED_%" == "0" ( + call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DBUILD_shared=0 -DCMAKE_C_FLAGS_RELEASE=/MT -DCMAKE_C_FLAGS_DEBUG=/MTd -DBUILD_examples=0 -DBUILD_tests=0 ) else ( - call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% + call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DBUILD_examples=0 -DBUILD_tests=0 ) set _TARGET_= @@ -244,7 +287,7 @@ if DEFINED _WEBREADY_ ( call:buildLib %_CURL_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% -DWITH_GSSAPI=OFF -DWITH_ZLIB=OFF -DWITH_SFTP=OFF -DWITH_SERVER=OFF -DWITH_EXAMPLES=OFF -DWITH_NACL=OFF -DWITH_PCAP=OFF -DCMAKE_USE_LIBSSH2=OFF -DCMAKE_USE_LIBSSH=OFF if errorlevel 1 set _WEBREADY_= ) ELSE ( - if defined _REBUILD_ rmdir/s/q "%_ONCPATH_%\curl" >NUL 2>NUL + rmdir/s/q "%_ONCPATH_%\curl" >NUL 2>NUL if NOT EXIST "%_ONCPATH_%"\curl ( echo ---------- CURL building with nmake ----------------- IF NOT EXIST %_CURL_%.tar.gz svn export svn://dev.exiv2.org/svn/team/libraries/%_CURL_%.tar.gz >NUL @@ -273,8 +316,8 @@ if NOT DEFINED _WEBREADY_ set _CURL_= && set _LIBSSH_= echo ---------- EXIV2 building with cmake ------------------ set "EXIV_B=%_WORK_%\exiv2" -if defined _REBUILD_ IF EXIST "%EXIV_B%" rmdir/s/q "%EXIV_B%" -IF NOT EXIST "%EXIV_B%" mkdir "%EXIV_B%" +IF EXIST "%EXIV_B%" rmdir/s/q "%EXIV_B%" +IF NOT EXIST "%EXIV_B%" mkdir "%EXIV_B%" pushd "%EXIV_B%" set ENABLE_CURL=-DEXIV2_ENABLE_CURL=OFF @@ -308,14 +351,16 @@ pushd "%EXIV_B%" goto error_end ) - call:run cmake --build . --config %_CONFIG_% + rem if DEFINED _BUILDX_ devenv %_WORK_%\exiv2\exiv2.sln /Build "%_CONFIG_%|%Platform%" /ProjectConfig INSTALL + + if DEFINED _BUILD_ call:run cmake --build . --config %_CONFIG_% IF errorlevel 1 ( echo "*** build errors in EXIV2 ***" >&2 popd goto error_end ) - call:run cmake --build . --config %_CONFIG_% --target install + if DEFINED _BUILD_ call:run cmake --build . --config %_CONFIG_% --target install IF errorlevel 1 ( echo "*** install errors in EXIV2 ***" >&2 popd @@ -349,7 +394,7 @@ rem echo (or don't if --silent). syntax: call:echo args ... if NOT DEFINED _SILENT_ echo %*% exit /b 0 -rem run a command. syntax call:run args +rem run a command. syntax call:run args :run if defined _VERBOSE_ ( echo. @@ -397,14 +442,14 @@ pushd "%LOB_B%" rem --static expat fails to install on VS 2010+ set buildLibInstallExpatStatic=0 if /I "%_TARGET_%" == "--target expat" if /I "%_MODE_%" == "static" set buildLibInstallExpatStatic=1 - + if /I "%buildLibInstallExpatStatic%" == "1" ( rem msvc\expat-2.1.0\lib\expat*.h => msvc\dist\2005\x64\static\Release\include call:run copy/y "%_BUILDDIR_%\%LOB%\lib\expat*.h" "%_ONCPATH_%" rem msvc\work\expat-2.1.0\release\*.lib => msvc\dist\2005\x64\static\Release\lib call:run copy/y "%_WORK_%\%LOB%\%_CONFIG_%\*.lib" "%_INSTALL_%\lib" - ) else ( + ) else ( call:run cmake --build . --config %_CONFIG_% --target install ) @@ -452,7 +497,7 @@ exit /b 0 rem ----------------------------------------- rem this runs the compiler and reports _MSC_VER and sizeof(void*) -:cltest +:cltest pushd "%_EXIV2_%\contrib\cmake\msvc" nmake -a cltest.exe cltest.exe diff --git a/contrib/cmake/msvc/cmakeBuildAll.cmd b/contrib/cmake/msvc/cmakeBuildAll.cmd index 2c32f7a1..34772033 100755 --- a/contrib/cmake/msvc/cmakeBuildAll.cmd +++ b/contrib/cmake/msvc/cmakeBuildAll.cmd @@ -1 +1 @@ -for %%a in (32) do for %%v in (2010 2008 2005) do cmd /c "vcvars %%v %%a && cmakeBuild %* 2>&1" +for %%a in (64 32) do for %%v in (2017 2015 2005) do cmd /c "vcvars %%v %%a && cmakeBuild --build %* 2>&1" diff --git a/contrib/cmake/msvc/cmakeDefaults.cmd b/contrib/cmake/msvc/cmakeDefaults.cmd index ec3a9225..b1ee88cb 100755 --- a/contrib/cmake/msvc/cmakeDefaults.cmd +++ b/contrib/cmake/msvc/cmakeDefaults.cmd @@ -3,19 +3,19 @@ rem set up some defaults to be used by cmakeBuild.cmd and related scripts rem use environment strings to set defaults which will not be clobbered by this script -if not defined _CONFIG_ SET _CONFIG_=Release -if NOT DEFINED _WORK_ SET _WORK_=work -if NOT DEFINED _EXIV2_ SET _EXIV2_=..\..\.. -if NOT DEFINED _CURL_ SET _CURL_=curl-7.45.0 -if NOT DEFINED _LIBSSH_ SET _LIBSSH_=libssh-0.7.2 -if NOT DEFINED _OPENSSL_ SET _OPENSSL_=openssl-1.0.1p -if NOT DEFINED _ZLIB_ SET _ZLIB_=zlib-1.2.8 -if NOT DEFINED _EXPAT_ SET _EXPAT_=expat-2.1.0 -if NOT DEFINED _BASH_ SET _BASH_=c:\cygwin64\bin\bash.exe -if NOT DEFINED _MODE_ SET _MODE_=dll -if NOT DEFINED _UNICODE_ SET _UNICODE_=OFF -if NOT DEFINED _NLS_ SET _NLS_=OFF -if NOT DEFINED COPYCMD SET COPYCMD=/Y +if NOT DEFINED _CONFIG_ set _CONFIG_=Release +if NOT DEFINED _WORK_ set _WORK_=work +if NOT DEFINED _EXIV2_ set _EXIV2_=..\..\.. +if NOT DEFINED _CURL_ set _CURL_=curl-7.45.0 +if NOT DEFINED _LIBSSH_ set _LIBSSH_=libssh-0.7.2 +if NOT DEFINED _OPENSSL_ set _OPENSSL_=openssl-1.0.1p +if NOT DEFINED _ZLIB_ set _ZLIB_=zlib-1.2.8 +if NOT DEFINED _EXPAT_ set _EXPAT_=expat-2.1.0 +if NOT DEFINED _BASH_ set _BASH_=c:\cygwin64\bin\bash.exe +if NOT DEFINED _SHARED_ set _SHARED_=1 +if NOT DEFINED _UNICODE_ set _UNICODE_=0 +if NOT DEFINED _NLS_ set _NLS_=0 +if NOT DEFINED COPYCMD set COPYCMD=/Y rem ---------- check that EXIV2 exists echo checking that %_EXIV2_% exists From 8dda618b4da12564891e56bf1bb45e1bb500ab80 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sat, 9 Sep 2017 08:38:09 +0100 Subject: [PATCH 10/29] Fixing 2008 typo. --- contrib/cmake/msvc/cmakeBuildAll.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/cmake/msvc/cmakeBuildAll.cmd b/contrib/cmake/msvc/cmakeBuildAll.cmd index 34772033..846a2287 100755 --- a/contrib/cmake/msvc/cmakeBuildAll.cmd +++ b/contrib/cmake/msvc/cmakeBuildAll.cmd @@ -1 +1 @@ -for %%a in (64 32) do for %%v in (2017 2015 2005) do cmd /c "vcvars %%v %%a && cmakeBuild --build %* 2>&1" +for %%a in (64 32) do for %%v in (2008) do for %%s in (--static --dll) do for %%r in (--release --debug) do cmd /c "vcvars %%v %%a && cmakeBuild --build %%s %%r %* 2>&1" From 780088d493c2f6d05ecbfc31909dd0f5dcaeacd4 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sat, 9 Sep 2017 08:39:36 +0100 Subject: [PATCH 11/29] cmakeBuildAll.cmd builds 54 flavours. --- contrib/cmake/msvc/cmakeBuildAll.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/cmake/msvc/cmakeBuildAll.cmd b/contrib/cmake/msvc/cmakeBuildAll.cmd index 846a2287..83211c21 100755 --- a/contrib/cmake/msvc/cmakeBuildAll.cmd +++ b/contrib/cmake/msvc/cmakeBuildAll.cmd @@ -1 +1 @@ -for %%a in (64 32) do for %%v in (2008) do for %%s in (--static --dll) do for %%r in (--release --debug) do cmd /c "vcvars %%v %%a && cmakeBuild --build %%s %%r %* 2>&1" +for %%a in (64 32) do for %%v in (2017 2015 2013 2012 2010 2008 2005) do for %%s in (--static --dll) do for %%r in (--release --debug) do cmd /c "vcvars %%v %%a && cmakeBuild --build %%s %%r %* 2>&1" From 2828b11cf7980ddcae8a70ba827c8072e3a60f80 Mon Sep 17 00:00:00 2001 From: clanmills Date: Mon, 11 Sep 2017 16:09:24 +0100 Subject: [PATCH 12/29] Build changes to support EXV_HAVE_REGEX and EXV_HAVE_REGEX_H --- config/config.h.cmake | 5 ++++- config/config.h.in | 5 ++++- config/configure.ac | 4 ++-- config/generateConfigFile.cmake | 3 ++- include/exiv2/version.hpp | 13 +++---------- src/actions.cpp | 6 ++---- src/exiv2.cpp | 10 +++++----- src/version.cpp | 6 ++---- 8 files changed, 24 insertions(+), 28 deletions(-) diff --git a/config/config.h.cmake b/config/config.h.cmake index 865d8b3c..e3b5896c 100644 --- a/config/config.h.cmake +++ b/config/config.h.cmake @@ -50,9 +50,12 @@ #define EXV_ICONV_CONST #endif -// Definition to indicate if you have the header file. +// Definition to indicate if you have the header file. #cmakedefine EXV_HAVE_REGEX +// Definition to indicate if you have the header file. +#cmakedefine EXV_HAVE_REGEX_H + // Definition to indicate you have the header file. #cmakedefine EXV_HAVE_MEMORY_H diff --git a/config/config.h.in b/config/config.h.in index fdc3abf2..93873682 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -47,8 +47,11 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_REGEX + /* Define to 1 if you have the header file. */ -#define HAVE_REGEX 1 +#undef HAVE_REGEX_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/config/configure.ac b/config/configure.ac index 3972f4d1..bfb49f8d 100644 --- a/config/configure.ac +++ b/config/configure.ac @@ -56,7 +56,7 @@ AM_ICONV # Checks for header files. # --------------------------------------------------------------------------- AC_HEADER_STDC -AC_CHECK_HEADERS([libintl.h locale.h malloc.h stdint.h stdlib.h string.h unistd.h sys/mman.h utime.h regex.h]) +AC_CHECK_HEADERS([libintl.h locale.h malloc.h stdint.h stdlib.h string.h unistd.h sys/mman.h utime.h regex.h regex]) # --------------------------------------------------------------------------- # Checks for typedefs, structures, and compiler characteristics. @@ -401,7 +401,7 @@ if test "$ADOBE" = "2016" -o "$ADOBE" = "2014" -o "$ADOBE" = "2013" ; then if test "$ADOBE" == "2013" ; then ADOBE_SDK=XMP-Toolkit-SDK-CC201306; fi ENABLE_XMP=$ADOBE XMPSDK_CPPFLAGS="-Ixmpsdk/Adobe/$ADOBE_SDK/public/include" - XMPSDK_LDFLAGS="-Lxmpsdk/Adobe/$ADOBE_SDK" + XMPSDK_LDFLAGS="-Lxmpsdk/Adobe/$ADOBE_SDK -lXMPCore" case "$host_os" in *arwin*) EXV_DARWIN_FLAGS="-stdlib=libstdc++ -Wno-deprecated" diff --git a/config/generateConfigFile.cmake b/config/generateConfigFile.cmake index 7d925a30..827aec8e 100644 --- a/config/generateConfigFile.cmake +++ b/config/generateConfigFile.cmake @@ -43,7 +43,8 @@ check_include_file( "strings.h" EXV_HAVE_STRINGS_H ) check_include_file( "sys/mman.h" EXV_HAVE_SYS_MMAN_H ) check_include_file( "sys/stat.h" EXV_HAVE_SYS_STAT_H ) check_include_file( "sys/types.h" EXV_HAVE_SYS_TYPES_H ) -check_include_file( "regex.h" EXV_HAVE_REGEX ) +check_include_file( "regex" EXV_HAVE_REGEX ) +check_include_file( "regex.h" EXV_HAVE_REGEX_H ) check_include_file( "inttypes.h" EXV_HAVE_INTTYPES_H ) if (NOT EXV_HAVE_LIBINTL_H) diff --git a/include/exiv2/version.hpp b/include/exiv2/version.hpp index 1fa1ccba..a9683997 100644 --- a/include/exiv2/version.hpp +++ b/include/exiv2/version.hpp @@ -37,20 +37,14 @@ // + standard includes #include -/*! - @brief CPLUSPLUS11 is the value of macro --cplusplus for C++11 -*/ -#define CPLUSPLUS11 201103L - -#if __cplusplus >= CPLUSPLUS11 +#if defined(HAVE_REGEX) # include /*! @brief exv_grep_keys_t is a vector of keys to match to strings */ typedef std::vector exv_grep_keys_t ; -#else -# ifdef EXV_HAVE_REGEX -# include +#elif defined(EXV_HAVE_REGEX_H) +# include /*! @brief exv_grep_keys_t is a vector of keys to match to strings */ @@ -76,7 +70,6 @@ @brief exv_grep_keys_t is a vector of keys to match to strings */ typedef std::vector exv_grep_keys_t ; -# endif #endif /*! diff --git a/src/actions.cpp b/src/actions.cpp index 1e16c3b6..fe14de40 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -591,11 +591,10 @@ namespace Action { for (Params::Greps::const_iterator g = Params::instance().greps_.begin(); !result && g != Params::instance().greps_.end(); ++g) { -#if __cplusplus >= CPLUSPLUS11 +#if defined(EXV_HAVE_REGEX) std::smatch m; result = std::regex_search(key,m, *g); -#else -#ifdef EXV_HAVE_REGEX +#elif defined(EXV_HAVE_REGEX_H) result = regexec( &(*g), key.c_str(), 0, NULL, 0) == 0 ; #else std::string Pattern(g->pattern_); @@ -606,7 +605,6 @@ namespace Action { std::transform(Key.begin() , Key.end() ,Key.begin() , ::tolower); } result = Key.find(Pattern) != std::string::npos; -#endif #endif } return result ; diff --git a/src/exiv2.cpp b/src/exiv2.cpp index 698b528e..46ea833c 100644 --- a/src/exiv2.cpp +++ b/src/exiv2.cpp @@ -47,7 +47,9 @@ EXIV2_RCSID("@(#) $Id$") #include #include -#ifdef EXV_HAVE_REGEX +#if defined(EXV_HAVE_REGEX) +#include +#elif defined(EXV_HAVE_REGEX_H) #include #endif @@ -451,10 +453,9 @@ int Params::evalGrep( const std::string& optarg) std::string pattern; std::string ignoreCase("/i"); bool bIgnoreCase = ends_with(optarg,ignoreCase,pattern); -#if __cplusplus >= CPLUSPLUS11 +#if defined(EXV_HAVE_REGEX) greps_.push_back( std::regex(pattern, bIgnoreCase ? std::regex::icase|std::regex::extended : std::regex::extended) ); -#else -#ifdef EXV_HAVE_REGEX +#elif defined(EXV_HAVE_REGEX_H) // try to compile a reg-exp from the input argument and store it in the vector const size_t i = greps_.size(); greps_.resize(i + 1); @@ -478,7 +479,6 @@ int Params::evalGrep( const std::string& optarg) } #else greps_.push_back(Exiv2_grep_key_t(pattern,bIgnoreCase)); -#endif #endif return result; } // Params::evalGrep diff --git a/src/version.cpp b/src/version.cpp index 3b92e852..a2278429 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -173,11 +173,10 @@ static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std: !bPrint && g != greps.end() ; ++g ) { std::string Key(key); -#if __cplusplus >= CPLUSPLUS11 +#if defined(EXV_HAVE_REGEX) std::smatch m; bPrint = std::regex_search(Key,m,*g) || std::regex_search(value,m,*g); -#else -#ifdef EXV_HAVE_REGEX +#elif defined(EXV_HAVE_REGEX_H) bPrint = ( 0 == regexec( &(*g), key , 0, NULL, 0) || 0 == regexec( &(*g), value.c_str(), 0, NULL, 0) ); @@ -191,7 +190,6 @@ static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std: std::transform(Value.begin() , Value.end() ,Value.begin() , ::tolower); } bPrint = Key.find(Pattern) != std::string::npos || Value.find(Pattern) != std::string::npos; -#endif #endif } return bPrint; From 9645bf373a167ed0a39bf617852ed65735b9b768 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Mon, 11 Sep 2017 21:45:51 +0100 Subject: [PATCH 13/29] cmakeBuild.cmd --webready Work in Progress for VS 2017. --- contrib/cmake/msvc/cmakeBuild.cmd | 4 ++++ contrib/cmake/msvc/cmakeBuildAll.cmd | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/cmake/msvc/cmakeBuild.cmd b/contrib/cmake/msvc/cmakeBuild.cmd index 1e1d3bf9..c6c7160a 100755 --- a/contrib/cmake/msvc/cmakeBuild.cmd +++ b/contrib/cmake/msvc/cmakeBuild.cmd @@ -250,6 +250,10 @@ if NOT DEFINED _GENERATOR_ set "_GENERATOR_=%VS_CMAKE%" if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles" if /I "%_SHARED_%" == "0" set _LINK_="-DCMAKE_LINK=static" +rem Fix up for openssl/vs 2017 +@echo on +if /I "%_OPENSSL_%" == "openssl-1.0.1p" if /I "%_VS_%" == 2017 set _OPENSSL_ = openssl-1.1.0f + call:cltest call:report diff --git a/contrib/cmake/msvc/cmakeBuildAll.cmd b/contrib/cmake/msvc/cmakeBuildAll.cmd index 83211c21..781a8001 100755 --- a/contrib/cmake/msvc/cmakeBuildAll.cmd +++ b/contrib/cmake/msvc/cmakeBuildAll.cmd @@ -1 +1 @@ -for %%a in (64 32) do for %%v in (2017 2015 2013 2012 2010 2008 2005) do for %%s in (--static --dll) do for %%r in (--release --debug) do cmd /c "vcvars %%v %%a && cmakeBuild --build %%s %%r %* 2>&1" +for %%a in (64 32) do for %%v in (2017 2015 2013 2012 2010 2008 2005) do for %%s in (--static --dll) do for %%r in (--release --debug) do for %%u in (--ascii --unicode) do cmd /c "vcvars %%v %%a && cmakeBuild --test %%s %%r %%u %* 2>&1" From d356aaae954928947138753284d321a03bb8f0f6 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Wed, 13 Sep 2017 11:54:02 +0100 Subject: [PATCH 14/29] cmakeBuild.cmd --webready working with VS 2005 --- CMakeLists.txt | 12 +++++++----- contrib/cmake/msvc/cmakeBuild.cmd | 12 ++++++------ include/exiv2/config.h | 5 +++++ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16f80809..7350a2d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,11 +36,13 @@ option( EXIV2_ENABLE_WEBREADY "Build webready support into library" option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) if (WIN32) option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) - option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) - option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) -else() +endif() +if ( EXIV2_ENABLE_WEBREADY ) option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON ) option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) +else() + option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) + option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) endif() option( EXIV2_BUILD_SAMPLES "Build sample applications" ON ) option( EXIV2_BUILD_PO "Build translations files" OFF ) @@ -72,11 +74,11 @@ if( EXIV2_ENABLE_XMP ) endif() add_subdirectory( src ) -if( EXIV2_ENABLE_BUILD_SAMPLES ) +if( EXIV2_BUILD_SAMPLES ) add_subdirectory( samples ) endif() -if( EXIV2_ENABLE_BUILD_PO ) +if( EXIV2_BUILD_PO ) add_subdirectory( po ) endif() diff --git a/contrib/cmake/msvc/cmakeBuild.cmd b/contrib/cmake/msvc/cmakeBuild.cmd index c6c7160a..9e089b5b 100755 --- a/contrib/cmake/msvc/cmakeBuild.cmd +++ b/contrib/cmake/msvc/cmakeBuild.cmd @@ -102,7 +102,6 @@ echo.&&echo.&&echo. exit /b 0 :main -call:report if NOT DEFINED _SILENT_ set _VERBOSE_=1 set _UNSUPPORTED_= @@ -201,7 +200,7 @@ IF ERRORLEVEL 1 ( ) rem ---- -call:echo fix ups +call:echo fixups set _WORK_=%_WORK_%_%_CONFIG_% if DEFINED _TRACE_ ( set _VERBOSE_=1 @@ -211,6 +210,8 @@ if DEFINED _TEST_ ( set _SAMPLES_=1 set _BUILD_=1 ) +if DEFINED _WEBREADY_ set _SHARED_=1 + if /I "%_SHARED_%" == "1" set _MODE_=dll if /I "%_SHARED_%" == "0" set _MODE_=static @@ -251,7 +252,6 @@ if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles" if /I "%_SHARED_%" == "0" set _LINK_="-DCMAKE_LINK=static" rem Fix up for openssl/vs 2017 -@echo on if /I "%_OPENSSL_%" == "openssl-1.0.1p" if /I "%_VS_%" == 2017 set _OPENSSL_ = openssl-1.1.0f call:cltest @@ -322,7 +322,6 @@ echo ---------- EXIV2 building with cmake ------------------ set "EXIV_B=%_WORK_%\exiv2" IF EXIST "%EXIV_B%" rmdir/s/q "%EXIV_B%" IF NOT EXIST "%EXIV_B%" mkdir "%EXIV_B%" - pushd "%EXIV_B%" set ENABLE_CURL=-DEXIV2_ENABLE_CURL=OFF set ENABLE_LIBSSH=-DEXIV2_ENABLE_SSH=OFF @@ -332,7 +331,7 @@ pushd "%EXIV_B%" set ENABLE_DYNAMIC=ON if defined _CURL_ set ENABLE_CURL=-DEXIV2_ENABLE_CURL=ON - if defined _LIBSSH_ set ENABLE_SSH=-DEXIV2_ENABLE_SSH=ON + if defined _LIBSSH_ set ENABLE_LIBSSH=-DEXIV2_ENABLE_SSH=ON if defined _WEBREADY_ set ENABLE_WEBREADY=-DEXIV2_ENABLE_WEBREADY=ON if defined _VIDEO_ set ENABLE_VIDEO=-DEXIV2_ENABLE_VIDEO=ON if /I "%_MODE_%" == "static" ( @@ -343,7 +342,7 @@ pushd "%EXIV_B%" if DEFINED _SAMPLES_ set BUILD_SAMPLES=ON call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% ^ - -DEXIV2_ENABLE_NLS=%_NLS_% -DEXIV2_ENABLE_BUILD_SAMPLES=%BUILD_SAMPLES% ^ + -DEXIV2_ENABLE_NLS=%_NLS_% -DEXIV2_BUILD_SAMPLES=%BUILD_SAMPLES% ^ -DEXIV2_ENABLE_WIN_UNICODE=%_UNICODE_% -DBUILD_SHARED_LIBS=%ENABLE_SHARED% ^ -DEXIV2_ENABLE_DYNAMIC_RUNTIME=%ENABLE_DYNAMIC% ^ %ENABLE_WEBREADY% %ENABLE_CURL% %ENABLE_LIBSSH% %ENABLE_VIDEO% ^ @@ -354,6 +353,7 @@ pushd "%EXIV_B%" popd goto error_end ) + copy/y "%_WORK_%\exiv2\exv_conf.h" "%_INCPATH_%" rem if DEFINED _BUILDX_ devenv %_WORK_%\exiv2\exiv2.sln /Build "%_CONFIG_%|%Platform%" /ProjectConfig INSTALL diff --git a/include/exiv2/config.h b/include/exiv2/config.h index c0fb8939..2e857b49 100644 --- a/include/exiv2/config.h +++ b/include/exiv2/config.h @@ -78,6 +78,11 @@ typedef int pid_t; # define CURL_STATICLIB #endif +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include + #endif // _MSC_VER ///// End of Visual Studio Support ///// From 012d630125249bec558ca32745387574c5f53752 Mon Sep 17 00:00:00 2001 From: clanmills Date: Wed, 13 Sep 2017 15:33:16 +0100 Subject: [PATCH 15/29] Polish options. Move exv_conf.h to directory include/exiv2 --- CMakeLists.txt | 55 ++++++++++++++++----------------- config/generateConfigFile.cmake | 2 +- src/CMakeLists.txt | 11 +++---- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7350a2d9..4d0a0cc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,51 +24,49 @@ set( GENERIC_LIB_VERSION "26.0.0" ) set( GENERIC_LIB_SOVERSION "26" ) # options and their default values -option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) -option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) -option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) -option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) -option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) -option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) -option( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) -option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) -option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) -option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) -if (WIN32) - option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) -endif() +option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) +option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) +option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) +option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) +option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) +option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) +option( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) +option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) +option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) +option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) +option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) +option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) +option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) +option( EXIV2_BUILD_SAMPLES "Build sample applications" ON ) +option( EXIV2_BUILD_PO "Build translations files" OFF ) +option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON ) + if ( EXIV2_ENABLE_WEBREADY ) - option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON ) - option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) -else() - option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) - option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) + set ( EXIV2_ENABLE_CURL ON ) + set ( EXIV2_ENABLE_CURL ON ) + set ( EXIV2_ENABLE_SSH ON ) endif() -option( EXIV2_BUILD_SAMPLES "Build sample applications" ON ) -option( EXIV2_BUILD_PO "Build translations files" OFF ) -option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON ) - -include(config/findDependencies.cmake) -include(config/compilerFlags.cmake) if( EXIV2_ENABLE_COMMERCIAL ) set (EXIV2_ENABLE_LENSDATA OFF) set (EXIV2_ENABLE_NLS OFF) endif() -if( MSVC ) - set(CMAKE_DEBUG_POSTFIX "d") -endif() - if( EXIV2_ENABLE_XMP ) set( HAVE_XMP_TOOLKIT ON ) endif() +include(config/findDependencies.cmake) +include(config/compilerFlags.cmake) include( config/generateConfigFile.cmake ) include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project include( config/CMakeChecks.txt ) +if( MSVC ) + set(CMAKE_DEBUG_POSTFIX "d") +endif() + if( EXIV2_ENABLE_XMP ) add_subdirectory( xmpsdk ) endif() @@ -85,7 +83,6 @@ endif() ## # tests add_custom_target(tests COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) -add_custom_target(geotag-test COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make geotag-test WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) ## # http://dev.exiv2.org/boards/3/topics/1364 diff --git a/config/generateConfigFile.cmake b/config/generateConfigFile.cmake index 827aec8e..d06147b8 100644 --- a/config/generateConfigFile.cmake +++ b/config/generateConfigFile.cmake @@ -67,4 +67,4 @@ return 0; ##################################################################################### -configure_file( config/config.h.cmake ${CMAKE_BINARY_DIR}/exv_conf.h @ONLY) +configure_file( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h @ONLY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9984a891..ea666721 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,7 @@ # CMakeLists.txt for exiv2 library and command-line program # list of public C++ include files -file(GLOB LIBEXIV2_HDR ../include/exiv2/*.hpp) -list(APPEND LIBEXIV2_HDR ${CMAKE_BINARY_DIR}/exv_conf.h) +file(GLOB LIBEXIV2_HDR ../include/exiv2/*.hpp ../include/exiv2/exv_conf.h) # list of internal include files only required to build the library file(GLOB LIBEXIV2_PRIVATE_HDR *_int.hpp) @@ -10,7 +9,7 @@ file(GLOB LIBEXIV2_PRIVATE_HDR *_int.hpp) # list of library C++ source files file(GLOB LIBEXIV2_SRC *.cpp) # remove files which are not part of the library -file(GLOB LIBEXIV2_SRC_NOT actions.cpp exiv2.cpp *test.cpp crwparse.cpp mrwthumb.cpp xmpdump.cpp) +file(GLOB LIBEXIV2_SRC_NOT actions.cpp exiv2.cpp *test.cpp crwparse.cpp mrwthumb.cpp xmpdump.cpp) foreach(entry ${LIBEXIV2_SRC_NOT}) list(REMOVE_ITEM LIBEXIV2_SRC ${entry}) endforeach() @@ -87,7 +86,7 @@ if ( MSVC ) if( EXIV2_ENABLE_PNG ) target_link_libraries( exiv2lib PRIVATE ${ZLIB_LIBRARIES} ) endif() - + source_group("Header Files" FILES ${LIBEXIV2_HDR} ) source_group("Header Files" FILES ${LIBCURL_HDR} ) source_group("Header Files" FILES ${SSH_HDR} ) @@ -133,7 +132,7 @@ install(FILES ${LIBEXIV2_HDR} # ****************************************************************************** # exiv2 application -set( EXIV2_SRC +set( EXIV2_SRC exiv2.cpp exiv2app.hpp actions.cpp @@ -148,7 +147,7 @@ if(EXIV2_BUILD_EXIV2_COMMAND) target_link_libraries( exiv2 PRIVATE exiv2lib ) if ( BUILD_SHARED_LIBS ) target_compile_definitions(exiv2 PRIVATE EXV_HAVE_DLL ) - endif() + endif() install(TARGETS exiv2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() From 1b3ea0515551923a4f0c288497a8f2dda476454f Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Wed, 13 Sep 2017 15:37:05 +0100 Subject: [PATCH 16/29] Documentation update. --- contrib/cmake/msvc/ReadMe.txt | 360 +++++++++++++++++----------------- 1 file changed, 184 insertions(+), 176 deletions(-) diff --git a/contrib/cmake/msvc/ReadMe.txt b/contrib/cmake/msvc/ReadMe.txt index b8b213ca..e250b3a8 100755 --- a/contrib/cmake/msvc/ReadMe.txt +++ b/contrib/cmake/msvc/ReadMe.txt @@ -17,55 +17,65 @@ exiv2/contrib/cmake/msvc/ReadMe.txt How to use this --------------- -1 Setting up your machine - You need cmake.exe, svn.exe and 7z.exe on your PATH. + 1 Setting up your machine + You need cmake.exe, svn.exe and 7z.exe on your PATH. - Please get "Windows" versions of cmake/svn/7z (NOT Cygwin or MinGW versions) + Please get "Windows" versions of cmake/svn/7z (NOT Cygwin or MinGW versions) - You should initialize the Visual Studio environment - using the version of vcvars32.bat or vcvarsall.bat - installed with Visual Studio. For example: + cd /contrib/cmake/msvc + ...\cmake\msvc> cmd /c "vcvars 2015 64 && cmakeBuild --build" - call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" + cmakeBuild.cmd creates Visual Studio solution/project files + Option: --build says "build using the generated files" - The batch file contrib\cmake\msvc\vcvars.bat is designed to take the pain - out of this - provided Visual Studio is installed in %ProgramFiles(x86)% - %ProgramFiles(x86)% is usually c:\Program Files (x86) + More options: --static --test --debug etc --webready (see below) - vcvars 2005 32 # sets 2005 x86 - vcvars 2010 64 # sets 2010 amd64 + 2 Selecting the version of Visual Studio -2 Always build "out of source". I recommend: - cd \contrib\cmake\cmake - cmd.exe - vcvars 2015 64 - cmakeBuild --help # display syntax and options - cmakeBuild --build - .... - exit + You should initialize the Visual Studio environment + using the version of vcvars32.bat or vcvarsall.bat + installed with Visual Studio. For example: - +-------------------------------------------------------+ - | Never attempt to build in a directory with a space in | - | the path name. Example c:\My Build Tree\exiv2\build | - +-------------------------------------------------------+ + call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" - You should never have reason to modify the code in cmakeBuild.cmd - You may wish to change the defaults in cmakeDefaults.cmd - You can change the defaults on the command-line (or modify cmakeDefaults.cmd) - You can also change defaults using the dos set command. For example: - set _CONFIG_=Debug + The batch file contrib\cmake\msvc\vcvars.bat is designed to take the pain + out of this - provided Visual Studio is installed in %ProgramFiles(x86)% + %ProgramFiles(x86)% is usually c:\Program Files (x86) - To unset an environment string, set _CONFIG_= + vcvars 2005 32 # sets 2005 x86 + vcvars 2010 64 # sets 2010 amd64 - For your first build, I recommend the command: - cmakeBuild --pause --verbose + 3 Always build "out of source". I recommend: + cd \contrib\cmake\cmake + cmd.exe + vcvars 2015 64 + cmakeBuild --help # display syntax and options + cmakeBuild --build + .... + exit - This will print out a lot of information, and pause after each build step. + +-------------------------------------------------------+ + | Never attempt to build in a directory with a space in | + | the path name. Example c:\My Build Tree\exiv2\build | + +-------------------------------------------------------+ - When you are building happily, you may prefer: - cmakeBuild --silent + You should never have reason to modify the code in cmakeBuild.cmd + You may wish to change the defaults in cmakeDefaults.cmd + You can change the defaults on the command-line (or modify cmakeDefaults.cmd) + You can also change defaults using the dos set command. For example: + set _CONFIG_=Debug -3 Options + To unset an environment string, set _CONFIG_= + + For your first build, I recommend the command: + cmakeBuild --pause --verbose + + This will print out a lot of information, and pause after each build step. + + When you are building happily, you may prefer: + cmakeBuild --silent + + 4 Options C:\Users\rmills\gnu\github\clanmills\exiv2\contrib\cmake\msvc>cmakeBuild --help Options: --help | --silent | --verbose | --pause | --dryrun | --trace | --test --build | --static | --unicode | --nls | --webready | --video | --samples @@ -81,7 +91,7 @@ How to use this --dryrun Don't build anything. Report and quit --trace Show commands begin executed by the script (implies --build --samples) --test Execute the test suite after the build - + --build Build the code --static Build and link static libraries and programs --unicode Build UNICODE path support @@ -97,159 +107,157 @@ How to use this --libssh libssh-0.7.2 Other build key/value pairs: - --config Release | Debug (shorthand = --release --debug) + --config Release | Debug (shorthand = --release --debug) --generator The script default is almost always correct and is passed as -G "Generator" to CMake --work The "work" directory in which the build will be performed (see 4 below) --bash Path to bash.exe to be used when --test is specified. -4 What gets built? - The build is performed in work_Config - The output is generated in dist - dist\..mumble..\bin contains *.exe and *.dll files - dist\..mumble..\lib contains *.lib files - dist\..mumble..\include contains *.h and *.hpp files + 5 What gets built? + The build is performed in work_Config + The output is generated in dist + dist\..mumble..\bin contains *.exe and *.dll files + dist\..mumble..\lib contains *.lib files + dist\..mumble..\include contains *.h and *.hpp files - mumble identifies the compiler and build. - Example C:\gnu\github\exiv2\contrib\cmake\msvc\dist\2013\x64\dll\Release\bin - 2013 = Visual Studio Choices: 2005 | 2008 | 2010 | 2012 | 2013 | 2015 | 2017 - x64 = 64 bit build Win32 | x64 - dll = shared library dll | static - Release = configuration Release | Debug | RelWithDebInfo | MinSizeRel + mumble identifies the compiler and build. + Example C:\gnu\github\exiv2\contrib\cmake\msvc\dist\2013\x64\dll\Release\bin + 2013 = Visual Studio Choices: 2005 | 2008 | 2010 | 2012 | 2013 | 2015 | 2017 + x64 = 64 bit build Win32 | x64 + dll = shared library dll | static + Release = configuration Release | Debug | RelWithDebInfo | MinSizeRel -5 Building manually with CMake - The cmake option -G Generator should be chosen for the version of Visual Studio installed. - cmake --help for more information + 6 Building manually with CMake + The cmake option -G Generator should be chosen for the version of Visual Studio installed. + cmake --help for more information - I personally always build/test with Visual Studio 2005 in 64 bits. - The generator is: "Visual Studio 8 2005 Win64" + I personally always build/test with Visual Studio 2005 in 64 bits. + The generator is: "Visual Studio 8 2005 Win64" - cd - mkdir ../build - cd ../build + cd + mkdir ../build + cd ../build - rem download support libraries - svn export svn://dev.exiv2.org/svn/team/libraries/zlib-1.2.8.tar.gz - svn export svn://dev.exiv2.org/svn/team/libraries/expat-2.1.0.tar.gz + rem download support libraries + svn export svn://dev.exiv2.org/svn/team/libraries/zlib-1.2.8.tar.gz + svn export svn://dev.exiv2.org/svn/team/libraries/expat-2.1.0.tar.gz - ... + ... for webready you need curl-7.45.0 libssh-0.7.2 and openssl-1.0.1p See below: "About webready support libraries (openssl, libssh and curl) - ... - - rem create a temp directory and a dist (distribution) directory - mkdir temp # build, compile and link in this directory - mkdir dist # the output artifacts are stored here - - rem build zlib-1.2.8 - mkdir temp\zlib-1.2.8 - cd temp\zlib-1.2.8 - cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..dist" ..\..\zlib-1.2.8 - cmake --build . # TAKE CARE with expat-2.1.0 use: cmake --build . --target expat - cmake --build . --target install - cd ..\.. - - rem build expat-2.1.0 and other required libraries - - rem build exiv2 - mkdir temp\exiv2 - cd temp\exiv2 - cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..\dist" ^ - "-DCMAKE_LIBRARY_PATH=..\..\dist\lib" "-DCMAKE_INCLUDE_PATH=..\..\dist\include" ^ - -DEXIV2_ENABLE_SHARED=ON ^ - ..\..\..\ - cmake --build . --config Release - cmake --build . --config Release --target install - -6 About webready support libraries (openssl, libssh and curl) - - a) openssl - You cannot build openssl with CMake. However we have prebuilt binaries which - you can download and extract into your build tree. - - You will have to match the version to your compiler. - In this example: vs2015/64 bit - - svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2015.7z - 7z x openssl-1.0.1p-vs2015.7z - xcopy/yesihq openssl-1.0.1p-vs2015\bin64 dist\bin" - xcopy/yesihq openssl-1.0.1p-vs2015\lib64 dist\bin" - xcopy/yesihq openssl-1.0.1p-vs2015\include64 dist\include" - - In this example: vs2008/32 bit - svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2008.7z - 7z x openssl-1.0.1p-vs2015.7z - xcopy/yesihq openssl-1.0.1p-vs2008\bin dist\bin" - xcopy/yesihq openssl-1.0.1p-vs2008\lib dist\bin" - xcopy/yesihq openssl-1.0.1p-vs2008\include dist\include" - - The script contrib/cmake/msvc/cmakeOpenssl was used to create the vs2005.7z file - from a complete build performed by msvc/exiv2-webready.sln and openssl-1.0.1p source - - b) curl - curl does not seem to build with CMake. - It announces itself "the curl cmake build system is poorly maintained. Be aware" - - I have given up trying to get this to work and used nmake in the winbuild directory. - For more information, read: winbuild\BUILD.WINDOWS.txt - - c) libssh - Three changes have been made to libssh to build with VS2015, VS2008, VS2995 - These have been reported (with fixes) - VS2015: https://red.libssh.org/issues/214 - VS2005/8: https://red.libssh.org/issues/2205 - - The fixes are included in svn://dev.exiv2.org/svn/team/libraries/libssh-0.7.2.tar.gz - A 'vanilla' version of libssh will may require those fixes to be applied. - -7 Build options - You can inspect CMake options by running grep options on CMakeLists.txt in - C:\cygwin64\home\rmills\gnu\exiv2\build>cd ..\trunk - - C:\cygwin64\home\rmills\gnu\github\exiv2\exiv2>grep option CMakeLists.txt + ... + + rem create a temp directory and a dist (distribution) directory + mkdir temp # build, compile and link in this directory + mkdir dist # the output artifacts are stored here + + rem build zlib-1.2.8 + mkdir temp\zlib-1.2.8 + cd temp\zlib-1.2.8 + cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..dist" ..\..\zlib-1.2.8 + cmake --build . # TAKE CARE with expat-2.1.0 use: cmake --build . --target expat + cmake --build . --target install + cd ..\.. + + rem build expat-2.1.0 and other required libraries + + rem build exiv2 + mkdir temp\exiv2 + cd temp\exiv2 + cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..\dist" ^ + "-DCMAKE_LIBRARY_PATH=..\..\dist\lib" "-DCMAKE_INCLUDE_PATH=..\..\dist\include" ^ + -DEXIV2_ENABLE_SHARED=ON ^ + ..\..\..\ + cmake --build . --config Release + cmake --build . --config Release --target install + + 7 About webready support libraries (openssl, libssh and curl) + + a) openssl + You cannot build openssl with CMake. However we have prebuilt binaries which + you can download and extract into your build tree. + + You will have to match the version to your compiler. + In this example: vs2015/64 bit + + svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2015.7z + 7z x openssl-1.0.1p-vs2015.7z + xcopy/yesihq openssl-1.0.1p-vs2015\bin64 dist\bin" + xcopy/yesihq openssl-1.0.1p-vs2015\lib64 dist\bin" + xcopy/yesihq openssl-1.0.1p-vs2015\include64 dist\include" + + In this example: vs2008/32 bit + svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2008.7z + 7z x openssl-1.0.1p-vs2015.7z + xcopy/yesihq openssl-1.0.1p-vs2008\bin dist\bin" + xcopy/yesihq openssl-1.0.1p-vs2008\lib dist\bin" + xcopy/yesihq openssl-1.0.1p-vs2008\include dist\include" + + The script contrib/cmake/msvc/cmakeOpenssl was used to create the vs2005.7z file + from a complete build performed by msvc/exiv2-webready.sln and openssl-1.0.1p source + + b) curl + curl does not seem to build with CMake. + It announces itself "the curl cmake build system is poorly maintained. Be aware" + + I have given up trying to get this to work and used nmake in the winbuild directory. + For more information, read: winbuild\BUILD.WINDOWS.txt + + c) libssh + Three changes have been made to libssh to build with VS2015, VS2008, VS2995 + These have been reported (with fixes) + VS2015: https://red.libssh.org/issues/214 + VS2005/8: https://red.libssh.org/issues/2205 + + The fixes are included in svn://dev.exiv2.org/svn/team/libraries/libssh-0.7.2.tar.gz + A 'vanilla' version of libssh will may require those fixes to be applied. + + 8 Build options + You can inspect CMake options by running grep options on CMakeLists.txt in + C:\cygwin64\home\rmills\gnu\github\clanmills\exiv2\contrib\cmake\msvc>cd ..\..\.. + C:\cygwin64\home\rmills\gnu\github\clanmills\exiv2>grep option CMakeLists.txt # options and their default values - option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) - option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) - option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) - option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) - option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) - option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) - option( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) - option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) - option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) - option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) - option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) - option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) - option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) - option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) - option( EXIV2_BUILD_SAMPLES "Build sample applications" ON ) - option( EXIV2_BUILD_PO "Build translations files" OFF ) - option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON ) - -8 Running the test suite - http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2 - - You can run the test-suite directly from cmakeBuild.cmd with the argument --test - You need cygwin's bash.exe to run the test suite. - -9 Building with different versions of the support libraries - You can change the standard libraries. For example, to build with curl-7.39.0 - 1) set _CURL_=curl-7.39.0 - 2) add curl-7.39.0.tar.gz in your build directory - - To change the version of openssl: - 1) set _OPENSSL_=openssl-1.0.1j - 2) add openssl-1.0.1j-vs2015.zip into your build directory - -9 Rebuilding with VS 2005/8/10/12/13/15/17 32/64 - The script cmakeBuildAll.cmd is provided for convenience: - cmakeBuildAll.cmd --test > rebuildAll.txt - To view progress, open another shell: tail -f rebuildAll.txt - - cmakeBuildAll.cmd takes about a hour if you don't specify --webready - 14 build+test cycles of about 5 minutes each. Just over 1 hour. - With webready, 14 build+test cycles of 12 minutes = 3 hours + option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) + option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) + option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) + option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) + option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) + option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) + option( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) + option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) + option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) + option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) + option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) + option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) + option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) + option( EXIV2_BUILD_SAMPLES "Build sample applications" ON ) + option( EXIV2_BUILD_PO "Build translations files" OFF ) + option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON ) + + 9 Running the test suite + http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2 + + You can run the test-suite directly from cmakeBuild.cmd with the argument --test + You need cygwin's bash.exe to run the test suite. + +10 Building with different versions of the support libraries + You can change the standard libraries. For example, to build with curl-7.39.0 + 1) set _CURL_=curl-7.39.0 + 2) add curl-7.39.0.tar.gz in your build directory + + To change the version of openssl: + 1) set _OPENSSL_=openssl-1.0.1j + 2) add openssl-1.0.1j-vs2015.zip into your build directory + +11 Rebuilding with VS 2005/8/10/12/13/15/17 32/64 + The script cmakeBuildAll.cmd is provided for convenience: + cmakeBuildAll.cmd --test > rebuildAll.txt + To view progress, open another shell: tail -f rebuildAll.txt + + cmakeBuildAll.cmd takes about a hour if you don't specify --webready + 14 build+test cycles of about 5 minutes each. Just over 1 hour. + With webready, 14 build+test cycles of 12 minutes = 3 hours Robin Mills robin@clanmills.com -Updated: 2017-09-08 +Updated: 2017-09-13 From d3669432975daffdbe636acde2cc15c192c69b93 Mon Sep 17 00:00:00 2001 From: clanmills Date: Wed, 13 Sep 2017 16:54:10 +0100 Subject: [PATCH 17/29] Refactoring EXV_USE_CURL and EXV_USE_SSH --- config/config.h.cmake | 100 ++++++++++++++++++++------------------ include/exiv2/basicio.hpp | 12 ++--- include/exiv2/exiv2.hpp | 6 ++- include/exiv2/http.hpp | 6 +-- include/exiv2/ssh.hpp | 2 +- samples/conntest.cpp | 8 +-- src/basicio.cpp | 19 +++++--- src/image.cpp | 7 ++- src/ssh.cpp | 3 +- src/version.cpp | 55 ++++++++------------- 10 files changed, 106 insertions(+), 112 deletions(-) diff --git a/config/config.h.cmake b/config/config.h.cmake index e3b5896c..7e4ed424 100644 --- a/config/config.h.cmake +++ b/config/config.h.cmake @@ -2,46 +2,33 @@ #pragma once -// Defined to 1 if when using `libssh' for SshIO. -#cmakedefine01 EXV_USE_SSH +// Defined if you want to use libssh for SshIO. +#cmakedefine EXV_USE_SSH -// Define to 1 if you want to use `libcurl' in httpIO. -#cmakedefine01 EXV_USE_CURL +// Define to 1 if you want to use libcurl in httpIO. +#cmakedefine EXV_USE_CURL // Define if you require webready support. #cmakedefine EXV_ENABLE_WEBREADY -// Define to 1 if you have the `gmtime_r' function. +// Define if you have the `gmtime_r' function. #cmakedefine EXV_HAVE_GMTIME_R -// Define to 1 if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_LIBINTL_H -// Define to 1 if translation of program messages to the user's native language is requested. +// Define if you want translation of program messages to the user's native language #cmakedefine EXV_ENABLE_NLS -// Define to 1 if you require video support. +// Define if you want video support. #cmakedefine EXV_ENABLE_VIDEO +// Define if you have correct declaration of strerror_r(). #cmakedefine EXV_HAVE_DECL_STRERROR_R -#ifndef EXV_COMMERCIAL_VERSION - -// Definition to enable translation of Nikon lens names. -#cmakedefine EXV_HAVE_LENSDATA - -// Define to 1 if you have the `iconv' function. -#cmakedefine EXV_HAVE_ICONV - -// Definition to enable conversion of UCS2 encoded Windows tags to UTF-8. -#cmakedefine EXV_HAVE_PRINTUCS2 - -#endif /* !EXV_COMMERCIAL_VERSION */ - -// Definition to enable the Windows unicode path support. +// Define to enable the Windows unicode path support. #cmakedefine EXV_UNICODE_PATH - /* Define to `const' or to empty, depending on the second argument of `iconv'. */ #cmakedefine ICONV_ACCEPTS_CONST_INPUT #if defined ICONV_ACCEPTS_CONST_INPUT @@ -50,22 +37,22 @@ #define EXV_ICONV_CONST #endif -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_REGEX -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_REGEX_H -// Definition to indicate you have the header file. +// Define if have the header file. #cmakedefine EXV_HAVE_MEMORY_H -// Definition to indicate if you have the `memset' function. +// Define if you have the memset function. #cmakedefine EXV_HAVE_MEMSET -// Definition to indicate if stdbool.h conforms to C99. +// Define if stdbool.h conforms to C99. #cmakedefine EXV_HAVE_STDBOOL_H -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_STDINT_H #ifndef EXV_HAVE_STDINT_H @@ -74,53 +61,53 @@ #endif #endif -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_STDLIB_H -// Definition to indicate if you have the `strchr' function. +// Define if you have the strchr function. #cmakedefine EXV_HAVE_STRCHR -// Definition to indicate if you have the `strerror' function. +// Define if you have the strerror function. #cmakedefine EXV_HAVE_STRERROR -// Definition to indicate if you have the `strerror_r' function. +// Define if you have the strerror_r function. #cmakedefine EXV_HAVE_STRERROR_R -// Definition to indicate if strerror_r returns char *. +// Define if strerror_r returns char *. #cmakedefine STRERROR_R_CHAR_P -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_STRINGS_H -// Definition to indicate if you have the `strtol' function. +// Define if you have the strtol function. #cmakedefine EXV_HAVE_STRTOL -// Definition to indicate if you have the `mmap' function. +// Define if you have the mmap function. #cmakedefine EXV_HAVE_MMAP -// Definition to indicate if you have the `munmap' function. +// Define if you have the munmap function. #cmakedefine EXV_HAVE_MUNMAP -// Definition to indicate if you have the header file. +// Define if you have header file. #cmakedefine EXV_HAVE_SYS_STAT_H -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_SYS_TYPES_H -// Definition to indicate if you have the `timegm' function. +// Define if you have the timegm function. #cmakedefine EXV_HAVE_TIMEGM -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #cmakedefine EXV_HAVE_UNISTD_H 1 #if !defined( EXV_HAVE_UNISTD_H) && defined(__CYGWIN__) #define EXV_HAVE_UNISTD_H 1 #endif -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_SYS_MMAN_H -// Definition to indicate if the `zlib' library will be used +// Define if you have are using the zlib library. #cmakedefine EXV_HAVE_LIBZ #if defined(_MSC_VER) && HAVE_LIBZ @@ -129,11 +116,11 @@ #endif #endif -// Definition to indicate if you have the header file. +// Define if you have the header file. #cmakedefine EXV_HAVE_PROCESS_H -/* Define to 1 if you have the Adobe XMP Toolkit. */ -#cmakedefine EXV_HAVE_XMP_TOOLKIT 1 +/* Define if you have (Exiv2/xmpsdk) Adobe XMP Toolkit. */ +#cmakedefine EXV_HAVE_XMP_TOOLKIT /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ @@ -168,3 +155,22 @@ /* Define to `unsigned' if does not define. */ #cmakedefine size_t + +// ------------------------------------------------------------------ +// The following features are not available for Commercial use +#ifndef EXV_COMMERCIAL_VERSION + +// Definition to enable translation of Nikon lens names. +#cmakedefine EXV_HAVE_LENSDATA + +// Define if you have the iconv function. +#cmakedefine EXV_HAVE_ICONV + +// Definition to enable conversion of UCS2 encoded Windows tags to UTF-8. +#cmakedefine EXV_HAVE_PRINTUCS2 + +#endif /* !EXV_COMMERCIAL_VERSION */ +// ------------------------------------------------------------------ + +// That's All Folks! +// ------------------------------------------------------------------ diff --git a/include/exiv2/basicio.hpp b/include/exiv2/basicio.hpp index 95713bfc..9d0b31cf 100644 --- a/include/exiv2/basicio.hpp +++ b/include/exiv2/basicio.hpp @@ -43,12 +43,6 @@ #ifndef EXV_XPATH_MEMIO #define EXV_XPATH_MEMIO 0 #endif -#ifndef EXV_USE_CURL -#define EXV_USE_CURL 0 -#endif -#ifndef EXV_USE_SSH -#define EXV_USE_SSH 0 -#endif // ***************************************************************************** // namespace extensions @@ -1117,7 +1111,7 @@ namespace Exiv2 { //@} }; -#if EXV_USE_CURL == 1 +#ifdef EXV_USE_CURL /*! @brief Provides the http, https read/write access and ftp read access for the RemoteIo. This class is based on libcurl. @@ -1173,7 +1167,7 @@ namespace Exiv2 { }; #endif -#if EXV_USE_SSH == 1 +#ifdef EXV_USE_SSH /*! @brief Provides the ssh read/write access and sftp read access for the RemoteIo. This class is based on libssh. @@ -1262,7 +1256,7 @@ namespace Exiv2 { EXIV2API std::wstring ReplaceStringInPlace(std::wstring subject, const std::wstring& search, const std::wstring& replace); #endif -#if EXV_USE_CURL == 1 +#ifdef EXV_USE_CURL /*! @brief The callback function is called by libcurl to write the data */ diff --git a/include/exiv2/exiv2.hpp b/include/exiv2/exiv2.hpp index d4cc566e..0bba515a 100644 --- a/include/exiv2/exiv2.hpp +++ b/include/exiv2/exiv2.hpp @@ -53,17 +53,21 @@ #include "exiv2/mrwimage.hpp" #include "exiv2/orfimage.hpp" #include "exiv2/pgfimage.hpp" + #ifdef EXV_HAVE_LIBZ #include "exiv2/pngimage.hpp" #endif + #include "exiv2/preview.hpp" #include "exiv2/properties.hpp" #include "exiv2/psdimage.hpp" #include "exiv2/rafimage.hpp" #include "exiv2/rw2image.hpp" -#if EXV_USE_SSH == 1 + +#ifdef EXV_USE_SSH #include "exiv2/ssh.hpp" #endif + #include "exiv2/tags.hpp" #include "exiv2/tgaimage.hpp" #include "exiv2/tiffimage.hpp" diff --git a/include/exiv2/http.hpp b/include/exiv2/http.hpp index ccc27a14..eab54f5e 100644 --- a/include/exiv2/http.hpp +++ b/include/exiv2/http.hpp @@ -1,6 +1,7 @@ #ifndef HTTP_HPP_ #define HTTP_HPP_ +#include "config.h" #include #include #include @@ -18,10 +19,7 @@ namespace Exiv2 { EXIV2API int http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::string& errors); } -#ifndef EXV_USE_CURL -#define EXV_USE_CURL 0 -#endif -#if EXV_USE_CURL == 1 +#ifdef EXV_USE_CURL #include #endif diff --git a/include/exiv2/ssh.hpp b/include/exiv2/ssh.hpp index 2750c157..cc698d65 100644 --- a/include/exiv2/ssh.hpp +++ b/include/exiv2/ssh.hpp @@ -24,7 +24,7 @@ // included header files #include "config.h" -#if EXV_USE_SSH == 1 +#ifdef EXV_USE_SSH #include #include #include diff --git a/samples/conntest.cpp b/samples/conntest.cpp index 43eb42e3..bb05bab6 100644 --- a/samples/conntest.cpp +++ b/samples/conntest.cpp @@ -26,7 +26,7 @@ void httpcon(const std::string& url, bool useHttp1_0 = false) { } } -#if EXV_USE_CURL == 1 +#ifdef EXV_USE_CURL void curlcon(const std::string& url, bool useHttp1_0 = false) { CURL* curl = curl_easy_init(); if(!curl) { @@ -68,7 +68,7 @@ void curlcon(const std::string& url, bool useHttp1_0 = false) { } #endif -#if EXV_USE_SSH == 1 +#ifdef EXV_USE_SSH void sshcon(const std::string& url) { Exiv2::Uri uri = Exiv2::Uri::Parse(url); Exiv2::Uri::Decode(uri); @@ -125,7 +125,7 @@ int main(int argc,const char** argv) bool isOk = false; try { - #if EXV_USE_SSH == 1 + #ifdef EXV_USE_SSH if (prot == Exiv2::pSsh) { sshcon(url); isOk = true; @@ -134,7 +134,7 @@ int main(int argc,const char** argv) isOk = true; } #endif - #if EXV_USE_CURL == 1 + #ifdef EXV_USE_CURL if (prot == Exiv2::pHttp || prot == Exiv2::pHttps || prot == Exiv2::pFtp) { curlcon(url, useHttp1_0); isOk = true; diff --git a/src/basicio.cpp b/src/basicio.cpp index 28aa454d..697f92a3 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -46,6 +46,7 @@ EXIV2_RCSID("@(#) $Id$") #include // for alloc, realloc, free #include // for stat, chmod #include // for stat, chmod + #ifdef EXV_HAVE_SYS_MMAN_H # include // for mmap and munmap #endif @@ -55,13 +56,15 @@ EXIV2_RCSID("@(#) $Id$") #ifdef EXV_HAVE_UNISTD_H # include // for getpid, stat #endif -#if EXV_USE_CURL == 1 -#include + +#ifdef EXV_USE_CURL +# include #endif -#if EXV_USE_SSH == 1 -#include "ssh.hpp" + +#ifdef EXV_USE_SSH +# include "ssh.hpp" #else -#define mode_t unsigned short +# define mode_t unsigned short #endif // Platform specific headers for handling extended attributes (xattr) @@ -2079,7 +2082,7 @@ namespace Exiv2 { } #endif -#if EXV_USE_CURL == 1 +#ifdef EXV_USE_CURL //! Internal Pimpl structure of class RemoteIo. class CurlIo::CurlImpl : public Impl { public: @@ -2328,7 +2331,7 @@ namespace Exiv2 { #endif -#if EXV_USE_SSH == 1 +#ifdef EXV_USE_SSH //! Internal Pimpl structure of class RemoteIo. class SshIo::SshImpl : public Impl { public: @@ -2627,7 +2630,7 @@ namespace Exiv2 { return subject; } #endif -#if EXV_USE_CURL == 1 +#ifdef EXV_USE_CURL size_t curlWriter(char* data, size_t size, size_t nmemb, std::string* writerData) { diff --git a/src/image.cpp b/src/image.cpp index 0db66eb0..b2840e45 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -798,16 +798,19 @@ namespace Exiv2 { BasicIo::AutoPtr ImageFactory::createIo(const std::string& path, bool useCurl) { Protocol fProt = fileProtocol(path); -#if EXV_USE_SSH == 1 + +#ifdef EXV_USE_SSH if (fProt == pSsh || fProt == pSftp) { return BasicIo::AutoPtr(new SshIo(path)); // may throw } #endif -#if EXV_USE_CURL == 1 + +#ifdef EXV_USE_CURL if (useCurl && (fProt == pHttp || fProt == pHttps || fProt == pFtp)) { return BasicIo::AutoPtr(new CurlIo(path)); // may throw } #endif + if (fProt == pHttp) return BasicIo::AutoPtr(new HttpIo(path)); // may throw if (fProt == pFileUri) diff --git a/src/ssh.cpp b/src/ssh.cpp index eb745676..68ad1273 100644 --- a/src/ssh.cpp +++ b/src/ssh.cpp @@ -32,7 +32,8 @@ EXIV2_RCSID("@(#) $Id: rw2image.cpp 3201 2013-12-01 12:13:42Z ahuggel $") // included header files #include "config.h" #include "ssh.hpp" -#if EXV_USE_SSH == 1 + +#ifdef EXV_USE_SSH // class member definitions namespace Exiv2 { diff --git a/src/version.cpp b/src/version.cpp index a2278429..ddc3b90d 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -31,15 +31,7 @@ EXIV2_RCSID("@(#) $Id$") #include "config.h" -#ifndef EXV_USE_SSH -#define EXV_USE_SSH 0 -#endif - -#ifndef EXV_USE_CURL -#define EXV_USE_CURL 0 -#endif - -#if EXV_USE_CURL == 1 +#ifdef EXV_USE_CURL #include #endif @@ -53,32 +45,12 @@ EXIV2_RCSID("@(#) $Id$") # endif #endif -#ifndef EXV_HAVE_XMP_TOOLKIT -#define EXV_HAVE_XMP_TOOLKIT 0 -#endif - -#ifndef EXV_HAVE_STRINGS -#define EXV_HAVE_STRINGS 0 -#endif - -#ifndef EXV_SYS_TYPES -#define EXV_SYS_TYPES 0 -#endif - -#ifndef EXV_HAVE_UNISTD -#define EXV_HAVE_UNISTD 0 -#endif - -#ifndef EXV_UNICODE_PATH -#define EXV_UNICODE_PATH 0 -#endif - #include "http.hpp" #include "version.hpp" #include "makernote_int.hpp" // Adobe XMP Toolkit -#if EXV_HAVE_XMP_TOOLKIT +#ifdef EXV_HAVE_XMP_TOOLKIT #include "xmp_exiv2.hpp" #endif @@ -319,6 +291,8 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) int enable_video =0; int enable_webready =0; + int use_curl =0; + int use_ssh =0; #ifdef EXV_HAVE_GMTIME_R have_gmtime_r=1; @@ -460,6 +434,14 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) enable_webready=1; #endif +#ifdef EXV_USE_CURL + use_curl=1; +#endif + +#ifdef EXV_USE_SSH + use_ssh=1; +#endif + #if defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW__) // enumerate loaded libraries and determine path to executable HMODULE handles[200]; @@ -516,8 +498,8 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) output(os,keys,"version" , __VERSION__); output(os,keys,"date" , __DATE__ ); output(os,keys,"time" , __TIME__ ); - output(os,keys,"ssh" , EXV_USE_SSH); -#if EXV_USE_CURL == 1 + +#ifdef EXV_USE_CURL std::string curl_protocols; curl_version_info_data* vinfo = curl_version_info(CURLVERSION_NOW); for (int i = 0; vinfo->protocols[i]; i++) { @@ -525,9 +507,9 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) curl_protocols += " " ; } output(os,keys,"curlprotocols" ,curl_protocols); -#else - output(os,keys,"curl" , EXV_USE_CURL); #endif + + output(os,keys,"curl" , use_curl); output(os,keys,"id" , "$Id$"); if ( libs.begin() != libs.end() ) { output(os,keys,"executable" ,*libs.begin()); @@ -570,6 +552,9 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) output(os,keys,"have_unicode_path" ,have_unicode_path); output(os,keys,"enable_video" ,enable_video ); output(os,keys,"enable_webready" ,enable_webready ); + output(os,keys,"use_curl" ,use_curl ); + output(os,keys,"use_ssh" ,use_ssh ); + output(os,keys,"config_path" ,Exiv2::Internal::getExiv2ConfigPath()); // #1147 @@ -579,7 +564,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) uid_t gid = getgid() ; output(os,keys,"gid" , gid ); #endif -#if EXV_HAVE_XMP_TOOLKIT +#ifdef EXV_HAVE_XMP_TOOLKIT const char* name = "xmlns"; Exiv2::Dictionary ns; From 657d59b293d5553ddbfb602c4ba9dcd837e4f84f Mon Sep 17 00:00:00 2001 From: clanmills Date: Wed, 13 Sep 2017 18:19:25 +0100 Subject: [PATCH 18/29] cmakeBuild.cmd - Release Candidate including --webready. --- contrib/cmake/msvc/ReadMe.txt | 30 +++++++++++++++++++++--------- contrib/cmake/msvc/cmakeBuild.cmd | 1 - 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/contrib/cmake/msvc/ReadMe.txt b/contrib/cmake/msvc/ReadMe.txt index e250b3a8..f6e74569 100755 --- a/contrib/cmake/msvc/ReadMe.txt +++ b/contrib/cmake/msvc/ReadMe.txt @@ -22,13 +22,13 @@ How to use this Please get "Windows" versions of cmake/svn/7z (NOT Cygwin or MinGW versions) - cd /contrib/cmake/msvc - ...\cmake\msvc> cmd /c "vcvars 2015 64 && cmakeBuild --build" + cd /contrib/cmake/msvc + ...\cmake\msvc> cmd /c "vcvars 2015 64 & cmakeBuild.cmd --build" - cmakeBuild.cmd creates Visual Studio solution/project files - Option: --build says "build using the generated files" + cmakeBuild.cmd creates Visual Studio solution/project files + Option: --build says "build using the generated files" - More options: --static --test --debug etc --webready (see below) + More options: --static --test --debug --webready etc... (see below) 2 Selecting the version of Visual Studio @@ -94,26 +94,30 @@ How to use this --build Build the code --static Build and link static libraries and programs + --dll Build DLLs (not static libraries) --unicode Build UNICODE path support + --ascii Do not build UNICODE path support --nls Build with Natural Language Support --webready Build and Link the webready feature --video Build and link video support --samples Include samples in projects + --debug Build debug (shorthand for --config Debug) + --release Build release (shorthand for --config Release) - Option/values (See section 9 below) + Option/values (See section 10 below) --zlib zlib-1.2.8 --expath expat-2.1.0 --curl curl-7.44.0 --libssh libssh-0.7.2 Other build key/value pairs: - --config Release | Debug (shorthand = --release --debug) + --config Release | Debug --generator The script default is almost always correct and is passed as -G "Generator" to CMake --work The "work" directory in which the build will be performed (see 4 below) --bash Path to bash.exe to be used when --test is specified. 5 What gets built? - The build is performed in work_Config + The build is performed in work_Config (for example work_Release) The output is generated in dist dist\..mumble..\bin contains *.exe and *.dll files dist\..mumble..\lib contains *.lib files @@ -172,6 +176,13 @@ How to use this cmake --build . --config Release --target install 7 About webready support libraries (openssl, libssh and curl) + + +-----------------------------------------------+ + | cmakeBuild.cmd always builds shared (--dll) | + | when you use --webready | + | You can build static versions of exiv2 and | + | supporting libraries with the msvc/ solution | + +-----------------------------------------------+ a) openssl You cannot build openssl with CMake. However we have prebuilt binaries which @@ -213,7 +224,8 @@ How to use this A 'vanilla' version of libssh will may require those fixes to be applied. 8 Build options - You can inspect CMake options by running grep options on CMakeLists.txt in + You can inspect CMake options by running 'grep option /CMakeLists.txt' + C:\cygwin64\home\rmills\gnu\github\clanmills\exiv2\contrib\cmake\msvc>cd ..\..\.. C:\cygwin64\home\rmills\gnu\github\clanmills\exiv2>grep option CMakeLists.txt # options and their default values diff --git a/contrib/cmake/msvc/cmakeBuild.cmd b/contrib/cmake/msvc/cmakeBuild.cmd index 9e089b5b..ca900353 100755 --- a/contrib/cmake/msvc/cmakeBuild.cmd +++ b/contrib/cmake/msvc/cmakeBuild.cmd @@ -414,7 +414,6 @@ set _RESULT_=%ERRORLEVEL% if DEFINED _PAUSE_ pause exit /b %_RESULT_% -rem ----------------------------------------- rem build a library with CMake. syntax: call:buildLib name cmake-args ... :buildLib cd "%_BUILDDIR_%" From 35c244e91148cd3cf75c0197a5852d942e725eaa Mon Sep 17 00:00:00 2001 From: clanmills Date: Thu, 14 Sep 2017 17:42:28 +0100 Subject: [PATCH 19/29] AdobeXMPsdk. Revert most of xmpsdk/CMakeLists.txt to enable debugging with Xcode. --- config/config.h.cmake | 4 +++- xmpsdk/CMakeLists.txt | 40 +++++++++++++++++----------------------- xmpsdk/include/MD5.h | 2 +- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/config/config.h.cmake b/config/config.h.cmake index 7e4ed424..f481a88c 100644 --- a/config/config.h.cmake +++ b/config/config.h.cmake @@ -1,6 +1,8 @@ // File generated by cmake from config/config.h.cmake. #pragma once +#ifndef _EXV_CONF_H_ +#define _EXV_CONF_H_ // Defined if you want to use libssh for SshIO. #cmakedefine EXV_USE_SSH @@ -171,6 +173,6 @@ #endif /* !EXV_COMMERCIAL_VERSION */ // ------------------------------------------------------------------ - +#endif /* !_EXV_CONF_H_ */ // That's All Folks! // ------------------------------------------------------------------ diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt index 48258bfe..aa564d0f 100644 --- a/xmpsdk/CMakeLists.txt +++ b/xmpsdk/CMakeLists.txt @@ -9,35 +9,29 @@ foreach(_currentfile ${XMPSRC}) endif() endforeach() -# CMake OBJECT LIBRARY (collection of object files) -add_library( xmp_object OBJECT ${XMPSRC} ) - -target_include_directories(xmp_object PRIVATE ${EXPAT_INCLUDE_DIR}) -target_include_directories(xmp_object PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include) - -check_include_file( "stdint.h" EXV_HAVE_STDINT_H ) -if (EXV_HAVE_STDINT_H) - target_compile_definitions(xmp_object PUBLIC EXV_HAVE_STDINT_H) +if(NOT MSVC) + # http://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang + if ( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") + # 1123 - hide xmpsdk symbols + add_definitions( -fvisibility=hidden -fvisibility-inlines-hidden ) + endif() endif() -if( EXIV2_ENABLE_LIBXMP ) - add_library(xmp STATIC $) - target_link_libraries(xmp PUBLIC ${EXPAT_LIBRARIES}) - target_include_directories(xmp PUBLIC ${EXPAT_INCLUDE_DIR}) - target_include_directories(xmp PUBLIC ${CMAKE_SOURCE_DIR}/xmpsdk/include) +add_library( xmp STATIC ${XMPSRC} ) +target_include_directories(xmp PUBLIC ${CMAKE_SOURCE_DIR}/xmpsdk/include) +target_include_directories(xmp PUBLIC ${EXPAT_INCLUDE_DIR}) - # http://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang - if ( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") - # 1123 - hide xmpsdk symbols - target_compile_definitions(xmp PRIVATE -fvisibility=hidden -fvisibility-inlines-hidden ) - endif() +if ( NOT MSVC ) + target_link_libraries(xmp ${EXPAT_LIBRARIES}) +else() + target_link_libraries(xmp Threads::Threads ${EXPAT_LIBRARIES}) +endif() - # 1119 Install libxmp.a for use by third party applications (Thanks, Emmanuel) - install(TARGETS xmp +# 1119 Install libxmp.a for use by third party applications (Thanks, Emmanuel) +install(TARGETS xmp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) -endif() +) # That's all Folks! ## diff --git a/xmpsdk/include/MD5.h b/xmpsdk/include/MD5.h index f6c5e783..dd35d8ba 100644 --- a/xmpsdk/include/MD5.h +++ b/xmpsdk/include/MD5.h @@ -34,7 +34,7 @@ # endif #endif -#if defined(EXV_HAVE_STDINT_H) || defined(__MINGW32__) || defined(__MING64__) +#if defined(EXV_HAVE_STDINT_H) || defined(__MINGW32__) || defined(__MING64__) || defined(__APPLE__) # include #endif From 10e6ebdef3ed5bc4b996010d96912ba9090f1872 Mon Sep 17 00:00:00 2001 From: clanmills Date: Thu, 14 Sep 2017 18:13:46 +0100 Subject: [PATCH 20/29] AdobeXMPsdk Simplification for detection of stdint_h --- xmpsdk/include/MD5.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/xmpsdk/include/MD5.h b/xmpsdk/include/MD5.h index dd35d8ba..15591ba2 100644 --- a/xmpsdk/include/MD5.h +++ b/xmpsdk/include/MD5.h @@ -24,15 +24,7 @@ */ #include - -#ifdef _MSC_VER -// _MSC_VER 1600 == Visual Studio 2010 -# if _MSC_VER < 1600 -# ifdef EXV_HAVE_STDINT_H -# undef EXV_HAVE_STDINT_H -# endif -# endif -#endif +#include "../../include/exiv2/exv_conf.h" #if defined(EXV_HAVE_STDINT_H) || defined(__MINGW32__) || defined(__MING64__) || defined(__APPLE__) # include From 305424bbad7076e389d70f6875a6a3025bb64bdd Mon Sep 17 00:00:00 2001 From: clanmills Date: Fri, 15 Sep 2017 09:01:45 +0100 Subject: [PATCH 21/29] Reverting changes to MD5.h --- xmpsdk/include/MD5.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xmpsdk/include/MD5.h b/xmpsdk/include/MD5.h index 15591ba2..dd35d8ba 100644 --- a/xmpsdk/include/MD5.h +++ b/xmpsdk/include/MD5.h @@ -24,7 +24,15 @@ */ #include -#include "../../include/exiv2/exv_conf.h" + +#ifdef _MSC_VER +// _MSC_VER 1600 == Visual Studio 2010 +# if _MSC_VER < 1600 +# ifdef EXV_HAVE_STDINT_H +# undef EXV_HAVE_STDINT_H +# endif +# endif +#endif #if defined(EXV_HAVE_STDINT_H) || defined(__MINGW32__) || defined(__MING64__) || defined(__APPLE__) # include From e063a8eea2893ea189d86b8591b0ce64f57d89d4 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 15 Sep 2017 10:45:53 +0100 Subject: [PATCH 22/29] cmakeBuild.cmd bug fix --- contrib/cmake/msvc/cmakeBuild.cmd | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/cmake/msvc/cmakeBuild.cmd b/contrib/cmake/msvc/cmakeBuild.cmd index ca900353..5528749b 100755 --- a/contrib/cmake/msvc/cmakeBuild.cmd +++ b/contrib/cmake/msvc/cmakeBuild.cmd @@ -353,7 +353,6 @@ pushd "%EXIV_B%" popd goto error_end ) - copy/y "%_WORK_%\exiv2\exv_conf.h" "%_INCPATH_%" rem if DEFINED _BUILDX_ devenv %_WORK_%\exiv2\exiv2.sln /Build "%_CONFIG_%|%Platform%" /ProjectConfig INSTALL From 22aaff8682d6dd611dc13e1c089eee896b556b53 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 15 Sep 2017 20:15:58 +0100 Subject: [PATCH 23/29] Fix cmakeBuild.cmd --static to use zlibstatic.lib --- contrib/cmake/msvc/cmakeBuild.cmd | 13 +++++++++---- samples/CMakeLists.txt | 11 +++++++++-- src/CMakeLists.txt | 8 ++------ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/contrib/cmake/msvc/cmakeBuild.cmd b/contrib/cmake/msvc/cmakeBuild.cmd index 5528749b..7a6c7022 100755 --- a/contrib/cmake/msvc/cmakeBuild.cmd +++ b/contrib/cmake/msvc/cmakeBuild.cmd @@ -249,9 +249,8 @@ if defined _TEST_ if NOT EXIST "%_BASH_%" ( if NOT DEFINED _GENERATOR_ set "_GENERATOR_=%VS_CMAKE%" if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles" -if /I "%_SHARED_%" == "0" set _LINK_="-DCMAKE_LINK=static" -rem Fix up for openssl/vs 2017 +rem Fixup for openssl/vs 2017 if /I "%_OPENSSL_%" == "openssl-1.0.1p" if /I "%_VS_%" == 2017 set _OPENSSL_ = openssl-1.1.0f call:cltest @@ -263,6 +262,12 @@ IF DEFINED _PAUSE_ pause echo ---------- ZLIB building with cmake ------------------ call:buildLib %_ZLIB_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% +rem Fixup ZLIB. This should be possible inside CMake +if /I "%_MODE_%" == "static" ( + if EXIST "%_WORK_%\%_ZLIB_%\%_CONFIG_%\zlibstaticd.lib" copy/y "%_WORK_%\%_ZLIB_%\%_CONFIG_%\zlibstaticd.lib" "%_LIBPATH_%\zlibd.lib" + if EXIST "%_WORK_%\%_ZLIB_%\%_CONFIG_%\zlibstatic.lib" copy/y "%_WORK_%\%_ZLIB_%\%_CONFIG_%\zlibstatic.lib" "%_LIBPATH_%\zlib.lib" +) + echo ---------- EXPAT building with cmake ----------------- set "_TARGET_=--target expat" if /I "%_SHARED_%" == "0" ( @@ -341,7 +346,7 @@ pushd "%EXIV_B%" set BUILD_SAMPLES=OFF if DEFINED _SAMPLES_ set BUILD_SAMPLES=ON - call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% ^ + call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% ^ -DEXIV2_ENABLE_NLS=%_NLS_% -DEXIV2_BUILD_SAMPLES=%BUILD_SAMPLES% ^ -DEXIV2_ENABLE_WIN_UNICODE=%_UNICODE_% -DBUILD_SHARED_LIBS=%ENABLE_SHARED% ^ -DEXIV2_ENABLE_DYNAMIC_RUNTIME=%ENABLE_DYNAMIC% ^ @@ -429,7 +434,7 @@ IF NOT EXIST "%LOB%" 7z x "%LOB_TAR%" if NOT EXIST "%LOB_B%" mkdir "%LOB_B%" pushd "%LOB_B%" - call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% %* ..\..\%LOB% + call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %* ..\..\%LOB% IF errorlevel 1 ( echo "*** cmake errors in %LOB% ***" popd diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index d7462a3a..b8d43821 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -43,6 +43,10 @@ endforeach() ################################### +if (MSVC) + link_directories(${CMAKE_INSTALL_PREFIX}/lib) +endif() + add_executable( metacopy metacopy.cpp ../src/utils.cpp) list(APPEND APPLICATIONS metacopy) target_link_libraries( metacopy PRIVATE exiv2lib) @@ -85,18 +89,21 @@ list(APPEND APPLICATIONS conntest) # ****************************************************************************** # remotetest application add_executable(remotetest remotetest.cpp) -target_link_libraries(remotetest exiv2lib) +target_link_libraries(remotetest PRIVATE exiv2lib) list(APPEND APPLICATIONS remotetest) # ****************************************************************************** # set compiler -DEXV_HAVE_DLL when linking exiv2 dll foreach(application ${APPLICATIONS}) + message(STATUS "sample: ${application}") if ( BUILD_SHARED_LIBS ) target_compile_definitions(${application} PRIVATE EXV_HAVE_DLL ) endif() + if( EXIV2_ENABLE_PNG ) + target_link_libraries( ${application} PRIVATE ${ZLIB_LIBRARIES} ) + endif() endforeach() - # ****************************************************************************** # Man page install( FILES exiv2samples.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ea666721..e1c4de6a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -83,18 +83,14 @@ endif() if ( MSVC ) target_compile_definitions(exiv2lib PRIVATE PSAPI_VERSION=1) # to be compatible with <= WinVista (#905) - if( EXIV2_ENABLE_PNG ) - target_link_libraries( exiv2lib PRIVATE ${ZLIB_LIBRARIES} ) - endif() - source_group("Header Files" FILES ${LIBEXIV2_HDR} ) source_group("Header Files" FILES ${LIBCURL_HDR} ) source_group("Header Files" FILES ${SSH_HDR} ) - target_link_libraries( exiv2lib PRIVATE ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} ${SSH_LIBRARIES}) + target_link_libraries( exiv2lib PRIVATE ${CURL_LIBRARIES} ${SSH_LIBRARIES}) else() # TODO: Check if this is really needed. if ( UNIX AND NOT FREEBSD ) - target_link_libraries( exiv2lib PRIVATE dl) # -ldl = dynamic loader used by src/version.cpp + target_link_libraries( exiv2lib PRIVATE ${CMAKE_DL_LIBS}) # -ldl = dynamic loader used by src/version.cpp endif() target_link_libraries( exiv2lib PRIVATE Threads::Threads) target_link_libraries( exiv2lib PUBLIC ${CURL_LIBRARIES} ${SSH_LIBRARIES}) From b992264379bf107ac72143374e4adcf55fbeaa80 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Mon, 18 Sep 2017 16:26:04 +0100 Subject: [PATCH 24/29] buildserver maintenance --- test/tmp/ReadMe.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/tmp/ReadMe.txt diff --git a/test/tmp/ReadMe.txt b/test/tmp/ReadMe.txt new file mode 100644 index 00000000..d0955f76 --- /dev/null +++ b/test/tmp/ReadMe.txt @@ -0,0 +1 @@ +The test suite uses this directory to store output from commands. From adc6b32aaa10fcf517c908ceaad8933667bd4a9c Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Mon, 18 Sep 2017 19:24:06 +0100 Subject: [PATCH 25/29] buildserver maintenance --- contrib/buildserver/dailyTest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/buildserver/dailyTest.sh b/contrib/buildserver/dailyTest.sh index c8cd86d7..05bf7109 100755 --- a/contrib/buildserver/dailyTest.sh +++ b/contrib/buildserver/dailyTest.sh @@ -111,7 +111,7 @@ case $PLATFORM in msvc) cd /tmp/jenkins/dist - for vs in 2005 2008 2010 2012 2013 2015; do + for vs in 2005 2008 2010 2012 2013 2015 2017; do for arch in x64 Win32; do if [ -e "$PWD/$vs/$arch/dll/Release/bin/exiv2.exe" ] ; then ( # test the delivered exiv2 From 678e2b8517180e14ae885149bedb7ec120f39b0e Mon Sep 17 00:00:00 2001 From: clanmills Date: Fri, 22 Sep 2017 10:05:11 +0100 Subject: [PATCH 26/29] Explicitly list files to be processed CMake generated builds [remove file(GLOB...)] --- po/CMakeLists.txt | 20 +++++- src/CMakeLists.txt | 148 ++++++++++++++++++++++++++++++++++++++---- xmpsdk/CMakeLists.txt | 27 +++++++- 3 files changed, 179 insertions(+), 16 deletions(-) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index be6b8c39..cb34e180 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -1,7 +1,23 @@ # CMakeLists.txt for i18n files -# include all po files in the directory -file(GLOB PO_FILES *.po) +# List of files PO files +set(PO_FILES bs.po + de.po + es.po + fi.po + fr.po + gl.po + ms.po + pl.po + pt.po + ru.po + sk.po + sv.po + ug.po + uk.po + vi.po +) + update_translations(exiv2 ${PO_FILES}) add_translations(exiv2 ${PO_FILES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e1c4de6a..050a15c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,18 +1,140 @@ # CMakeLists.txt for exiv2 library and command-line program -# list of public C++ include files -file(GLOB LIBEXIV2_HDR ../include/exiv2/*.hpp ../include/exiv2/exv_conf.h) - -# list of internal include files only required to build the library -file(GLOB LIBEXIV2_PRIVATE_HDR *_int.hpp) - -# list of library C++ source files -file(GLOB LIBEXIV2_SRC *.cpp) -# remove files which are not part of the library -file(GLOB LIBEXIV2_SRC_NOT actions.cpp exiv2.cpp *test.cpp crwparse.cpp mrwthumb.cpp xmpdump.cpp) -foreach(entry ${LIBEXIV2_SRC_NOT}) - list(REMOVE_ITEM LIBEXIV2_SRC ${entry}) -endforeach() +# C++ source files +set( LIBEXIV2_SRC asfvideo.cpp + basicio.cpp + bmpimage.cpp + canonmn.cpp + casiomn.cpp + convert.cpp + cr2image.cpp + crwedit.cpp + crwimage.cpp + datasets.cpp + easyaccess.cpp + epsimage.cpp + error.cpp + exif.cpp + futils.cpp + fujimn.cpp + gifimage.cpp + http.cpp + image.cpp + ini.cpp + iptc.cpp + jp2image.cpp + jpgimage.cpp + makernote.cpp + matroskavideo.cpp + metadatum.cpp + minoltamn.cpp + mrwimage.cpp + nikonmn.cpp + olympusmn.cpp + orfimage.cpp + panasonicmn.cpp + pentaxmn.cpp + pgfimage.cpp + preview.cpp + properties.cpp + psdimage.cpp + quicktimevideo.cpp + rafimage.cpp + riffvideo.cpp + rw2image.cpp + samsungmn.cpp + sigmamn.cpp + sonymn.cpp + tags.cpp + tgaimage.cpp + tiffcomposite.cpp + tiffimage.cpp + tiffvisitor.cpp + types.cpp + utilsvideo.cpp + value.cpp + version.cpp + webpimage.cpp + xmp.cpp + xmpsidecar.cpp + utilsvideo.cpp + ) + +# Public C++ header files +set( LIBEXIV2_HDR ../include/exiv2/asfvideo.hpp + ../include/exiv2/basicio.hpp + ../include/exiv2/bmpimage.hpp + ../include/exiv2/config.h + ../include/exiv2/convert.hpp + ../include/exiv2/cr2image.hpp + ../include/exiv2/crwimage.hpp + ../include/exiv2/datasets.hpp + ../include/exiv2/easyaccess.hpp + ../include/exiv2/epsimage.hpp + ../include/exiv2/error.hpp + ../include/exiv2/exif.hpp + ../include/exiv2/exiv2.hpp + ../include/exiv2/futils.hpp + ../include/exiv2/gifimage.hpp + ../include/exiv2/http.hpp + ../include/exiv2/image.hpp + ../include/exiv2/ini.hpp + ../include/exiv2/iptc.hpp + ../include/exiv2/jp2image.hpp + ../include/exiv2/jpgimage.hpp + ../include/exiv2/matroskavideo.hpp + ../include/exiv2/metadatum.hpp + ../include/exiv2/mrwimage.hpp + ../include/exiv2/orfimage.hpp + ../include/exiv2/pgfimage.hpp + ../include/exiv2/preview.hpp + ../include/exiv2/properties.hpp + ../include/exiv2/psdimage.hpp + ../include/exiv2/quicktimevideo.hpp + ../include/exiv2/rafimage.hpp + ../include/exiv2/riffvideo.hpp + ../include/exiv2/rwlock.hpp + ../include/exiv2/rw2image.hpp + ../include/exiv2/tags.hpp + ../include/exiv2/tgaimage.hpp + ../include/exiv2/tiffimage.hpp + ../include/exiv2/types.hpp + ../include/exiv2/utilsvideo.hpp + ../include/exiv2/value.hpp + ../include/exiv2/version.hpp + ../include/exiv2/webpimage.hpp + ../include/exiv2/xmp_exiv2.hpp + ../include/exiv2/xmpsidecar.hpp + ../include/exiv2/utilsvideo.hpp + ../include/exiv2/exv_conf.h + ) + +# Private headers only needed to build the library +set( LIBEXIV2_PRIVATE_HDR canonmn_int.hpp + casiomn_int.hpp + cr2image_int.hpp + crwimage_int.hpp + fujimn_int.hpp + makernote_int.hpp + minoltamn_int.hpp + nikonmn_int.hpp + olympusmn_int.hpp + orfimage_int.hpp + panasonicmn_int.hpp + pentaxmn_int.hpp + pngchunk_int.hpp + rcsid_int.hpp + rw2image_int.hpp + samsungmn_int.hpp + sigmamn_int.hpp + sonymn_int.hpp + tags_int.hpp + tiffcomposite_int.hpp + tifffwd_int.hpp + tiffimage_int.hpp + tiffvisitor_int.hpp + ) + if( EXIV2_ENABLE_WEBREADY ) if( EXIV2_ENABLE_CURL) diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt index aa564d0f..ce96b479 100644 --- a/xmpsdk/CMakeLists.txt +++ b/xmpsdk/CMakeLists.txt @@ -1,7 +1,32 @@ # CMakeLists.txt exiv2/xmpsdk # list files to be use to build XMPsdk -file(GLOB XMPSRC src/*.cpp include/*.h include/*.hpp) +set(XMPSRC src/ExpatAdapter.cpp + src/MD5.cpp + src/ParseRDF.cpp + src/UnicodeConversions.cpp + src/WXMPIterator.cpp + src/WXMPMeta.cpp + src/WXMPUtils.cpp + src/XML_Node.cpp + src/XMPCore_Impl.cpp + src/XMPIterator.cpp + src/XMPMeta-GetSet.cpp + src/XMPMeta-Parse.cpp + src/XMPMeta-Serialize.cpp + src/XMPMeta.cpp + src/XMPUtils-FileInfo.cpp + src/XMPUtils.cpp + include/MD5.h + include/TXMPIterator.hpp + include/TXMPMeta.hpp + include/TXMPUtils.hpp + include/XMP_Const.h + include/XMP_Environment.h + include/XMP.incl_cpp + include/XMPSDK.hpp + include/XMP_Version.h +) foreach(_currentfile ${XMPSRC}) if(UNIX AND NOT CYGWIN) From 75935516e36836abca7641d58439ccab3721f7d7 Mon Sep 17 00:00:00 2001 From: clanmills Date: Fri, 22 Sep 2017 10:24:01 +0100 Subject: [PATCH 27/29] Removing test/tmp/ReadMe.txt which was added to counter test/tmp not being created --- test/tmp/ReadMe.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 test/tmp/ReadMe.txt diff --git a/test/tmp/ReadMe.txt b/test/tmp/ReadMe.txt deleted file mode 100644 index d0955f76..00000000 --- a/test/tmp/ReadMe.txt +++ /dev/null @@ -1 +0,0 @@ -The test suite uses this directory to store output from commands. From e3298ab5e172cc1a2573befdf463cca28950cbb1 Mon Sep 17 00:00:00 2001 From: clanmills Date: Tue, 26 Sep 2017 22:32:27 +0100 Subject: [PATCH 28/29] Integrating #55 and #78 --- include/exiv2/value.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index 64a8ca7f..2078c6bd 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -44,6 +44,7 @@ #include #include #include +#include // ***************************************************************************** // namespace extensions @@ -1662,7 +1663,7 @@ namespace Exiv2 { template<> inline long ValueType::toLong(long n) const { - ok_ = (value_[n].second != 0); + ok_ = (value_[n].second != 0 && INT_MIN < value_[n].first && value_[n].first < INT_MAX ); if (!ok_) return 0; return value_[n].first / value_[n].second; } From ae253b95d15ab260cbe31fd8e446b12fdf7e2d58 Mon Sep 17 00:00:00 2001 From: clanmills Date: Tue, 26 Sep 2017 22:54:49 +0100 Subject: [PATCH 29/29] Adding missing test file. --- test/data/POC8 | Bin 0 -> 2044 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 test/data/POC8 diff --git a/test/data/POC8 b/test/data/POC8 new file mode 100755 index 0000000000000000000000000000000000000000..8a1c03b9b712381504c85ce005e69a022a21a397 GIT binary patch literal 2044 zcmdT^y-ve07`#9jU<8sUAWATbz@c1AD;^YVHEg-C)~WhuEO4;It#xTHl@2 z4~V#sDvNKYmSn+xO8Y^s<~J)8<1u4|p5I@_U@|WJhcH^0e3Iewp(>?9YIestDxk9Y z;u=v1FH@;*n5U~qAXSkT=nwY!_;T5}T6VA|c2lGU#}YZhS1>dPJ>renn8!y%sFXdV zaYF{x5#^$CSegJHwv^EvTarVXa(#|~dXrf^q@eEWS0ku2i_PgpGX}XYErGTquL(tM z(p*$=LqbDe8{aFwb-#lXg#9i&N$9B}tPq9QrJsB#64-p1HR=X#Jn!o&ody54IwWUAk6uDVa98{6TM=InlGLe$*T9sXi)r literal 0 HcmV?d00001