Merge pull request #81 from piponazo/robinChanges

Robin changes
v0.27.3
Robin Mills 8 years ago committed by GitHub
commit 2f0104879a

@ -1,10 +1,4 @@
# CMake build system for exiv2 library and executables # CMakeLists.txt for exiv2 library
# Copyright 2015- Daniel Kaneider <danielkaneider@users.sf.net>
# Copyright 2010-2012 Gilles Caulier <caulier dot gilles at gmail dot com>
# Copyright 2008 Patrick Spendrin <ps_ml at gmx dot de>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
cmake_minimum_required( VERSION 3.1.0 ) cmake_minimum_required( VERSION 3.1.0 )
project( exiv2 ) project( exiv2 )
@ -38,59 +32,58 @@ option( EXIV2_ENABLE_NLS "Build native language support (requires gett
option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON )
option( EXIV2_ENABLE_LENSDATA "Build including lens data" 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_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_VIDEO "Build video support into library" OFF )
option( EXIV2_ENABLE_WEBREADY "Build webready 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_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_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF )
option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" 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" OFF )
else() option( EXIV2_BUILD_SAMPLES "Build sample applications" ON )
option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON ) option( EXIV2_BUILD_PO "Build translations files" OFF )
option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON )
if ( EXIV2_ENABLE_WEBREADY )
set ( EXIV2_ENABLE_CURL ON )
set ( EXIV2_ENABLE_CURL ON )
set ( EXIV2_ENABLE_SSH ON )
endif() endif()
option( EXIV2_ENABLE_TOOLS "Build exiv2 executable" ON )
include(config/findDependencies.cmake)
include(config/compilerFlags.cmake)
if( EXIV2_ENABLE_COMMERCIAL ) if( EXIV2_ENABLE_COMMERCIAL )
set (EXIV2_ENABLE_LENSDATA OFF) set (EXIV2_ENABLE_LENSDATA OFF)
set (EXIV2_ENABLE_NLS OFF) set (EXIV2_ENABLE_NLS OFF)
endif() endif()
if( MSVC )
set(CMAKE_DEBUG_POSTFIX "d")
endif()
if( EXIV2_ENABLE_XMP ) if( EXIV2_ENABLE_XMP )
set( HAVE_XMP_TOOLKIT ON ) set( HAVE_XMP_TOOLKIT ON )
endif() endif()
include(config/findDependencies.cmake)
include(config/compilerFlags.cmake)
include( config/generateConfigFile.cmake ) include( config/generateConfigFile.cmake )
include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project
include( config/CMakeChecks.txt ) include( config/CMakeChecks.txt )
if( MSVC )
set(CMAKE_DEBUG_POSTFIX "d")
endif()
if( EXIV2_ENABLE_XMP ) if( EXIV2_ENABLE_XMP )
add_subdirectory( xmpsdk ) add_subdirectory( xmpsdk )
endif() endif()
add_subdirectory( src ) add_subdirectory( src )
if( EXIV2_ENABLE_BUILD_SAMPLES ) if( EXIV2_BUILD_SAMPLES )
add_subdirectory( samples ) add_subdirectory( samples )
endif() endif()
if( EXIV2_ENABLE_BUILD_PO ) if( EXIV2_BUILD_PO )
add_subdirectory( po ) add_subdirectory( po )
endif() endif()
## ##
# tests # tests
add_custom_target(tests COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) 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 # http://dev.exiv2.org/boards/3/topics/1364
@ -106,3 +99,6 @@ if( MINGW OR UNIX OR APPLE)
endif() endif()
include( config/printSummary.cmake ) include( config/printSummary.cmake )
# That's all Folks!
##

@ -1,47 +1,36 @@
// File generated by cmake from config/config.h.cmake. // File generated by cmake from config/config.h.cmake.
#pragma once #pragma once
#ifndef _EXV_CONF_H_
#define _EXV_CONF_H_
// Defined to 1 if when using `libssh' for SshIO. // Defined if you want to use libssh for SshIO.
#cmakedefine01 EXV_USE_SSH #cmakedefine EXV_USE_SSH
// Define to 1 if you want to use `libcurl' in httpIO. // Define to 1 if you want to use libcurl in httpIO.
#cmakedefine01 EXV_USE_CURL #cmakedefine EXV_USE_CURL
// Define if you require webready support. // Define if you require webready support.
#cmakedefine EXV_ENABLE_WEBREADY #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 #cmakedefine EXV_HAVE_GMTIME_R
// Define to 1 if you have the <libintl.h> header file. // Define if you have the <libintl.h> header file.
#cmakedefine EXV_HAVE_LIBINTL_H #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 #cmakedefine EXV_ENABLE_NLS
// Define to 1 if you require video support. // Define if you want video support.
#cmakedefine EXV_ENABLE_VIDEO #cmakedefine EXV_ENABLE_VIDEO
// Define if you have correct declaration of strerror_r().
#cmakedefine EXV_HAVE_DECL_STRERROR_R #cmakedefine EXV_HAVE_DECL_STRERROR_R
#ifndef EXV_COMMERCIAL_VERSION // Define to enable the Windows unicode path support.
// 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.
#cmakedefine EXV_UNICODE_PATH #cmakedefine EXV_UNICODE_PATH
/* Define to `const' or to empty, depending on the second argument of `iconv'. */ /* Define to `const' or to empty, depending on the second argument of `iconv'. */
#cmakedefine ICONV_ACCEPTS_CONST_INPUT #cmakedefine ICONV_ACCEPTS_CONST_INPUT
#if defined ICONV_ACCEPTS_CONST_INPUT #if defined ICONV_ACCEPTS_CONST_INPUT
@ -50,19 +39,22 @@
#define EXV_ICONV_CONST #define EXV_ICONV_CONST
#endif #endif
// Definition to indicate if you have the <regex.h> header file. // Define if you have the <regex> header file.
#cmakedefine EXV_HAVE_REGEX #cmakedefine EXV_HAVE_REGEX
// Definition to indicate you have the <memory.h> header file. // Define if you have the <regex.h> header file.
#cmakedefine EXV_HAVE_REGEX_H
// Define if have the <memory.h> header file.
#cmakedefine EXV_HAVE_MEMORY_H #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 #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 #cmakedefine EXV_HAVE_STDBOOL_H
// Definition to indicate if you have the <stdint.h> header file. // Define if you have the <stdint.h> header file.
#cmakedefine EXV_HAVE_STDINT_H #cmakedefine EXV_HAVE_STDINT_H
#ifndef EXV_HAVE_STDINT_H #ifndef EXV_HAVE_STDINT_H
@ -71,53 +63,53 @@
#endif #endif
#endif #endif
// Definition to indicate if you have the <stdlib.h> header file. // Define if you have the <stdlib.h> header file.
#cmakedefine EXV_HAVE_STDLIB_H #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 #cmakedefine EXV_HAVE_STRCHR
// Definition to indicate if you have the `strerror' function. // Define if you have the strerror function.
#cmakedefine EXV_HAVE_STRERROR #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 #cmakedefine EXV_HAVE_STRERROR_R
// Definition to indicate if strerror_r returns char *. // Define if strerror_r returns char *.
#cmakedefine STRERROR_R_CHAR_P #cmakedefine STRERROR_R_CHAR_P
// Definition to indicate if you have the <strings.h> header file. // Define if you have the <strings.h> header file.
#cmakedefine EXV_HAVE_STRINGS_H #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 #cmakedefine EXV_HAVE_STRTOL
// Definition to indicate if you have the `mmap' function. // Define if you have the mmap function.
#cmakedefine EXV_HAVE_MMAP #cmakedefine EXV_HAVE_MMAP
// Definition to indicate if you have the `munmap' function. // Define if you have the munmap function.
#cmakedefine EXV_HAVE_MUNMAP #cmakedefine EXV_HAVE_MUNMAP
// Definition to indicate if you have the <sys/stat.h> header file. // Define if you have <sys/stat.h> header file.
#cmakedefine EXV_HAVE_SYS_STAT_H #cmakedefine EXV_HAVE_SYS_STAT_H
// Definition to indicate if you have the <sys/types.h> header file. // Define if you have the <sys/types.h> header file.
#cmakedefine EXV_HAVE_SYS_TYPES_H #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 #cmakedefine EXV_HAVE_TIMEGM
/* Define to 1 if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#cmakedefine EXV_HAVE_UNISTD_H 1 #cmakedefine EXV_HAVE_UNISTD_H 1
#if !defined( EXV_HAVE_UNISTD_H) && defined(__CYGWIN__) #if !defined( EXV_HAVE_UNISTD_H) && defined(__CYGWIN__)
#define EXV_HAVE_UNISTD_H 1 #define EXV_HAVE_UNISTD_H 1
#endif #endif
// Definition to indicate if you have the <sys/mman.h> header file. // Define if you have the <sys/mman.h> header file.
#cmakedefine EXV_HAVE_SYS_MMAN_H #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 #cmakedefine EXV_HAVE_LIBZ
#if defined(_MSC_VER) && HAVE_LIBZ #if defined(_MSC_VER) && HAVE_LIBZ
@ -126,11 +118,11 @@
#endif #endif
#endif #endif
// Definition to indicate if you have the <process.h> header file. // Define if you have the <process.h> header file.
#cmakedefine EXV_HAVE_PROCESS_H #cmakedefine EXV_HAVE_PROCESS_H
/* Define to 1 if you have the Adobe XMP Toolkit. */ /* Define if you have (Exiv2/xmpsdk) Adobe XMP Toolkit. */
#cmakedefine EXV_HAVE_XMP_TOOLKIT 1 #cmakedefine EXV_HAVE_XMP_TOOLKIT
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing /* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */ slash. */
@ -165,3 +157,22 @@
/* Define to `unsigned' if <sys/types.h> does not define. */ /* Define to `unsigned' if <sys/types.h> does not define. */
#cmakedefine size_t #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 */
// ------------------------------------------------------------------
#endif /* !_EXV_CONF_H_ */
// That's All Folks!
// ------------------------------------------------------------------

@ -47,8 +47,11 @@
/* Define to 1 if you have the <libintl.h> header file. */ /* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H #undef HAVE_LIBINTL_H
/* Define to 1 if you have the <regex> header file. */
#undef HAVE_REGEX
/* Define to 1 if you have the <regex.h> header file. */ /* Define to 1 if you have the <regex.h> header file. */
#define HAVE_REGEX 1 #undef HAVE_REGEX_H
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H

@ -56,7 +56,7 @@ AM_ICONV
# Checks for header files. # Checks for header files.
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
AC_HEADER_STDC 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. # 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 if test "$ADOBE" == "2013" ; then ADOBE_SDK=XMP-Toolkit-SDK-CC201306; fi
ENABLE_XMP=$ADOBE ENABLE_XMP=$ADOBE
XMPSDK_CPPFLAGS="-Ixmpsdk/Adobe/$ADOBE_SDK/public/include" 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 case "$host_os" in
*arwin*) *arwin*)
EXV_DARWIN_FLAGS="-stdlib=libstdc++ -Wno-deprecated" EXV_DARWIN_FLAGS="-stdlib=libstdc++ -Wno-deprecated"

@ -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/mman.h" EXV_HAVE_SYS_MMAN_H )
check_include_file( "sys/stat.h" EXV_HAVE_SYS_STAT_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( "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 ) check_include_file( "inttypes.h" EXV_HAVE_INTTYPES_H )
if (NOT EXV_HAVE_LIBINTL_H) if (NOT EXV_HAVE_LIBINTL_H)
@ -66,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)

@ -19,19 +19,16 @@ message( STATUS "Compiler info: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER})
message( STATUS "------------------------------------------------------------------" ) message( STATUS "------------------------------------------------------------------" )
message( STATUS "${PACKAGE_STRING} configure results <${PACKAGE_URL}>" ) message( STATUS "${PACKAGE_STRING} configure results <${PACKAGE_URL}>" )
OptionOutput( "Building PNG support: " EXIV2_ENABLE_PNG AND ZLIB_FOUND )
OptionOutput( "Building shared library: " BUILD_SHARED_LIBS ) OptionOutput( "Building shared library: " BUILD_SHARED_LIBS )
OptionOutput( "Building PNG support: " EXIV2_ENABLE_PNG AND ZLIB_FOUND )
OptionOutput( "XMP metadata support: " EXIV2_ENABLE_XMP ) OptionOutput( "XMP metadata support: " EXIV2_ENABLE_XMP )
OptionOutput( "Building static libxmp: " EXIV2_ENABLE_LIBXMP ) OptionOutput( "Building static libxmp: " EXIV2_ENABLE_LIBXMP )
OptionOutput( "Native language support: " EXIV2_ENABLE_NLS ) OptionOutput( "Native language support: " EXIV2_ENABLE_NLS )
OptionOutput( "Conversion of Windows XP tags: " EXIV2_ENABLE_PRINTUCS2 ) OptionOutput( "Conversion of Windows XP tags: " EXIV2_ENABLE_PRINTUCS2 )
OptionOutput( "Nikon lens database: " EXIV2_ENABLE_LENSDATA ) OptionOutput( "Nikon lens database: " EXIV2_ENABLE_LENSDATA )
OptionOutput( "Commercial build: " EXIV2_ENABLE_COMMERCIAL ) 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 video support: " EXIV2_ENABLE_VIDEO )
OptionOutput( "Building webready support: " EXIV2_ENABLE_WEBREADY ) OptionOutput( "Building webready support: " EXIV2_ENABLE_WEBREADY )
if ( EXIV2_ENABLE_WEBREADY ) if ( EXIV2_ENABLE_WEBREADY )
OptionOutput( "USE Libcurl for HttpIo: " EXIV2_ENABLE_CURL ) OptionOutput( "USE Libcurl for HttpIo: " EXIV2_ENABLE_CURL )
OptionOutput( "USE Libssh for SshIo: " EXIV2_ENABLE_SSH ) OptionOutput( "USE Libssh for SshIo: " EXIV2_ENABLE_SSH )
@ -41,5 +38,9 @@ if (WIN32)
OptionOutput( "Dynamic runtime override: " EXIV2_ENABLE_DYNAMIC_RUNTIME) OptionOutput( "Dynamic runtime override: " EXIV2_ENABLE_DYNAMIC_RUNTIME)
OptionOutput( "Unicode paths (wstring): " EXIV2_ENABLE_WIN_UNICODE ) OptionOutput( "Unicode paths (wstring): " EXIV2_ENABLE_WIN_UNICODE )
endif() endif()
OptionOutput( "Building exiv2 command: " EXIV2_BUILD_EXIV2_COMMAND )
OptionOutput( "Building samples: " EXIV2_BUILD_SAMPLES )
OptionOutput( "Building PO files: " EXIV2_BUILD_PO )
message( STATUS "------------------------------------------------------------------" ) message( STATUS "------------------------------------------------------------------" )

@ -111,7 +111,7 @@ case $PLATFORM in
msvc) msvc)
cd /tmp/jenkins/dist 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 for arch in x64 Win32; do
if [ -e "$PWD/$vs/$arch/dll/Release/bin/exiv2.exe" ] ; then ( if [ -e "$PWD/$vs/$arch/dll/Release/bin/exiv2.exe" ] ; then (
# test the delivered exiv2 # test the delivered exiv2

@ -1,4 +1,4 @@
@@@Marco@@@@@b ;mm /##Gilles###\ @@@Luis@@@@@b ;mm /##Gilles###\
j@@@#Robin", Brad /@@@Thomas@@@@Q j@@@#Robin", Brad /@@@Thomas@@@@Q
@@@# \ ## @@@b |@@@b @@@# \ ## @@@b |@@@b
@@@# .;;;;, ,;;;, ,;;;; ,;;;p .;;; 7@@ ]Alan @@@# .;;;;, ,;;;, ,;;;; ,;;;p .;;; 7@@ ]Alan
@ -9,7 +9,7 @@
@@@# ,@@##@@m @@@b @@@p @@C #@@#C @@@# ,@@##@@m @@@b @@@p @@C #@@#C
@@@# ,/ s@@# @@@@ @@@b Volker @Tuan@ @@@# ,/ s@@# @@@@ @@@b Volker @Tuan@
]@@@Abhinav@@\ /@@@\ \@@@Q @@@Q %@@@# /@@@@Mahesh@@# ]@@@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 exiv2/contrib/cmake/msvc/ReadMe.txt
----------------------------------- -----------------------------------
@ -22,6 +22,16 @@ How to use this
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)
cd <exiv2dir>/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"
More options: --static --test --debug --webready etc... (see below)
2 Selecting the version of Visual Studio
You should initialize the Visual Studio environment You should initialize the Visual Studio environment
using the version of vcvars32.bat or vcvarsall.bat using the version of vcvars32.bat or vcvarsall.bat
installed with Visual Studio. For example: installed with Visual Studio. For example:
@ -32,15 +42,15 @@ How to use this
out of this - provided Visual Studio is installed in %ProgramFiles(x86)% out of this - provided Visual Studio is installed in %ProgramFiles(x86)%
%ProgramFiles(x86)% is usually c:\Program Files (x86) %ProgramFiles(x86)% is usually c:\Program Files (x86)
vcvars 2005 # sets 2005 x86 vcvars 2005 32 # sets 2005 x86
vcvars 2010 64 # sets 2010 x86_amd64 vcvars 2010 64 # sets 2010 amd64
2 Always build "out of source". I recommend: 3 Always build "out of source". I recommend:
cd <exiv2dir>\contrib\cmake\cmake cd <exiv2dir>\contrib\cmake\cmake
cmd.exe cmd.exe
vcvars 2015 64 vcvars 2015 64
cmakeBuild --help # display syntax and options cmakeBuild --help # display syntax and options
cmakeBuild --rebuild cmakeBuild --build
.... ....
exit exit
@ -65,8 +75,49 @@ How to use this
When you are building happily, you may prefer: When you are building happily, you may prefer:
cmakeBuild --silent cmakeBuild --silent
3 What gets built? 4 Options
The build is performed in work 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
--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
--silent Run script with minimal "chatter"
--verbose Run script with maximum "chatter"
--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
--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 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
--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 (for example work_Release)
The output is generated in dist The output is generated in dist
dist\..mumble..\bin contains *.exe and *.dll files dist\..mumble..\bin contains *.exe and *.dll files
dist\..mumble..\lib contains *.lib files dist\..mumble..\lib contains *.lib files
@ -74,12 +125,12 @@ How to use this
mumble identifies the compiler and build. mumble identifies the compiler and build.
Example C:\gnu\github\exiv2\contrib\cmake\msvc\dist\2013\x64\dll\Release\bin Example C:\gnu\github\exiv2\contrib\cmake\msvc\dist\2013\x64\dll\Release\bin
2013 = Visual Studio Choices: 2005/2008/2010/2012/2013/2015 2013 = Visual Studio Choices: 2005 | 2008 | 2010 | 2012 | 2013 | 2015 | 2017
x64 = 64 bit build Win32/x64 x64 = 64 bit build Win32 | x64
dll = shared library dll/static dll = shared library dll | static
Release = configuration Release/Debug/RelWithDebInfo/MinSizeRel Release = configuration Release | Debug | RelWithDebInfo | MinSizeRel
4 Building manually with CMake 6 Building manually with CMake
The cmake option -G Generator should be chosen for the version of Visual Studio installed. The cmake option -G Generator should be chosen for the version of Visual Studio installed.
cmake --help for more information cmake --help for more information
@ -124,7 +175,14 @@ How to use this
cmake --build . --config Release cmake --build . --config Release
cmake --build . --config Release --target install cmake --build . --config Release --target install
5 About webready support libraries (openssl, libssh and curl) 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 a) openssl
You cannot build openssl with CMake. However we have prebuilt binaries which You cannot build openssl with CMake. However we have prebuilt binaries which
@ -165,37 +223,37 @@ How to use this
The fixes are included in svn://dev.exiv2.org/svn/team/libraries/libssh-0.7.2.tar.gz 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. A 'vanilla' version of libssh will may require those fixes to be applied.
6 Build options 8 Build options
You can inspect CMake options by running grep OPTION on CMakeLists.txt in <exiv2dir> You can inspect CMake options by running 'grep option <exiv2dir>/CMakeLists.txt'
C:\cygwin64\home\rmills\gnu\exiv2\build>cd ..\trunk
C:\cygwin64\home\rmills\gnu\github\clanmills\exiv2\contrib\cmake\msvc>cd ..\..\..
C:\cygwin64\home\rmills\gnu\exiv2\trunk>grep OPTION CMakeLists.txt C:\cygwin64\home\rmills\gnu\github\clanmills\exiv2>grep option CMakeLists.txt
OPTION( BUILD_SHARED_LIBS "Build exiv2 as a shared library (dll)" ON ) # options and their default values
OPTION( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) option( BUILD_SHARED_LIBS "Build exiv2 as a shared library (dll)" ON )
OPTION( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" ON ) option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
OPTION( EXIV2_ENABLE_VIDEO "Build with video support" OFF ) 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_PNG "Build with png support (requires libz)" ON )
OPTION( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON )
OPTION( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON )
OPTION( EXIV2_ENABLE_LENSDATA "Build including lens data" 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_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF )
OPTION( EXIV2_ENABLE_BUILD_SAMPLES "Build the unit tests" ON ) option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF )
OPTION( EXIV2_ENABLE_BUILD_PO "Build translations files" OFF ) option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF )
OPTION( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" 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_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" 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" OFF ) option( EXIV2_BUILD_SAMPLES "Build sample applications" ON )
option( EXIV2_BUILD_PO "Build translations files" OFF )
C:\cygwin64\home\rmills\gnu\exiv2\trunk> option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON )
7 Running the test suite 9 Running the test suite
http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2 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 can run the test-suite directly from cmakeBuild.cmd with the argument --test
You need cygwin's bash.exe to run the test suite. You need cygwin's bash.exe to run the test suite.
8 Building with different versions of the support libraries 10 Building with different versions of the support libraries
You can change the standard libraries. For example, to build with curl-7.39.0 You can change the standard libraries. For example, to build with curl-7.39.0
1) set _CURL_=curl-7.39.0 1) set _CURL_=curl-7.39.0
2) add curl-7.39.0.tar.gz in your build directory 2) add curl-7.39.0.tar.gz in your build directory
@ -204,14 +262,16 @@ How to use this
1) set _OPENSSL_=openssl-1.0.1j 1) set _OPENSSL_=openssl-1.0.1j
2) add openssl-1.0.1j-vs2015.zip into your build directory 2) add openssl-1.0.1j-vs2015.zip into your build directory
9 Rebuilding with VS 2005/8/10/12/13/15 32/64 11 Rebuilding with VS 2005/8/10/12/13/15/17 32/64
The script cmakeBuildAll.cmd is provided for convenience: The script cmakeBuildAll.cmd is provided for convenience:
cmakeBuildAll.cmd --test > rebuildAll.txt cmakeBuildAll.cmd --test > rebuildAll.txt
To view progress, open another shell: tail -f rebuildAll.txt To view progress, open another shell: tail -f rebuildAll.txt
cmakeBuildAll.cmd takes about a hour if you don't specify --webready cmakeBuildAll.cmd takes about a hour if you don't specify --webready
12 build+test cycles of about 5 minutes each. 14 build+test cycles of about 5 minutes each. Just over 1 hour.
With webready, 12 build+test cycles of 12 minutes = 2.5 hours With webready, 14 build+test cycles of 12 minutes = 3 hours
>>>>>>> robin/master
Robin Mills Robin Mills
robin@clanmills.com robin@clanmills.com
Updated: 2017-09-13

@ -2,7 +2,7 @@
int main(int,const char**) 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; int v = (_MSC_VER-1300)/100;
if ( v < 0 || v >= (sizeof(vs)/sizeof(vs[0])) ) v = 0; 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*)); fprintf(stderr,"_%s = %d (%s) sizeof(void*) = %d\n","MSC_VER",_MSC_VER,vs[v],(int)sizeof(void*));

@ -1,41 +1,68 @@
@echo off @echo off
setlocal enableextensions setlocal enableextensions
rem ----
rem always run this script in <exiv2dir>/contrib/cmake/msvc
cd %~dp0
set "_BUILDDIR_=%CD%" set "_BUILDDIR_=%CD%"
call:echo calling cmakeDefaults.cmd
call cmakeDefaults.cmd
IF ERRORLEVEL 1 (
echo "*** cmakeDefaults.cmd has failed ***" >&2
GOTO error_end
)
:GETOPTS :GETOPTS
if /I "%1" == "--bash" set "_BASH_=%2"& shift set _CLAIMED_=0
if /I "%1" == "--config" set "_CONFIG_=%2"& shift if /I "%1" == "--bash" call:set "_BASH_=%2"& shift
if /I "%1" == "--curl" set "_CURL_=%2"& shift if /I "%1" == "--config" call:set "_CONFIG_=%2"& shift
if /I "%1" == "--exiv2" set "_EXIV2_=%2"& shift if /I "%1" == "--curl" call:set "_CURL_=%2"& shift
if /I "%1" == "--expat" set "_EXPAT_=%2"& shift if /I "%1" == "--exiv2" call:set "_EXIV2_=%2"& shift
if /I "%1" == "--generator" set "_GENERATOR_=%2"& shift if /I "%1" == "--expat" call:set "_EXPAT_=%2"& shift
if /I "%1" == "--openssl" set "_OPENSSL_=%2"& shift if /I "%1" == "--generator" call:set "_GENERATOR_=%2"& shift
if /I "%1" == "--libssh" set "_LIBSSH_=%2"& shift if /I "%1" == "--openssl" call:set "_OPENSSL_=%2"& shift
if /I "%1" == "--work" set "_WORK_=%2"& shift if /I "%1" == "--libssh" call:set "_LIBSSH_=%2"& shift
if /I "%1" == "--zlib" set "_ZLIB_=%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" == "--help" call:Help && goto end
if /I "%1" == "--dryrun" set "_DRYRUN_=1" if /I "%1" == "--dryrun" call:set "_DRYRUN_=1"
if /I "%1" == "--nosamples" set "_NOSAMPLES_=1" if /I "%1" == "--build" call:set "_BUILD_=1"
if /I "%1" == "--pause" set "_PAUSE_=1" if /I "%1" == "--samples" call:set "_SAMPLES_=1"
if /I "%1" == "--rebuild" set "_REBUILD_=1" if /I "%1" == "--pause" call:set "_PAUSE_=1"
if /I "%1" == "--silent" set "_SILENT_=1" if /I "%1" == "--silent" call:set "_SILENT_=1"
if /I "%1" == "--static" set "_MODE_=static" if /I "%1" == "--static" call:set "_SHARED_=0"
if /I "%1" == "--test" set "_TEST_=1" if /I "%1" == "--shared" call:set "_SHARED_=1"
if /I "%1" == "--trace" set ("_VERBOSE_=1 && echo on)" if /I "%1" == "--dll" call:set "_SHARED_=1"
if /I "%1" == "--verbose" set "_VERBOSE_=1" if /I "%1" == "--test" call:set "_TEST_=1"
if /I "%1" == "--video" set "_VIDEO_=1" if /I "%1" == "--trace" call:set "_TRACE_=1"
if /I "%1" == "--webready" set "_WEBREADY_=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 shift
if not (%1) EQU () goto GETOPTS if not (%1) EQU () goto GETOPTS
goto main goto main
:set
set %1
set _CLAIMED_=1
exit /b 0
:help :help
call cmakeDefaults >NUL 2>NUL echo Options: --help ^| --silent ^| --verbose ^| --pause ^| --dryrun ^| --trace ^| --test
echo Options: --help ^| --webready ^| --rebuild ^| --video ^| --static echo. --build ^| --static ^| --unicode ^| --nls ^| --webready ^| --video ^| --samples
echo. --silent ^| --verbose ^| --pause ^| --dryrun ^| --test ^| --trace
echo. --exiv2 %_EXIV2_% ^| --work %_WORK_% ^| --config %_CONFIG_% ^| --generator generator echo. --exiv2 %_EXIV2_% ^| --work %_WORK_% ^| --config %_CONFIG_% ^| --generator generator
echo. --zlib %_ZLIB_% ^| --expat %_EXPAT_% ^| --curl %_CURL_% ^| --libssh %_LIBSSH_% echo. --zlib %_ZLIB_% ^| --expat %_EXPAT_% ^| --curl %_CURL_% ^| --libssh %_LIBSSH_%
echo. --bash %_BASH_% echo. --bash %_BASH_%
@ -46,23 +73,30 @@ echo.&&echo.&&echo.
echo.------ cmakeBuild Settings ---------- echo.------ cmakeBuild Settings ----------
echo.bash = %_BASH_% echo.bash = %_BASH_%
echo.binpath = %_BINPATH_% echo.binpath = %_BINPATH_%
echo.build = %_BUILD_%
echo.builddir = %_BUILDDIR_% echo.builddir = %_BUILDDIR_%
echo.config = %_CONFIG_% echo.config = %_CONFIG_%
echo.curl = %_CURL_% echo.curl = %_CURL_%
echo.dryrun = %_DRYRUN_%
echo.exiv2 = %_EXIV2_% echo.exiv2 = %_EXIV2_%
echo.expat = %_EXPAT_% echo.expat = %_EXPAT_%
echo.generator = %_GENERATOR_% echo.generator = %_GENERATOR_%
echo.install = %_INSTALL_%
echo.incpath = %_INCPATH_% echo.incpath = %_INCPATH_%
echo.libpath = %_LIBPATH_% echo.libpath = %_LIBPATH_%
echo.libssh = %_LIBSSH_% echo.libssh = %_LIBSSH_%
echo.mode = %_MODE_% echo.nls = %_NLS_%
echo.openssl = %_OPENSSL_% echo.openssl = %_OPENSSL_%
echo.work = %_WORK_% echo.platform = %PLATFORM%
echo.samples = %_SAMPLES_%
echo.shared = %_SHARED_%
echo.test = %_TEST_% echo.test = %_TEST_%
echo.video = %_VIDEO_% echo.unicode = %_UNICODE_%
echo.vc = %_VC_% echo.vc = %_VC_%
echo.video = %_VIDEO_%
echo.vs = %_VS_% echo.vs = %_VS_%
echo.webready = %_WEBREADY_% echo.webready = %_WEBREADY_%
echo.work = %_WORK_%
echo.zlib = %_ZLIB_% echo.zlib = %_ZLIB_%
echo.&&echo.&&echo. echo.&&echo.&&echo.
exit /b 0 exit /b 0
@ -72,12 +106,6 @@ if NOT DEFINED _SILENT_ set _VERBOSE_=1
set _UNSUPPORTED_= set _UNSUPPORTED_=
rem ---- rem ----
call:echo calling cmakeDefaults.cmd
call cmakeDefaults
IF ERRORLEVEL 1 (
echo "*** cmakeDefaults.cmd has failed ***" >&2
GOTO error_end
)
call:echo _EXIV2_ = %_EXIV2_% call:echo _EXIV2_ = %_EXIV2_%
rem ---- rem ----
@ -91,6 +119,7 @@ IF NOT EXIST "%VSINSTALLDIR%" (
GOTO error_end 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 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 12.0\" set "_VS_=2013" && set "_VC_=12"
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\" set "_VS_=2012" && set "_VC_=11" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\" set "_VS_=2012" && set "_VC_=11"
@ -105,11 +134,17 @@ if NOT DEFINED _VS_ (
) )
call:echo testing architecture 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 Platform=Win32
set RawPlatform=x86 set RawPlatform=x86
set CpuPlatform=ia32 set CpuPlatform=ia32
) ELSE ( )
if NOT DEFINED Platform (
set Platform=x64 set Platform=x64
set RawPlatform=x64 set RawPlatform=x64
set CpuPlatform=intel64 set CpuPlatform=intel64
@ -164,10 +199,26 @@ IF ERRORLEVEL 1 (
GOTO error_end GOTO error_end
) )
rem ----
call:echo fixups
set _WORK_=%_WORK_%_%_CONFIG_%
if DEFINED _TRACE_ (
set _VERBOSE_=1
echo on
)
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
rem ---- rem ----
call:echo testing work directory _WORK_ = %_WORK_% call:echo testing work directory _WORK_ = %_WORK_%
if defined _REBUILD_ if EXIST "%_WORK_%" rmdir/s/q "%_WORK_%" if EXIST "%_WORK_%" rmdir/s/q "%_WORK_%"
if defined _REBUILD_ del/s CMakeCache.txt >NUL 2>NUL del/s CMakeCache.txt >NUL 2>NUL
IF NOT EXIST "%_WORK_%" mkdir "%_WORK_%" IF NOT EXIST "%_WORK_%" mkdir "%_WORK_%"
pushd "%_WORK_%" pushd "%_WORK_%"
set "_WORK_=%CD%" set "_WORK_=%CD%"
@ -178,7 +229,6 @@ rem ----
call:echo testing INSTALL call:echo testing INSTALL
SET _INSTALL_=dist\%_VS_%\%Platform%\%_MODE_%\%_CONFIG_% SET _INSTALL_=dist\%_VS_%\%Platform%\%_MODE_%\%_CONFIG_%
if NOT EXIST %_INSTALL_% mkdir %_INSTALL_% if NOT EXIST %_INSTALL_% mkdir %_INSTALL_%
IF NOT EXIST %_INSTALL_% mkdir %_INSTALL_%
pushd %_INSTALL_% pushd %_INSTALL_%
set "_INSTALL_=%CD%" set "_INSTALL_=%CD%"
popd popd
@ -200,7 +250,8 @@ if defined _TEST_ if NOT EXIST "%_BASH_%" (
if NOT DEFINED _GENERATOR_ set "_GENERATOR_=%VS_CMAKE%" if NOT DEFINED _GENERATOR_ set "_GENERATOR_=%VS_CMAKE%"
if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles" if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles"
if /I "%_MODE_%" == "static" "_LINK_=-DCMAKE_LINK=static" 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 call:cltest
call:report call:report
@ -211,12 +262,18 @@ IF DEFINED _PAUSE_ pause
echo ---------- ZLIB building with cmake ------------------ echo ---------- ZLIB building with cmake ------------------
call:buildLib %_ZLIB_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% 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 ----------------- echo ---------- EXPAT building with cmake -----------------
set "_TARGET_=--target expat" set "_TARGET_=--target expat"
if /I "%_MODE_%" == "static" ( if /I "%_SHARED_%" == "0" (
call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DBUILD_shared=0 -DCMAKE_C_FLAGS_RELEASE=/MT -DBUILD_examples=0 -DBUILD_tests=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 ( ) else (
call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DBUILD_examples=0 -DBUILD_tests=0
) )
set _TARGET_= set _TARGET_=
@ -239,7 +296,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 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_= if errorlevel 1 set _WEBREADY_=
) ELSE ( ) 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 ( if NOT EXIST "%_ONCPATH_%"\curl (
echo ---------- CURL building with nmake ----------------- echo ---------- CURL building with nmake -----------------
IF NOT EXIST %_CURL_%.tar.gz svn export svn://dev.exiv2.org/svn/team/libraries/%_CURL_%.tar.gz >NUL IF NOT EXIST %_CURL_%.tar.gz svn export svn://dev.exiv2.org/svn/team/libraries/%_CURL_%.tar.gz >NUL
@ -268,9 +325,8 @@ if NOT DEFINED _WEBREADY_ set _CURL_= && set _LIBSSH_=
echo ---------- EXIV2 building with cmake ------------------ echo ---------- EXIV2 building with cmake ------------------
set "EXIV_B=%_WORK_%\exiv2" set "EXIV_B=%_WORK_%\exiv2"
if defined _REBUILD_ IF EXIST "%EXIV_B%" rmdir/s/q "%EXIV_B%" IF EXIST "%EXIV_B%" rmdir/s/q "%EXIV_B%"
IF NOT EXIST "%EXIV_B%" mkdir "%EXIV_B%" IF NOT EXIST "%EXIV_B%" mkdir "%EXIV_B%"
pushd "%EXIV_B%" pushd "%EXIV_B%"
set ENABLE_CURL=-DEXIV2_ENABLE_CURL=OFF set ENABLE_CURL=-DEXIV2_ENABLE_CURL=OFF
set ENABLE_LIBSSH=-DEXIV2_ENABLE_SSH=OFF set ENABLE_LIBSSH=-DEXIV2_ENABLE_SSH=OFF
@ -280,19 +336,19 @@ pushd "%EXIV_B%"
set ENABLE_DYNAMIC=ON set ENABLE_DYNAMIC=ON
if defined _CURL_ set ENABLE_CURL=-DEXIV2_ENABLE_CURL=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 _WEBREADY_ set ENABLE_WEBREADY=-DEXIV2_ENABLE_WEBREADY=ON
if defined _VIDEO_ set ENABLE_VIDEO=-DEXIV2_ENABLE_VIDEO=ON if defined _VIDEO_ set ENABLE_VIDEO=-DEXIV2_ENABLE_VIDEO=ON
if /I "%_MODE_%" == "static" ( if /I "%_MODE_%" == "static" (
set ENABLE_SHARED=OFF set ENABLE_SHARED=OFF
set ENABLE_DYNAMIC=OFF set ENABLE_DYNAMIC=OFF
) )
set BUILD_SAMPLES=ON set BUILD_SAMPLES=OFF
if DEFINED _NOSAMPLES_ 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=OFF -DEXIV2_ENABLE_BUILD_SAMPLES=%BUILD_SAMPLES% ^ -DEXIV2_ENABLE_NLS=%_NLS_% -DEXIV2_BUILD_SAMPLES=%BUILD_SAMPLES% ^
-DEXIV2_ENABLE_WIN_UNICODE=OFF -DBUILD_SHARED_LIBS=%ENABLE_SHARED% ^ -DEXIV2_ENABLE_WIN_UNICODE=%_UNICODE_% -DBUILD_SHARED_LIBS=%ENABLE_SHARED% ^
-DEXIV2_ENABLE_DYNAMIC_RUNTIME=%ENABLE_DYNAMIC% ^ -DEXIV2_ENABLE_DYNAMIC_RUNTIME=%ENABLE_DYNAMIC% ^
%ENABLE_WEBREADY% %ENABLE_CURL% %ENABLE_LIBSSH% %ENABLE_VIDEO% ^ %ENABLE_WEBREADY% %ENABLE_CURL% %ENABLE_LIBSSH% %ENABLE_VIDEO% ^
"%_EXIV2_%" "%_EXIV2_%"
@ -303,14 +359,16 @@ pushd "%EXIV_B%"
goto error_end 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 ( IF errorlevel 1 (
echo "*** build errors in EXIV2 ***" >&2 echo "*** build errors in EXIV2 ***" >&2
popd popd
goto error_end 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 ( IF errorlevel 1 (
echo "*** install errors in EXIV2 ***" >&2 echo "*** install errors in EXIV2 ***" >&2
popd popd
@ -327,12 +385,12 @@ if defined _TEST_ (
rem ----------------------------------------- rem -----------------------------------------
rem Exit rem Exit
rem end syntax: goto end rem end syntax: GOTO end
:end :end
endlocal endlocal
exit /b 0 exit /b 0
rem end with an error syntax: call:error_end rem end with an error syntax: GOTO error_end
:error_end :error_end
endlocal endlocal
exit /b 1 exit /b 1
@ -360,7 +418,6 @@ set _RESULT_=%ERRORLEVEL%
if DEFINED _PAUSE_ pause if DEFINED _PAUSE_ pause
exit /b %_RESULT_% exit /b %_RESULT_%
rem -----------------------------------------
rem build a library with CMake. syntax: call:buildLib name cmake-args ... rem build a library with CMake. syntax: call:buildLib name cmake-args ...
:buildLib :buildLib
cd "%_BUILDDIR_%" cd "%_BUILDDIR_%"
@ -377,7 +434,7 @@ IF NOT EXIST "%LOB%" 7z x "%LOB_TAR%"
if NOT EXIST "%LOB_B%" mkdir "%LOB_B%" if NOT EXIST "%LOB_B%" mkdir "%LOB_B%"
pushd "%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 ( IF errorlevel 1 (
echo "*** cmake errors in %LOB% ***" echo "*** cmake errors in %LOB% ***"
popd popd
@ -389,7 +446,20 @@ pushd "%LOB_B%"
echo "*** warning: build errors in %LOB% ***" echo "*** warning: build errors in %LOB% ***"
) )
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 call:run cmake --build . --config %_CONFIG_% --target install
)
IF errorlevel 1 ( IF errorlevel 1 (
echo "*** warning: install errors in %LOB% ***" echo "*** warning: install errors in %LOB% ***"
) )

@ -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 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"

@ -3,17 +3,19 @@
rem set up some defaults to be used by cmakeBuild.cmd and related scripts 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 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 _CONFIG_ set _CONFIG_=Release
if NOT DEFINED _WORK_ SET _WORK_=work if NOT DEFINED _WORK_ set _WORK_=work
if NOT DEFINED _EXIV2_ SET _EXIV2_=..\..\.. if NOT DEFINED _EXIV2_ set _EXIV2_=..\..\..
if NOT DEFINED _CURL_ SET _CURL_=curl-7.45.0 if NOT DEFINED _CURL_ set _CURL_=curl-7.45.0
if NOT DEFINED _LIBSSH_ SET _LIBSSH_=libssh-0.7.2 if NOT DEFINED _LIBSSH_ set _LIBSSH_=libssh-0.7.2
if NOT DEFINED _OPENSSL_ SET _OPENSSL_=openssl-1.0.1p if NOT DEFINED _OPENSSL_ set _OPENSSL_=openssl-1.0.1p
if NOT DEFINED _ZLIB_ SET _ZLIB_=zlib-1.2.8 if NOT DEFINED _ZLIB_ set _ZLIB_=zlib-1.2.8
if NOT DEFINED _EXPAT_ SET _EXPAT_=expat-2.1.0 if NOT DEFINED _EXPAT_ set _EXPAT_=expat-2.1.0
if NOT DEFINED _BASH_ SET _BASH_=c:\cygwin64\bin\bash.exe if NOT DEFINED _BASH_ set _BASH_=c:\cygwin64\bin\bash.exe
if NOT DEFINED _MODE_ SET _MODE_=dll if NOT DEFINED _SHARED_ set _SHARED_=1
if NOT DEFINED COPYCMD SET COPYCMD=/Y 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 rem ---------- check that EXIV2 exists
echo checking that %_EXIV2_% exists echo checking that %_EXIV2_% exists

@ -43,12 +43,6 @@
#ifndef EXV_XPATH_MEMIO #ifndef EXV_XPATH_MEMIO
#define EXV_XPATH_MEMIO 0 #define EXV_XPATH_MEMIO 0
#endif #endif
#ifndef EXV_USE_CURL
#define EXV_USE_CURL 0
#endif
#ifndef EXV_USE_SSH
#define EXV_USE_SSH 0
#endif
// ***************************************************************************** // *****************************************************************************
// namespace extensions // 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. @brief Provides the http, https read/write access and ftp read access for the RemoteIo.
This class is based on libcurl. This class is based on libcurl.
@ -1173,7 +1167,7 @@ namespace Exiv2 {
}; };
#endif #endif
#if EXV_USE_SSH == 1 #ifdef EXV_USE_SSH
/*! /*!
@brief Provides the ssh read/write access and sftp read access for the RemoteIo. @brief Provides the ssh read/write access and sftp read access for the RemoteIo.
This class is based on libssh. This class is based on libssh.
@ -1262,7 +1256,7 @@ namespace Exiv2 {
EXIV2API std::wstring ReplaceStringInPlace(std::wstring subject, const std::wstring& search, EXIV2API std::wstring ReplaceStringInPlace(std::wstring subject, const std::wstring& search,
const std::wstring& replace); const std::wstring& replace);
#endif #endif
#if EXV_USE_CURL == 1 #ifdef EXV_USE_CURL
/*! /*!
@brief The callback function is called by libcurl to write the data @brief The callback function is called by libcurl to write the data
*/ */

@ -78,6 +78,11 @@ typedef int pid_t;
# define CURL_STATICLIB # define CURL_STATICLIB
#endif #endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif // _MSC_VER #endif // _MSC_VER
///// End of Visual Studio Support ///// ///// End of Visual Studio Support /////

@ -53,17 +53,21 @@
#include "exiv2/mrwimage.hpp" #include "exiv2/mrwimage.hpp"
#include "exiv2/orfimage.hpp" #include "exiv2/orfimage.hpp"
#include "exiv2/pgfimage.hpp" #include "exiv2/pgfimage.hpp"
#ifdef EXV_HAVE_LIBZ #ifdef EXV_HAVE_LIBZ
#include "exiv2/pngimage.hpp" #include "exiv2/pngimage.hpp"
#endif #endif
#include "exiv2/preview.hpp" #include "exiv2/preview.hpp"
#include "exiv2/properties.hpp" #include "exiv2/properties.hpp"
#include "exiv2/psdimage.hpp" #include "exiv2/psdimage.hpp"
#include "exiv2/rafimage.hpp" #include "exiv2/rafimage.hpp"
#include "exiv2/rw2image.hpp" #include "exiv2/rw2image.hpp"
#if EXV_USE_SSH == 1
#ifdef EXV_USE_SSH
#include "exiv2/ssh.hpp" #include "exiv2/ssh.hpp"
#endif #endif
#include "exiv2/tags.hpp" #include "exiv2/tags.hpp"
#include "exiv2/tgaimage.hpp" #include "exiv2/tgaimage.hpp"
#include "exiv2/tiffimage.hpp" #include "exiv2/tiffimage.hpp"

@ -1,6 +1,7 @@
#ifndef HTTP_HPP_ #ifndef HTTP_HPP_
#define HTTP_HPP_ #define HTTP_HPP_
#include "config.h"
#include <string> #include <string>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
@ -18,10 +19,7 @@ namespace Exiv2 {
EXIV2API int http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::string& errors); EXIV2API int http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::string& errors);
} }
#ifndef EXV_USE_CURL #ifdef EXV_USE_CURL
#define EXV_USE_CURL 0
#endif
#if EXV_USE_CURL == 1
#include <curl/curl.h> #include <curl/curl.h>
#endif #endif

@ -24,7 +24,7 @@
// included header files // included header files
#include "config.h" #include "config.h"
#if EXV_USE_SSH == 1 #ifdef EXV_USE_SSH
#include <libssh/libssh.h> #include <libssh/libssh.h>
#include <libssh/sftp.h> #include <libssh/sftp.h>
#include <sys/stat.h> #include <sys/stat.h>

@ -1665,7 +1665,7 @@ namespace Exiv2 {
template<> template<>
inline long ValueType<Rational>::toLong(long n) const inline long ValueType<Rational>::toLong(long n) const
{ {
ok_ = (value_[n].second != 0 && -LARGE_INT < value_[n].first && value_[n].first < LARGE_INT); ok_ = (value_[n].second != 0 && INT_MIN < value_[n].first && value_[n].first < INT_MAX );
if (!ok_) return 0; if (!ok_) return 0;
return value_[n].first / value_[n].second; return value_[n].first / value_[n].second;
} }

@ -37,19 +37,13 @@
// + standard includes // + standard includes
#include <vector> #include <vector>
/*! #if defined(HAVE_REGEX)
@brief CPLUSPLUS11 is the value of macro --cplusplus for C++11
*/
#define CPLUSPLUS11 201103L
#if __cplusplus >= CPLUSPLUS11
# include <regex> # include <regex>
/*! /*!
@brief exv_grep_keys_t is a vector of keys to match to strings @brief exv_grep_keys_t is a vector of keys to match to strings
*/ */
typedef std::vector<std::regex> exv_grep_keys_t ; typedef std::vector<std::regex> exv_grep_keys_t ;
#else #elif defined(EXV_HAVE_REGEX_H)
# ifdef EXV_HAVE_REGEX
# include <regex.h> # include <regex.h>
/*! /*!
@brief exv_grep_keys_t is a vector of keys to match to strings @brief exv_grep_keys_t is a vector of keys to match to strings
@ -77,7 +71,6 @@
*/ */
typedef std::vector<Exiv2_grep_key_t> exv_grep_keys_t ; typedef std::vector<Exiv2_grep_key_t> exv_grep_keys_t ;
#endif #endif
#endif
/*! /*!
@brief %Exiv2 MAJOR version number of the library used at compile-time. @brief %Exiv2 MAJOR version number of the library used at compile-time.

@ -1,25 +1,34 @@
# CMake build system for exiv2 library and executables # CMakeLists.txt for i18n files
# Copyright 2008 by Patrick Spendrin <ps_ml@gmx.de>
# Copyright 2010-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# automatically include all po files in the directory # List of files PO files
FILE(GLOB PO_FILES *.po) set(PO_FILES bs.po
de.po
UPDATE_TRANSLATIONS(exiv2 ${PO_FILES}) 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
)
ADD_TRANSLATIONS(exiv2 ${PO_FILES}) update_translations(exiv2 ${PO_FILES})
add_translations(exiv2 ${PO_FILES})
##
# execute xgettext on every file
add_custom_target( pot-update add_custom_target( pot-update
COMMAND xgettext -d ${PACKAGE_NAME} COMMAND xgettext -d ${PACKAGE_NAME}
-s -s -D ${CMAKE_CURRENT_SOURCE_DIR}/..
-D ${CMAKE_CURRENT_SOURCE_DIR}/..
-o ${PACKAGE_NAME}.pot -o ${PACKAGE_NAME}.pot
-p ${CMAKE_CURRENT_SOURCE_DIR}/ -p ${CMAKE_CURRENT_SOURCE_DIR}/
--from-code=UTF-8 --from-code=UTF-8 --files-from=POTFILES.in
--files-from=POTFILES.in
-j -j
--keyword=_ --keyword=_
--package-name=${PACKAGE_NAME} --package-name=${PACKAGE_NAME}
@ -27,3 +36,6 @@ add_custom_target( pot-update
--copyright-holder=${PACKAGE_COPYRIGHT} --copyright-holder=${PACKAGE_COPYRIGHT}
--msgid-bugs-address=${PACKAGE_BUGREPORT} --msgid-bugs-address=${PACKAGE_BUGREPORT}
) )
# That's all Folks!
##

@ -1,10 +1,7 @@
# CMake build system for exiv2 library and executables # CMakeLists.txt for exiv2 library sample applications
# Copyright 2010-2012 Gilles Caulier <caulier dot gilles at gmail dot com>
# Copyright 2008 Patrick Spendrin <ps_ml@gmx.de>
# 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 set( SAMPLES
addmoddel.cpp
convert-test.cpp convert-test.cpp
easyaccess-test.cpp easyaccess-test.cpp
exifcomment.cpp exifcomment.cpp
@ -33,9 +30,12 @@ set( SAMPLES addmoddel.cpp
xmpsample.cpp xmpsample.cpp
) )
##
# build samples AND add them to the APPLICATIONS list
foreach(entry ${SAMPLES}) foreach(entry ${SAMPLES})
string( REPLACE ".cpp" "" target ${entry}) string( REPLACE ".cpp" "" target ${entry})
add_executable( ${target} ${target}.cpp ) add_executable( ${target} ${target}.cpp )
list(APPEND APPLICATIONS ${target})
add_test( ${target}_test ${target} ) add_test( ${target}_test ${target} )
target_link_libraries( ${target} PRIVATE exiv2lib) target_link_libraries( ${target} PRIVATE exiv2lib)
install( TARGETS ${target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install( TARGETS ${target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
@ -43,11 +43,17 @@ endforeach()
################################### ###################################
if (MSVC)
link_directories(${CMAKE_INSTALL_PREFIX}/lib)
endif()
add_executable( metacopy metacopy.cpp ../src/utils.cpp) add_executable( metacopy metacopy.cpp ../src/utils.cpp)
list(APPEND APPLICATIONS metacopy)
target_link_libraries( metacopy PRIVATE exiv2lib) target_link_libraries( metacopy PRIVATE exiv2lib)
target_include_directories(metacopy PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find utils.hpp target_include_directories(metacopy PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find utils.hpp
add_executable( pathtest path-test.cpp ../src/utils.cpp) add_executable( pathtest path-test.cpp ../src/utils.cpp)
list(APPEND APPLICATIONS pathtest)
set_target_properties( pathtest PROPERTIES OUTPUT_NAME path-test ) set_target_properties( pathtest PROPERTIES OUTPUT_NAME path-test )
target_link_libraries( pathtest PRIVATE exiv2lib) target_link_libraries( pathtest PRIVATE exiv2lib)
target_include_directories(pathtest PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find utils.hpp target_include_directories(pathtest PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find utils.hpp
@ -57,6 +63,7 @@ if(NOT EXV_HAVE_TIMEGM )
endif() endif()
add_executable( exiv2json exiv2json.cpp Jzon.cpp) add_executable( exiv2json exiv2json.cpp Jzon.cpp)
list(APPEND APPLICATIONS exiv2json)
target_link_libraries( exiv2json PRIVATE exiv2lib) target_link_libraries( exiv2json PRIVATE exiv2lib)
install( TARGETS metacopy pathtest exiv2json RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install( TARGETS metacopy pathtest exiv2json RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
@ -66,9 +73,10 @@ if (MSVC)
target_sources(metacopy PRIVATE ../src/getopt_win32.c) target_sources(metacopy PRIVATE ../src/getopt_win32.c)
endif() endif()
if( EXIV2_ENABLE_XMP ) if( EXPAT_FOUND )
add_executable( geotag geotag.cpp) 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}) install( TARGETS geotag RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif() endif()
@ -76,17 +84,29 @@ endif()
# connection test application # connection test application
add_executable(conntest conntest.cpp) add_executable(conntest conntest.cpp)
target_link_libraries(conntest PRIVATE exiv2lib) target_link_libraries(conntest PRIVATE exiv2lib)
list(APPEND APPLICATIONS conntest)
# ******************************************************************************
# exifprint application
# ADD_EXECUTABLE( exifprint exifprint.cpp )
# target_link_libraries( exifprint exiv2lib )
# ****************************************************************************** # ******************************************************************************
# remotetest application # remotetest application
add_executable(remotetest remotetest.cpp) 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 # Man page
install( FILES exiv2samples.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) install( FILES exiv2samples.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
# That's all Folks!
##

@ -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) { void curlcon(const std::string& url, bool useHttp1_0 = false) {
CURL* curl = curl_easy_init(); CURL* curl = curl_easy_init();
if(!curl) { if(!curl) {
@ -68,7 +68,7 @@ void curlcon(const std::string& url, bool useHttp1_0 = false) {
} }
#endif #endif
#if EXV_USE_SSH == 1 #ifdef EXV_USE_SSH
void sshcon(const std::string& url) { void sshcon(const std::string& url) {
Exiv2::Uri uri = Exiv2::Uri::Parse(url); Exiv2::Uri uri = Exiv2::Uri::Parse(url);
Exiv2::Uri::Decode(uri); Exiv2::Uri::Decode(uri);
@ -125,7 +125,7 @@ int main(int argc,const char** argv)
bool isOk = false; bool isOk = false;
try { try {
#if EXV_USE_SSH == 1 #ifdef EXV_USE_SSH
if (prot == Exiv2::pSsh) { if (prot == Exiv2::pSsh) {
sshcon(url); sshcon(url);
isOk = true; isOk = true;
@ -134,7 +134,7 @@ int main(int argc,const char** argv)
isOk = true; isOk = true;
} }
#endif #endif
#if EXV_USE_CURL == 1 #ifdef EXV_USE_CURL
if (prot == Exiv2::pHttp || prot == Exiv2::pHttps || prot == Exiv2::pFtp) { if (prot == Exiv2::pHttp || prot == Exiv2::pHttps || prot == Exiv2::pFtp) {
curlcon(url, useHttp1_0); curlcon(url, useHttp1_0);
isOk = true; isOk = true;

@ -1,87 +1,6 @@
# CMake build system for exiv2 library and executables # CMakeLists.txt for exiv2 library and command-line program
# Copyright 2015- Daniel Kaneider <danielkaneider@users.sf.net>
# Copyright 2010-2012 Gilles Caulier <caulier dot gilles at gmail dot com>
# Copyright 2008 Patrick Spendrin <ps_ml@gmx.de>
# Redistribution and use is allowed according to the terms of the BSD license. # C++ source files
# 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 set( LIBEXIV2_SRC asfvideo.cpp
basicio.cpp basicio.cpp
bigtiffimage.cpp bigtiffimage.cpp
@ -142,6 +61,82 @@ set( LIBEXIV2_SRC asfvideo.cpp
utilsvideo.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_WEBREADY )
if( EXIV2_ENABLE_CURL) if( EXIV2_ENABLE_CURL)
set( LIBEXIV2_SRC ${LIBEXIV2_SRC} easyaccess.cpp) set( LIBEXIV2_SRC ${LIBEXIV2_SRC} easyaccess.cpp)
@ -180,11 +175,13 @@ endif()
set_target_properties( exiv2lib PROPERTIES set_target_properties( exiv2lib PROPERTIES
VERSION ${GENERIC_LIB_VERSION} VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
DEFINE_SYMBOL EXV_BUILDING_LIB
OUTPUT_NAME exiv2 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 ( ${BUILD_SHARED_LIBS} ) if ( ${BUILD_SHARED_LIBS} )
target_compile_definitions(exiv2lib PUBLIC EXV_HAVE_DLL) target_compile_definitions(exiv2lib PUBLIC EXV_HAVE_DLL)
@ -239,9 +236,14 @@ if ( MSVC )
PSAPI_VERSION=1 # to be compatible with <= WinVista (#905) PSAPI_VERSION=1 # to be compatible with <= WinVista (#905)
) )
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 ${CURL_LIBRARIES} ${SSH_LIBRARIES})
else() else()
if ( UNIX ) # TODO: Check if this is really needed.
target_link_libraries( exiv2lib PRIVATE ${CMAKE_DL_LIBS}) if ( UNIX AND NOT FREEBSD )
target_link_libraries( exiv2lib PRIVATE ${CMAKE_DL_LIBS}) # -ldl = dynamic loader used by src/version.cpp
endif() endif()
if (CYGWIN OR MINGW) if (CYGWIN OR MINGW)
@ -277,7 +279,8 @@ install(FILES ${LIBEXIV2_HDR}
# ****************************************************************************** # ******************************************************************************
# exiv2 application # exiv2 application
set( EXIV2_SRC exiv2.cpp set( EXIV2_SRC
exiv2.cpp
exiv2app.hpp exiv2app.hpp
actions.cpp actions.cpp
actions.hpp actions.hpp
@ -285,10 +288,13 @@ set( EXIV2_SRC exiv2.cpp
utils.hpp utils.hpp
) )
if(EXIV2_ENABLE_TOOLS) if(EXIV2_BUILD_EXIV2_COMMAND)
add_executable( exiv2 ${EXIV2_SRC} ) add_executable( exiv2 ${EXIV2_SRC} )
target_compile_definitions(exiv2 PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" ) target_compile_definitions(exiv2 PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" )
target_link_libraries( exiv2 PRIVATE exiv2lib ) 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}) install(TARGETS exiv2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif() endif()
@ -309,3 +315,6 @@ endif()
# ****************************************************************************** # ******************************************************************************
# Man page # Man page
install( FILES exiv2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) install( FILES exiv2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
# That's all Folks!
##

@ -591,11 +591,10 @@ namespace Action {
for (Params::Greps::const_iterator g = Params::instance().greps_.begin(); for (Params::Greps::const_iterator g = Params::instance().greps_.begin();
!result && g != Params::instance().greps_.end(); ++g) !result && g != Params::instance().greps_.end(); ++g)
{ {
#if __cplusplus >= CPLUSPLUS11 #if defined(EXV_HAVE_REGEX)
std::smatch m; std::smatch m;
result = std::regex_search(key,m, *g); result = std::regex_search(key,m, *g);
#else #elif defined(EXV_HAVE_REGEX_H)
#ifdef EXV_HAVE_REGEX
result = regexec( &(*g), key.c_str(), 0, NULL, 0) == 0 ; result = regexec( &(*g), key.c_str(), 0, NULL, 0) == 0 ;
#else #else
std::string Pattern(g->pattern_); std::string Pattern(g->pattern_);
@ -606,7 +605,6 @@ namespace Action {
std::transform(Key.begin() , Key.end() ,Key.begin() , ::tolower); std::transform(Key.begin() , Key.end() ,Key.begin() , ::tolower);
} }
result = Key.find(Pattern) != std::string::npos; result = Key.find(Pattern) != std::string::npos;
#endif
#endif #endif
} }
return result ; return result ;

@ -46,6 +46,7 @@ EXIV2_RCSID("@(#) $Id$")
#include <cstdlib> // for alloc, realloc, free #include <cstdlib> // for alloc, realloc, free
#include <sys/types.h> // for stat, chmod #include <sys/types.h> // for stat, chmod
#include <sys/stat.h> // for stat, chmod #include <sys/stat.h> // for stat, chmod
#ifdef EXV_HAVE_SYS_MMAN_H #ifdef EXV_HAVE_SYS_MMAN_H
# include <sys/mman.h> // for mmap and munmap # include <sys/mman.h> // for mmap and munmap
#endif #endif
@ -55,10 +56,12 @@ EXIV2_RCSID("@(#) $Id$")
#ifdef EXV_HAVE_UNISTD_H #ifdef EXV_HAVE_UNISTD_H
# include <unistd.h> // for getpid, stat # include <unistd.h> // for getpid, stat
#endif #endif
#if EXV_USE_CURL == 1
#ifdef EXV_USE_CURL
# include <curl/curl.h> # include <curl/curl.h>
#endif #endif
#if EXV_USE_SSH == 1
#ifdef EXV_USE_SSH
# include "ssh.hpp" # include "ssh.hpp"
#else #else
# define mode_t unsigned short # define mode_t unsigned short
@ -2080,7 +2083,7 @@ namespace Exiv2 {
} }
#endif #endif
#if EXV_USE_CURL == 1 #ifdef EXV_USE_CURL
//! Internal Pimpl structure of class RemoteIo. //! Internal Pimpl structure of class RemoteIo.
class CurlIo::CurlImpl : public Impl { class CurlIo::CurlImpl : public Impl {
public: public:
@ -2329,7 +2332,7 @@ namespace Exiv2 {
#endif #endif
#if EXV_USE_SSH == 1 #ifdef EXV_USE_SSH
//! Internal Pimpl structure of class RemoteIo. //! Internal Pimpl structure of class RemoteIo.
class SshIo::SshImpl : public Impl { class SshIo::SshImpl : public Impl {
public: public:
@ -2628,7 +2631,7 @@ namespace Exiv2 {
return subject; return subject;
} }
#endif #endif
#if EXV_USE_CURL == 1 #ifdef EXV_USE_CURL
size_t curlWriter(char* data, size_t size, size_t nmemb, size_t curlWriter(char* data, size_t size, size_t nmemb,
std::string* writerData) std::string* writerData)
{ {

@ -47,7 +47,9 @@ EXIV2_RCSID("@(#) $Id$")
#include <cassert> #include <cassert>
#include <cctype> #include <cctype>
#ifdef EXV_HAVE_REGEX #if defined(EXV_HAVE_REGEX)
#include <regex>
#elif defined(EXV_HAVE_REGEX_H)
#include <regex.h> #include <regex.h>
#endif #endif
@ -451,10 +453,9 @@ int Params::evalGrep( const std::string& optarg)
std::string pattern; std::string pattern;
std::string ignoreCase("/i"); std::string ignoreCase("/i");
bool bIgnoreCase = ends_with(optarg,ignoreCase,pattern); 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) ); greps_.push_back( std::regex(pattern, bIgnoreCase ? std::regex::icase|std::regex::extended : std::regex::extended) );
#else #elif defined(EXV_HAVE_REGEX_H)
#ifdef EXV_HAVE_REGEX
// try to compile a reg-exp from the input argument and store it in the vector // try to compile a reg-exp from the input argument and store it in the vector
const size_t i = greps_.size(); const size_t i = greps_.size();
greps_.resize(i + 1); greps_.resize(i + 1);
@ -478,7 +479,6 @@ int Params::evalGrep( const std::string& optarg)
} }
#else #else
greps_.push_back(Exiv2_grep_key_t(pattern,bIgnoreCase)); greps_.push_back(Exiv2_grep_key_t(pattern,bIgnoreCase));
#endif
#endif #endif
return result; return result;
} // Params::evalGrep } // Params::evalGrep

@ -829,16 +829,19 @@ namespace Exiv2 {
BasicIo::AutoPtr ImageFactory::createIo(const std::string& path, bool useCurl) BasicIo::AutoPtr ImageFactory::createIo(const std::string& path, bool useCurl)
{ {
Protocol fProt = fileProtocol(path); Protocol fProt = fileProtocol(path);
#if EXV_USE_SSH == 1
#ifdef EXV_USE_SSH
if (fProt == pSsh || fProt == pSftp) { if (fProt == pSsh || fProt == pSftp) {
return BasicIo::AutoPtr(new SshIo(path)); // may throw return BasicIo::AutoPtr(new SshIo(path)); // may throw
} }
#endif #endif
#if EXV_USE_CURL == 1
#ifdef EXV_USE_CURL
if (useCurl && (fProt == pHttp || fProt == pHttps || fProt == pFtp)) { if (useCurl && (fProt == pHttp || fProt == pHttps || fProt == pFtp)) {
return BasicIo::AutoPtr(new CurlIo(path)); // may throw return BasicIo::AutoPtr(new CurlIo(path)); // may throw
} }
#endif #endif
if (fProt == pHttp) if (fProt == pHttp)
return BasicIo::AutoPtr(new HttpIo(path)); // may throw return BasicIo::AutoPtr(new HttpIo(path)); // may throw
if (fProt == pFileUri) if (fProt == pFileUri)

@ -32,7 +32,8 @@ EXIV2_RCSID("@(#) $Id: rw2image.cpp 3201 2013-12-01 12:13:42Z ahuggel $")
// included header files // included header files
#include "config.h" #include "config.h"
#include "ssh.hpp" #include "ssh.hpp"
#if EXV_USE_SSH == 1
#ifdef EXV_USE_SSH
// class member definitions // class member definitions
namespace Exiv2 { namespace Exiv2 {

@ -31,15 +31,7 @@ EXIV2_RCSID("@(#) $Id$")
#include "config.h" #include "config.h"
#ifndef EXV_USE_SSH #ifdef EXV_USE_CURL
#define EXV_USE_SSH 0
#endif
#ifndef EXV_USE_CURL
#define EXV_USE_CURL 0
#endif
#if EXV_USE_CURL == 1
#include <curl/curl.h> #include <curl/curl.h>
#endif #endif
@ -53,32 +45,12 @@ EXIV2_RCSID("@(#) $Id$")
# endif # endif
#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 "http.hpp"
#include "version.hpp" #include "version.hpp"
#include "makernote_int.hpp" #include "makernote_int.hpp"
// Adobe XMP Toolkit // Adobe XMP Toolkit
#if EXV_HAVE_XMP_TOOLKIT #ifdef EXV_HAVE_XMP_TOOLKIT
#include "xmp_exiv2.hpp" #include "xmp_exiv2.hpp"
#endif #endif
@ -173,11 +145,10 @@ static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std:
!bPrint && g != greps.end() ; ++g !bPrint && g != greps.end() ; ++g
) { ) {
std::string Key(key); std::string Key(key);
#if __cplusplus >= CPLUSPLUS11 #if defined(EXV_HAVE_REGEX)
std::smatch m; std::smatch m;
bPrint = std::regex_search(Key,m,*g) || std::regex_search(value,m,*g); bPrint = std::regex_search(Key,m,*g) || std::regex_search(value,m,*g);
#else #elif defined(EXV_HAVE_REGEX_H)
#ifdef EXV_HAVE_REGEX
bPrint = ( 0 == regexec( &(*g), key , 0, NULL, 0) bPrint = ( 0 == regexec( &(*g), key , 0, NULL, 0)
|| 0 == regexec( &(*g), value.c_str(), 0, NULL, 0) || 0 == regexec( &(*g), value.c_str(), 0, NULL, 0)
); );
@ -191,7 +162,6 @@ static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std:
std::transform(Value.begin() , Value.end() ,Value.begin() , ::tolower); std::transform(Value.begin() , Value.end() ,Value.begin() , ::tolower);
} }
bPrint = Key.find(Pattern) != std::string::npos || Value.find(Pattern) != std::string::npos; bPrint = Key.find(Pattern) != std::string::npos || Value.find(Pattern) != std::string::npos;
#endif
#endif #endif
} }
return bPrint; return bPrint;
@ -321,6 +291,8 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
int enable_video =0; int enable_video =0;
int enable_webready =0; int enable_webready =0;
int use_curl =0;
int use_ssh =0;
#ifdef EXV_HAVE_GMTIME_R #ifdef EXV_HAVE_GMTIME_R
have_gmtime_r=1; have_gmtime_r=1;
@ -462,6 +434,14 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
enable_webready=1; enable_webready=1;
#endif #endif
#ifdef EXV_USE_CURL
use_curl=1;
#endif
#ifdef EXV_USE_SSH
use_ssh=1;
#endif
#if defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW__) #if defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW__)
// enumerate loaded libraries and determine path to executable // enumerate loaded libraries and determine path to executable
HMODULE handles[200]; HMODULE handles[200];
@ -518,8 +498,8 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
output(os,keys,"version" , __VERSION__); output(os,keys,"version" , __VERSION__);
output(os,keys,"date" , __DATE__ ); output(os,keys,"date" , __DATE__ );
output(os,keys,"time" , __TIME__ ); 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; std::string curl_protocols;
curl_version_info_data* vinfo = curl_version_info(CURLVERSION_NOW); curl_version_info_data* vinfo = curl_version_info(CURLVERSION_NOW);
for (int i = 0; vinfo->protocols[i]; i++) { for (int i = 0; vinfo->protocols[i]; i++) {
@ -527,9 +507,9 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
curl_protocols += " " ; curl_protocols += " " ;
} }
output(os,keys,"curlprotocols" ,curl_protocols); output(os,keys,"curlprotocols" ,curl_protocols);
#else
output(os,keys,"curl" , EXV_USE_CURL);
#endif #endif
output(os,keys,"curl" , use_curl);
output(os,keys,"id" , "$Id$"); output(os,keys,"id" , "$Id$");
if ( libs.begin() != libs.end() ) { if ( libs.begin() != libs.end() ) {
output(os,keys,"executable" ,*libs.begin()); output(os,keys,"executable" ,*libs.begin());
@ -572,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,"have_unicode_path" ,have_unicode_path);
output(os,keys,"enable_video" ,enable_video ); output(os,keys,"enable_video" ,enable_video );
output(os,keys,"enable_webready" ,enable_webready ); 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()); output(os,keys,"config_path" ,Exiv2::Internal::getExiv2ConfigPath());
// #1147 // #1147
@ -581,7 +564,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
uid_t gid = getgid() ; output(os,keys,"gid" , gid ); uid_t gid = getgid() ; output(os,keys,"gid" , gid );
#endif #endif
#if EXV_HAVE_XMP_TOOLKIT #ifdef EXV_HAVE_XMP_TOOLKIT
const char* name = "xmlns"; const char* name = "xmlns";
Exiv2::Dictionary ns; Exiv2::Dictionary ns;

@ -1,10 +1,6 @@
# CMake build system for exiv2 library and executables # CMakeLists.txt exiv2/xmpsdk
# Copyright 2010-2012 Gilles Caulier <caulier dot gilles at gmail dot com>
# Copyright 2008 Patrick Spendrin <ps_ml at gmx dot de>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# list files to be use to build XMPsdk
set(XMPSRC src/ExpatAdapter.cpp set(XMPSRC src/ExpatAdapter.cpp
src/MD5.cpp src/MD5.cpp
src/ParseRDF.cpp src/ParseRDF.cpp
@ -79,4 +75,6 @@ if( EXIV2_ENABLE_LIBXMP )
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
) )
endif()
# That's all Folks!
##

@ -0,0 +1,281 @@
@echo off
rem ----
rem buildXMPsdk.cmd
setlocal enableextensions
set "_THIS_=%0%"
GOTO main
:help
echo %_THIS_% [Options]
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
rem ----
rem always run this script in <exiv2dir>/xmpsdk
cd %~dp0
set "_BUILDDIR_=%CD%"
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"
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" == "--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
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
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"
)
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"
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
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 ----
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 cmake.exe is on path
cmake.exe > NUL
IF ERRORLEVEL 1 (
echo "*** please ensure cmake.exe is on the PATH ***"
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 curl -O http://download.macromedia.com/pub/developer/xmp/sdk/%_ZIP_%.zip
IF NOT ERRORLEVEL 1 7z x %_ZIP_%.zip 2>nul
cd ..
)
if NOT EXIST Adobe\%_SDK_% (
echo *** ERROR SDK = Adobe\%_SDK_% not found"
GOTO error_end
)
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 and build the SDK
cd Adobe\%_SDK_%\build
if EXIST CMakeCache.txt del CMakeCache.txt
if EXIST CMakeFiles rmdir/s/q CMakeFiles
rem ------------------------------------------------------------------------------
rem The Adobe script GeneratXMPToolkitSDK_win.bat
rem use the CMake Generators "Visual Studio 14 2015 Win64" and "Visual Studio 14 2015"
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"
rem -DXMP_CMAKEFOLDER_NAME="vc14/static/windows_x64" ^
rem -DCMAKE_CL_64=ON ^
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 ------------------------------------------------------------------------------
if DEFINED _GENERATE_ call:generate
if NOT DEFINED _GENERATE_ call:cmakebuild
cd ..\..\..
cd "%_BUILDDIR_%"
if DEFINED _LOG_ call:log >> "%_LOG_%"
call:log
GOTO end
rem -----------------------------------------
rem Functions
rem ----
rem normal end
:end
endlocal
exit /b 0
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
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 ----------------------------------
exit /b 0
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

@ -34,7 +34,7 @@
# endif # endif
#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 <stdint.h> # include <stdint.h>
#endif #endif

@ -446,6 +446,10 @@ typedef uLong FAR uLongf;
# undef _LARGEFILE64_SOURCE # undef _LARGEFILE64_SOURCE
#endif #endif
#if defined(_MSC_VER) && defined(Z_HAVE_UNISTD_H)
#undef Z_HAVE_UNISTD_H
#endif
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
# define Z_HAVE_UNISTD_H # define Z_HAVE_UNISTD_H
#endif #endif

Loading…
Cancel
Save