Merge pull request #21 from piponazo/configFileFromCMake

New way to generate the include/exiv2/exv_conf.h file
v0.27.3
Robin Mills 8 years ago committed by GitHub
commit 8592c10a3e

@ -30,10 +30,9 @@ SET( PACKAGE_COPYRIGHT "Andreas Huggel" )
SET( PACKAGE_BUGREPORT "http://github.com/exiv2/exiv2" )
SET( PACKAGE "exiv2" )
SET( PACKAGE_NAME "exiv2" )
SET( PACKAGE_STRING "exiv2 0.26" )
SET( PACKAGE_TARNAME "exiv2" )
SET( PACKAGE_VERSION "0.26" )
SET( PACKAGE_URL "http://www.exiv2.org" )
SET( PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}" )
SET( GENERIC_LIB_VERSION "26.0.0" )
SET( GENERIC_LIB_SOVERSION "26" )
@ -118,7 +117,8 @@ IF( EXIV2_ENABLE_XMP )
ENDIF()
ENDIF( EXIV2_ENABLE_XMP )
INCLUDE( config/CMakeChecks.txt )
include( config/generateConfigFile.cmake )
include( config/CMakeChecks.txt )
SET( INSTALL_TARGET_STANDARD_ARGS
RUNTIME DESTINATION bin
@ -147,11 +147,6 @@ SET( XMPSRC ${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/ExpatAdapter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/src/XMPUtils.cpp
)
# the following lines need to be added to circumvent the error in xmpsdk\src\MD5.h
IF( ${EXV_HAVE_STDINT_H} )
ADD_DEFINITIONS( -DEXV_HAVE_STDINT_H )
ENDIF( ${EXV_HAVE_STDINT_H} )
ADD_SUBDIRECTORY( xmpsdk )
ADD_SUBDIRECTORY( src )

@ -31,29 +31,8 @@
#
# ConfigureChecks for exiv2
INCLUDE( CheckIncludeFile )
INCLUDE( CheckFunctionExists )
INCLUDE( CheckSymbolExists )
INCLUDE( CheckCSourceCompiles )
INCLUDE( CheckCXXSourceCompiles )
INCLUDE( GNUInstallDirs )
INCLUDE( FindIconv )
SET( STDC_HEADERS ON )
SET( HAVE_DECL_STRERROR_R 0 )
SET( HAVE_PRINTUCS2 ${EXIV2_ENABLE_PRINTUCS2} )
SET( HAVE_LENSDATA ${EXIV2_ENABLE_LENSDATA} )
INCLUDE_DIRECTORIES( ${CMAKE_INCLUDE_PATH} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/xmpsdk/include )
LINK_DIRECTORIES( ${CMAKE_LIBRARY_PATH} )
IF( EXIV2_ENABLE_VIDEO )
SET( ENABLE_VIDEO 1 )
ENDIF( EXIV2_ENABLE_VIDEO )
IF( EXIV2_ENABLE_SHARED )
ADD_DEFINITIONS( -DEXV_HAVE_DLL )
SET( STATIC_FLAG SHARED )
@ -61,176 +40,10 @@ ELSE( EXIV2_ENABLE_SHARED )
SET( STATIC_FLAG STATIC )
ENDIF( EXIV2_ENABLE_SHARED )
# unicode path support on windows
IF( EXIV2_ENABLE_WIN_UNICODE )
IF (WIN32)
SET ( UNICODE_PATH 1 )
SET ( EXV_UNICODE_PATH 1 )
ENDIF()
ENDIF()
IF( EXIV2_ENABLE_COMMERCIAL )
ADD_DEFINITIONS( -DEXV_COMMERCIAL_VERSION )
ENDIF( EXIV2_ENABLE_COMMERCIAL )
IF( ICONV_ACCEPTS_CONST_INPUT )
MESSAGE ( "ICONV_ACCEPTS_CONST_INPUT : yes" )
ENDIF( ICONV_ACCEPTS_CONST_INPUT )
# checking for Header files
check_include_file( "inttypes.h" have_inttypes_h )
check_include_file( "libintl.h" HAVE_LIBINTL_H )
check_include_file( "malloc.h" HAVE_MALLOC_H )
check_include_file( "memory.h" HAVE_MEMORY_H )
check_include_file( "iconv.h" HAVE_ICONV_H )
check_include_file( "stdbool.h" HAVE_STDBOOL_H )
check_include_file( "stdint.h" HAVE_STDINT_H )
check_include_file( "stdlib.h" HAVE_STDLIB_H )
check_include_file( "string.h" HAVE_STRING_H )
check_include_file( "strings.h" HAVE_STRINGS_H )
check_include_file( "unistd.h" HAVE_UNISTD_H )
check_include_file( "wchar.h" HAVE_WCHAR_H )
check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
check_include_file( "sys/time.h" HAVE_SYS_TIME_H )
check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
check_include_file( "sys/mman.h" HAVE_SYS_MMAN_H )
check_include_file( "process.h" HAVE_PROCESS_H )
check_include_file( "regex.h" HAVE_REGEX )
check_function_exists( gmtime_r HAVE_GMTIME_R )
check_function_exists( malloc HAVE_MALLOC )
check_function_exists( memset HAVE_MEMSET )
check_function_exists( mmap HAVE_MMAP )
check_function_exists( munmap HAVE_MUNMAP )
check_function_exists( realloc HAVE_REALLOC )
check_function_exists( strchr HAVE_STRCHR )
check_function_exists( strchr_r HAVE_STRCHR_R )
check_function_exists( strerror HAVE_STRERROR )
check_function_exists( strerror_r HAVE_STRERROR_R )
check_function_exists( strtol HAVE_STRTOL )
check_function_exists( timegm HAVE_TIMEGM )
check_function_exists( vprintf HAVE_VPRINTF )
IF( HAVE_STDBOOL_H )
CHECK_SYMBOL_EXISTS( "_Bool" stdbool.h HAVE__BOOL )
ENDIF( HAVE_STDBOOL_H )
# struct tm in sys/time.h
IF( HAVE_SYS_TIME_H )
CHECK_C_SOURCE_COMPILES( "#include <sys/time.h>
int main() {
struct tm t;
return 0;
}" TM_IN_SYS_TIME )
ENDIF( HAVE_SYS_TIME_H )
IF (NOT HAVE_LIBINTL_H)
SET(ENABLE_NLS 0)
SET(EXIV2_ENABLE_NLS 0)
ENDIF()
#####################################################################################
# strerror_r returns char*
# NOTE : reverting commit #2041, which break compilation under linux and windows
CHECK_C_SOURCE_COMPILES( "#include <string.h>
int main() {
char * c;
c = strerror_r(0,c,0);
return 0;
}" STRERROR_R_CHAR_P )
# function is declared with the above
IF( STRERROR_R_CHAR_P )
SET( HAVE_DECL_STRERROR_R 1 )
ENDIF( STRERROR_R_CHAR_P )
#####################################################################################
# time.h and sys/time.h can be included in the same file
CHECK_C_SOURCE_COMPILES( "#include <time.h>
#include <sys/time.h>
int main() {
return 0;
}" TIME_WITH_SYS_TIME )
# for msvc define to int in exv_conf.h
IF( NOT MSVC )
SET( HAVE_PID_T TRUE )
ENDIF( NOT MSVC )
SET( EXV_SYMBOLS ENABLE_NLS
ENABLE_VIDEO
ENABLE_WEBREADY
HAVE_DECL_STRERROR_R
HAVE_GMTIME_R
HAVE_ICONV
HAVE_ICONV_H
HAVE_INTTYPES_H
HAVE_LENSDATA
HAVE_LIBINTL_H
HAVE_LIBZ
HAVE_MALLOC_H
HAVE_MEMORY_H
HAVE_MEMSET
HAVE_MMAP
HAVE_MUNMAP
HAVE_PRINTUCS2
HAVE_PROCESS_H
HAVE_REALLOC
HAVE_STDBOOL_H
HAVE_STDINT_H
HAVE_STDLIB_H
HAVE_STRCHR
HAVE_STRCHR_R
HAVE_STRERROR
HAVE_STRERROR_R
HAVE_STRINGS_H
HAVE_STRING_H
HAVE_STRTOL
HAVE_SYS_MMAN_H
HAVE_SYS_STAT_H
HAVE_SYS_TIME_H
HAVE_SYS_TYPES_H
HAVE_TIMEGM
HAVE_UNISTD_H
HAVE_VPRINTF
HAVE_WCHAR_H
HAVE_XMP_TOOLKIT
HAVE__BOOL
HAVE_REGEX
UNICODE_PATH
USE_CURL
USE_SSH
PACKAGE
PACKAGE_BUGREPORT
PACKAGE_NAME
PACKAGE_STRING
PACKAGE_TARNAME
PACKAGE_VERSION
STRERROR_R_CHAR_P
)
FOREACH( entry ${EXV_SYMBOLS} )
SET( EXV_${entry} ${${entry}} )
# NOTE: to hack...
# MESSAGE( EXV_${entry} " : " ${${entry}} )
ENDFOREACH( entry ${EXV_SYMBOLS} )
CONFIGURE_FILE( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h )
# when removing support of VS solution files, get rid of this stuff
#VSslnCompat
IF (MSVC)
CONFIGURE_FILE( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_msvc.h )
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/include/exiv2/exv_msvc.h ${CMAKE_BINARY_DIR}/ignore/exv_msvc.h COPYONLY )
INSTALL( FILES ${CMAKE_BINARY_DIR}/ignore/exv_msvc.h DESTINATION include/exiv2 )
ENDIF()
INSTALL( FILES ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h DESTINATION include/exiv2 )
CONFIGURE_FILE(config/exiv2_uninstall.cmake ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake COPYONLY)

@ -1,87 +1,69 @@
/**/
/* Generated by cmake from config/config.h.cmake. */
// File generated by cmake from config/config.h.cmake.
#pragma once
/* Define to 1 if you want to use `libssh' for SshIO. */
#cmakedefine EXV_USE_SSH 1
// Defined to 1 if when using `libssh' for SshIO.
#cmakedefine01 EXV_USE_SSH
/* Define to 1 if you want to use `libcurl' in httpIO. */
#cmakedefine EXV_USE_CURL 1
// Define to 1 if you want to use `libcurl' in httpIO.
#cmakedefine01 EXV_USE_CURL
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#cmakedefine EXV_HAVE_DECL_STRERROR_R 1
// Define if you require webready support.
#cmakedefine EXV_ENABLE_WEBREADY
/* Define to 1 if you have the `gmtime_r' function. */
#cmakedefine EXV_HAVE_GMTIME_R 1
// Define to 1 if you have the `gmtime_r' function.
#cmakedefine EXV_HAVE_GMTIME_R
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine EXV_HAVE_INTTYPES_H 1
// Define to 1 if you have the <libintl.h> header file.
#cmakedefine EXV_HAVE_LIBINTL_H
/* Define to 1 if you have the <libintl.h> header file. */
#cmakedefine EXV_HAVE_LIBINTL_H 1
// Define to 1 if translation of program messages to the user's native language is requested.
#cmakedefine EXV_ENABLE_NLS
/* Define to 1 if you require video support. */
#cmakedefine EXV_ENABLE_VIDEO 1
// Define to 1 if you require video support.
#cmakedefine EXV_ENABLE_VIDEO
/* Define to 1 if you require webready support. */
#cmakedefine EXV_ENABLE_WEBREADY 1
#cmakedefine EXV_HAVE_DECL_STRERROR_R
#ifndef EXV_COMMERCIAL_VERSION
/* Define to 1 to enable translation of Nikon lens names. */
#cmakedefine EXV_HAVE_LENSDATA 1
// Definition to enable translation of Nikon lens names.
#cmakedefine EXV_HAVE_LENSDATA
/* Define to 1 if translation of program messages to the user's
native language is requested. */
#cmakedefine EXV_ENABLE_NLS 1
// Define to 1 if you have the `iconv' function.
#cmakedefine EXV_HAVE_ICONV
/* Define to 1 if you have the `iconv' function. */
#cmakedefine EXV_HAVE_ICONV 1
/* Define to 1 to enable conversion of UCS2 encoded Windows tags to UTF-8. */
#cmakedefine EXV_HAVE_PRINTUCS2 1
// Definition to enable conversion of UCS2 encoded Windows tags to UTF-8.
#cmakedefine EXV_HAVE_PRINTUCS2
#endif /* !EXV_COMMERCIAL_VERSION */
/* Define Windows unicode path support. */
#cmakedefine EXV_UNICODE_PATH 1
// Definition 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 1
#cmakedefine ICONV_ACCEPTS_CONST_INPUT
#if defined ICONV_ACCEPTS_CONST_INPUT
#define EXV_ICONV_CONST const
#else
#define EXV_ICONV_CONST
#endif
/* Define to 1 if you have the <regex.h> header file. */
#cmakedefine EXV_HAVE_REGEX 1
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#cmakedefine EXV_HAVE_MALLOC 1
/* Define to 1 if you have the <malloc.h> header file. */
#cmakedefine EXV_HAVE_MALLOC_H 1
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine EXV_HAVE_MEMORY_H 1
// Definition to indicate if you have the <regex.h> header file.
#cmakedefine EXV_HAVE_REGEX
/* Define to 1 if you have the `memset' function. */
#cmakedefine EXV_HAVE_MEMSET 1
// Definition to indicate you have the <memory.h> header file.
#cmakedefine EXV_HAVE_MEMORY_H
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#cmakedefine EXV_HAVE_REALLOC 1
// Definition to indicate if you have the `memset' function.
#cmakedefine EXV_HAVE_MEMSET
/* Define to 1 if stdbool.h conforms to C99. */
#cmakedefine EXV_HAVE_STDBOOL_H 1
// Definition to indicate if stdbool.h conforms to C99.
#cmakedefine EXV_HAVE_STDBOOL_H
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine EXV_HAVE_STDINT_H 1
// Definition to indicate if you have the <stdint.h> header file.
#cmakedefine EXV_HAVE_STDINT_H
#ifndef EXV_HAVE_STDINT_H
#if defined(__MINGW32__) || defined(__MINGW64__)
@ -89,59 +71,50 @@
#endif
#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine EXV_HAVE_STDLIB_H 1
// Definition to indicate if you have the <stdlib.h> header file.
#cmakedefine EXV_HAVE_STDLIB_H
/* Define to 1 if you have the `strchr' function. */
#cmakedefine EXV_HAVE_STRCHR 1
// Definition to indicate if you have the `strchr' function.
#cmakedefine EXV_HAVE_STRCHR
/* Define to 1 if you have the `strerror' function. */
#cmakedefine EXV_HAVE_STRERROR 1
// Definition to indicate if you have the `strerror' function.
#cmakedefine EXV_HAVE_STRERROR
/* Define to 1 if you have the `strerror_r' function. */
#cmakedefine EXV_HAVE_STRERROR_R 1
// Definition to indicate if you have the `strerror_r' function.
#cmakedefine EXV_HAVE_STRERROR_R
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine EXV_HAVE_STRINGS_H 1
// Definition to indicate if strerror_r returns char *.
#cmakedefine STRERROR_R_CHAR_P
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine EXV_HAVE_STRING_H 1
// Definition to indicate if you have the <strings.h> header file.
#cmakedefine EXV_HAVE_STRINGS_H
/* Define to 1 if you have the `strtol' function. */
#cmakedefine EXV_HAVE_STRTOL 1
// Definition to indicate if you have the `strtol' function.
#cmakedefine EXV_HAVE_STRTOL
/* Define to 1 if you have the `mmap' function. */
#cmakedefine EXV_HAVE_MMAP 1
// Definition to indicate if you have the `mmap' function.
#cmakedefine EXV_HAVE_MMAP
/* Define to 1 if you have the `munmap' function. */
#cmakedefine EXV_HAVE_MUNMAP 1
// Definition to indicate if you have the `munmap' function.
#cmakedefine EXV_HAVE_MUNMAP
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine EXV_HAVE_SYS_STAT_H 1
// Definition to indicate if you have the <sys/stat.h> header file.
#cmakedefine EXV_HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine EXV_HAVE_SYS_TIME_H 1
// Definition to indicate if you have the <sys/types.h> header file.
#cmakedefine EXV_HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine EXV_HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `timegm' function. */
#cmakedefine EXV_HAVE_TIMEGM 1
// Definition to indicate if you have the `timegm' function.
#cmakedefine EXV_HAVE_TIMEGM
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine EXV_HAVE_UNISTD_H 1
/* Define to 1 if you have the `vprintf' function. */
#cmakedefine EXV_HAVE_VPRINTF 1
/* Define to 1 if you have the <wchar.h> header file. */
#cmakedefine EXV_HAVE_WCHAR_H 1
// Definition to indicate if you have the <sys/mman.h> header file.
#cmakedefine EXV_HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#cmakedefine EXV_HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the `zlib' library. */
#cmakedefine EXV_HAVE_LIBZ 1
// Definition to indicate if the `zlib' library will be used
#cmakedefine EXV_HAVE_LIBZ
#if defined(_MSC_VER) && HAVE_LIBZ
#if (_MSC_VER < 1400) && !defined(vsnprintf)
@ -149,49 +122,28 @@
#endif
#endif
/* Define to 1 if you have the <process.h> header file. */
#cmakedefine EXV_HAVE_PROCESS_H 1
// Definition to indicate if you have the <process.h> header file.
#cmakedefine EXV_HAVE_PROCESS_H
/* Define to 1 if you have the Adobe XMP Toolkit. */
#cmakedefine EXV_HAVE_XMP_TOOLKIT 1
/* Define to 1 if the system has the type `_Bool'. */
#cmakedefine EXV_HAVE__BOOL 1
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#cmakedefine EXV_LSTAT_FOLLOWS_SLASHED_SYMLINK 1
/* Define to the address where bug reports for this package should be sent. */
#cmakedefine EXV_PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
/* Define to the name of this package. */
#cmakedefine EXV_PACKAGE "@PACKAGE@"
#cmakedefine EXV_PACKAGE "@EXV_PACKAGE@"
/* Define to the full name of this package. */
#cmakedefine EXV_PACKAGE_NAME "@PACKAGE_NAME@"
#cmakedefine EXV_PACKAGE_NAME "@EXV_PACKAGE_NAME@"
/* Define to the full name and version of this package. */
#cmakedefine EXV_PACKAGE_STRING "@PACKAGE_STRING@"
/* Define to the one symbol short name of this package. */
#cmakedefine EXV_PACKAGE_TARNAME "@PACKAGE_TARNAME@"
#cmakedefine EXV_PACKAGE_STRING "@EXV_PACKAGE_STRING@"
/* Define to the version of this package. */
#cmakedefine EXV_PACKAGE_VERSION "@PACKAGE_VERSION@"
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS 1
/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#cmakedefine TM_IN_SYS_TIME 1
/* Define to empty if `const' does not conform to ANSI C. */
#cmakedefine const
@ -204,9 +156,6 @@
/* Define to rpl_malloc if the replacement function should be used. */
#cmakedefine malloc
/* Define to `int' if <sys/types.h> does not define. */
#cmakedefine HAVE_PID_T 1
/* Define to rpl_realloc if the replacement function should be used. */
#cmakedefine realloc

@ -50,13 +50,6 @@
/* Define to 1 if you have the <regex.h> header file. */
#define HAVE_REGEX 1
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@ -66,10 +59,6 @@
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#undef HAVE_REALLOC
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
@ -91,9 +80,6 @@
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
@ -106,9 +92,6 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
@ -118,12 +101,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
@ -133,9 +110,6 @@
/* Define to 1 if you have the Adobe XMP Toolkit. */
#undef HAVE_XMP_TOOLKIT
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
@ -164,18 +138,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if strerror_r returns char *. */
#undef STRERROR_R_CHAR_P
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Define to empty if `const' does not conform to ANSI C. */
#undef const

@ -2,11 +2,11 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/config/")
find_package(Threads REQUIRED)
include( FindIconv )
if( EXIV2_ENABLE_PNG )
find_package( ZLIB REQUIRED )
include_directories( ${ZLIB_INCLUDE_DIR} )
set (HAVE_LIBZ ${ZLIB_FOUND})
endif( EXIV2_ENABLE_PNG )
if( EXIV2_ENABLE_WEBREADY )
@ -14,13 +14,11 @@ if( EXIV2_ENABLE_WEBREADY )
if( EXIV2_ENABLE_CURL )
find_package( CURL REQUIRED)
include_directories( ${CURL_INCLUDE_DIR} )
set ( USE_CURL 1 )
endif()
if( EXIV2_ENABLE_SSH )
find_package( SSH REQUIRED)
include_directories( ${SSH_INCLUDE_DIR} )
set ( USE_SSH 1 )
endif( EXIV2_ENABLE_SSH )
endif( EXIV2_ENABLE_WEBREADY )
@ -45,13 +43,16 @@ if( EXIV2_ENABLE_NLS )
endif( NOT LOCALEDIR )
add_definitions( -DEXV_LOCALEDIR="${LOCALEDIR}" )
set( ENABLE_NLS 1 )
# TODO : This is assuming that Intl is always found. This check should be improved and remove
# the manual check in config/generateConfigFile.cmake
endif( EXIV2_ENABLE_NLS )
find_package(Iconv)
if( ICONV_FOUND )
set( HAVE_ICONV 1 )
include_directories(${ICONV_INCLUDE_DIR})
message ( "-- ICONV_INCLUDE_DIR : " ${ICONV_INCLUDE_DIR} )
message ( "-- ICONV_LIBRARIES : " ${ICONV_LIBRARIES} )
message ( "-- ICONV_ACCEPTS_CONST_INPUT : ${ICONV_ACCEPTS_CONST_INPUT}" )
endif( ICONV_FOUND )
if( EXIV2_ENABLE_BUILD_PO )

@ -0,0 +1,68 @@
# Note that the scope of the EXV_ variables in local
if (${EXIV2_ENABLE_WEBREADY})
set(EXV_USE_SSH ${EXIV2_ENABLE_SSH})
set(EXV_USE_CURL ${EXIV2_ENABLE_CURL})
endif()
set(EXV_ENABLE_VIDEO ${EXIV2_ENABLE_VIDEO})
set(EXV_ENABLE_WEBREADY ${EXIV2_ENABLE_WEBREADY})
set(EXV_HAVE_LENSDATA ${EXIV2_ENABLE_LENSDATA})
set(EXV_HAVE_PRINTUCS2 ${EXIV2_ENABLE_PRINTUCS2})
set(EXV_PACKAGE ${PACKAGE})
set(EXV_PACKAGE_VERSION ${PACKAGE_VERSION})
set(EXV_PACKAGE_STRING ${PACKAGE_STRING})
set(EXV_HAVE_XMP_TOOLKIT ${HAVE_XMP_TOOLKIT})
set(EXV_HAVE_ICONV ${ICONV_FOUND})
set(EXV_HAVE_LIBZ ${ZLIB_FOUND})
set(EXV_UNICODE_PATH ${EXIV2_ENABLE_WIN_UNICODE})
# TODO: Try to use the cmake function check_symbol_exists which is more robust
check_function_exists( gmtime_r EXV_HAVE_GMTIME_R )
check_function_exists( memset EXV_HAVE_MEMSET )
check_function_exists( mmap EXV_HAVE_MMAP )
check_function_exists( munmap EXV_HAVE_MUNMAP )
check_function_exists( strchr EXV_HAVE_STRCHR )
check_function_exists( strerror EXV_HAVE_STRERROR )
check_function_exists( strerror_r EXV_HAVE_STRERROR_R )
check_function_exists( strtol EXV_HAVE_STRTOL )
check_function_exists( timegm EXV_HAVE_TIMEGM )
# TODO : Do something about EXV_STRERROR_R_CHAR_P
# TODO: This check should be removed and rely on the check done in findDependencies.cmake
check_include_file( "libintl.h" EXV_HAVE_LIBINTL_H )
check_include_file( "unistd.h" EXV_HAVE_UNISTD_H )
check_include_file( "memory.h" EXV_HAVE_MEMORY_H )
check_include_file( "process.h" EXV_HAVE_PROCESS_H )
check_include_file( "stdbool.h" EXV_HAVE_STDBOOL_H )
check_include_file( "stdint.h" EXV_HAVE_STDINT_H )
check_include_file( "stdlib.h" EXV_HAVE_STDLIB_H )
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( "inttypes.h" EXV_HAVE_INTTYPES_H )
if (NOT EXV_HAVE_LIBINTL_H)
set(EXV_ENABLE_NLS 0)
endif()
include(CheckCSourceCompiles)
#####################################################################################
# strerror_r returns char*
# NOTE : reverting commit #2041, which break compilation under linux and windows
CHECK_C_SOURCE_COMPILES( "#include <string.h>
int main() {
char * c;
c = strerror_r(0,c,0);
return 0;
}" EXV_HAVE_DECL_STRERROR_R )
#####################################################################################
configure_file( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h @ONLY)
#configure_file( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h)

@ -42,14 +42,6 @@
# endif
#endif
#if _MSC_VER >= _MSC_VER_2010
# define EXV_HAVE_STDINT_H 1
#else
# ifdef EXV_HAVE_STDINT_H
# undef EXV_HAVE_STDINT_H
# endif
#endif
#if _MSC_VER_ == _MSC_VER_2012
#define HAVE_NTOHLL 1
#endif
@ -77,16 +69,7 @@ typedef int pid_t;
#endif // _MSC_VER
///// End of Visual Studio Support /////
///// Include exv_platform.h file /////
#ifdef _MSC_VER
# ifdef EXV_MSVC_CONFIGURE
# include "exv_msvc_configure.h"
# else
# include "exv_msvc.h"
# endif
#else
# include "exv_conf.h"
#endif
#include "exv_conf.h"
////////////////////////////////////////
///// End symbol visibility /////////

@ -18,18 +18,9 @@
/* Define to 1 if you have the <process.h> header file. */
#define EXV_HAVE_PROCESS_H 1
/* Define to the address where bug reports for this package should be sent. */
#define EXV_PACKAGE_BUGREPORT "ahuggel@gmx.net"
/* Define to the full name of this package. */
#define EXV_PACKAGE_NAME "exiv2"
/* Define to the full name and version of this package. */
#define EXV_PACKAGE_STRING "exiv2 0.26"
/* Define to the one symbol short name of this package. */
#define EXV_PACKAGE_TARNAME "exiv2"
/* Define to the version of this package. */
#define EXV_PACKAGE_VERSION "0.26"

@ -1,214 +0,0 @@
/**/
/* exv_msvc.h */
#pragma once
#ifndef _EXV_MSVC_H_
#define _EXV_MSVC_H_
/* Define to 1 if you want to use `libssh' for SshIO. */
/* #undef EXV_USE_SSH */
/* Define to 1 if you want to use `libcurl' in httpIO. */
/* #undef EXV_USE_CURL */
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
/* #undef EXV_HAVE_DECL_STRERROR_R */
/* Define to 1 if you have the `gmtime_r' function. */
/* #undef EXV_HAVE_GMTIME_R */
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef EXV_HAVE_INTTYPES_H */
/* Define to 1 if you have the <libintl.h> header file. */
#define EXV_HAVE_LIBINTL_H 1
/* Define to 1 if you require video support. */
/* #undef EXV_ENABLE_VIDEO */
/* Define to 1 if you require webready support. */
/* #undef EXV_ENABLE_WEBREADY */
#ifndef EXV_COMMERCIAL_VERSION
/* Define to 1 to enable translation of Nikon lens names. */
#define EXV_HAVE_LENSDATA 1
/* Define to 1 if translation of program messages to the user's
native language is requested. */
/* #undef EXV_ENABLE_NLS */
/* Define to 1 if you have the `iconv' function. */
/* #undef EXV_HAVE_ICONV */
/* Define to 1 to enable conversion of UCS2 encoded Windows tags to UTF-8. */
#define EXV_HAVE_PRINTUCS2 1
#endif /* !EXV_COMMERCIAL_VERSION */
/* Define Windows unicode path support. */
/* #define EXV_UNICODE_PATH */
/* Define to `const' or to empty, depending on the second argument of `iconv'. */
/* #undef ICONV_ACCEPTS_CONST_INPUT */
#if defined ICONV_ACCEPTS_CONST_INPUT
#define EXV_ICONV_CONST const
#else
#define EXV_ICONV_CONST
#endif
/* Define to 1 if you have the <regex.h> header file. */
/* #undef EXV_HAVE_REGEX */
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
/* #undef EXV_HAVE_MALLOC */
/* Define to 1 if you have the <malloc.h> header file. */
/* #undef EXV_HAVE_MALLOC_H */
/* Define to 1 if you have the <memory.h> header file. */
/* #undef EXV_HAVE_MEMORY_H */
/* Define to 1 if you have the `memset' function. */
#define EXV_HAVE_MEMSET 1
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#define EXV_HAVE_REALLOC 1
/* Define to 1 if stdbool.h conforms to C99. */
/* #undef EXV_HAVE_STDBOOL_H */
/* Define to 1 if you have the <stdint.h> header file. */
/* #undef EXV_HAVE_STDINT_H */
/* Define to 1 if you have the <stdlib.h> header file. */
/* #undef EXV_HAVE_STDLIB_H */
/* Define to 1 if you have the `strchr' function. */
#define EXV_HAVE_STRCHR 1
/* Define to 1 if you have the `strerror' function. */
#define EXV_HAVE_STRERROR 1
/* Define to 1 if you have the `strerror_r' function. */
/* #undef EXV_HAVE_STRERROR_R */
/* Define to 1 if you have the <strings.h> header file. */
/* #undef EXV_HAVE_STRINGS_H */
/* Define to 1 if you have the <string.h> header file. */
/* #undef EXV_HAVE_STRING_H */
/* Define to 1 if you have the `strtol' function. */
#define EXV_HAVE_STRTOL 1
/* Define to 1 if you have the `mmap' function. */
/* #undef EXV_HAVE_MMAP */
/* Define to 1 if you have the `munmap' function. */
/* #undef EXV_HAVE_MUNMAP */
/* Define to 1 if you have the <sys/stat.h> header file. */
/* #undef EXV_HAVE_SYS_STAT_H */
/* Define to 1 if you have the <sys/time.h> header file. */
/* #undef EXV_HAVE_SYS_TIME_H */
/* Define to 1 if you have the <sys/types.h> header file. */
/* #undef EXV_HAVE_SYS_TYPES_H */
/* Define to 1 if you have the `timegm' function. */
/* #undef EXV_HAVE_TIMEGM */
/* Define to 1 if you have the <unistd.h> header file. */
/* #undef EXV_HAVE_UNISTD_H */
/* Define to 1 if you have the `vprintf' function. */
#define EXV_HAVE_VPRINTF 1
/* Define to 1 if you have the <wchar.h> header file. */
/* #undef EXV_HAVE_WCHAR_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* #undef EXV_HAVE_SYS_MMAN_H */
/* Define to 1 if you have the `zlib' library. */
#define EXV_HAVE_LIBZ 1
#if defined(_MSC_VER) && HAVE_LIBZ
#if (_MSC_VER < 1400)// && !defined(vsnprintf)
#define vsnprintf _vsnprintf
#endif
#endif
/* Define to 1 if you have the <process.h> header file. */
#define EXV_HAVE_PROCESS_H 1
/* Define to 1 if you have the Adobe XMP Toolkit. */
#define EXV_HAVE_XMP_TOOLKIT 1
/* Define to 1 if the system has the type `_Bool'. */
/* #undef EXV_HAVE__BOOL */
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
/* #undef EXV_LSTAT_FOLLOWS_SLASHED_SYMLINK */
/* Define to the address where bug reports for this package should be sent. */
#define EXV_PACKAGE_BUGREPORT "ahuggel@gmx.net"
/* Define to the name of this package. */
#define EXV_PACKAGE "exiv2"
/* Define to the full name of this package. */
#define EXV_PACKAGE_NAME "exiv2"
/* Define to the full name and version of this package. */
#define EXV_PACKAGE_STRING "exiv2 0.26"
/* Define to the one symbol short name of this package. */
#define EXV_PACKAGE_TARNAME "exiv2"
/* Define to the version of this package. */
#define EXV_PACKAGE_VERSION "0.26"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if strerror_r returns char *. */
/* #undef STRERROR_R_CHAR_P */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */
/* On Microsoft compilers pid_t has to be set to int. */
#ifndef HAVE_PID_T
typedef int pid_t;
#endif
/* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
#endif // _EXV_CONF_H_

@ -49,7 +49,7 @@
*/
typedef std::vector<std::regex> exv_grep_keys_t ;
#else
# if EXV_HAVE_REGEX
# ifdef EXV_HAVE_REGEX
# include <regex.h>
/*!
@brief exv_grep_keys_t is a vector of keys to match to strings

@ -216,14 +216,14 @@ SET( REMOTETEST ../samples/remotetest.cpp)
##
# modify source lists to suit environment
IF(NOT HAVE_TIMEGM )
IF(NOT EXV_HAVE_TIMEGM )
SET( LIBEXIV2_SRC ${LIBEXIV2_SRC} localtime.c )
SET( EXIV2_SRC ${EXIV2_SRC} localtime.c )
SET( EXIV2_SRC ${EXIV2_SRC} localtime.c )
SET( PATHTEST_SRC ${PATHTEST_SRC} localtime.c )
ENDIF( NOT HAVE_TIMEGM )
ENDIF()
IF( MSVC )
SET( EXIV2_SRC ${EXIV2_SRC} getopt_win32.c )
SET( EXIV2_SRC ${EXIV2_SRC} getopt_win32.c )
SET( LIBEXIV2_SRC ${LIBEXIV2_SRC} getopt_win32.c )
ENDIF( MSVC )
@ -255,6 +255,8 @@ IF ( UNIX )
ENDIF()
ENDIF()
target_include_directories(exiv2lib PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include)
if ( MSVC )
source_group("Header Files" FILES ${LIBEXIV2_HDR} )
TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${ZLIB_LIBRARIES} )

@ -595,7 +595,7 @@ namespace Action {
std::smatch m;
result = std::regex_search(key,m, *g);
#else
#if EXV_HAVE_REGEX
#ifdef EXV_HAVE_REGEX
result = regexec( &(*g), key.c_str(), 0, NULL, 0) == 0 ;
#else
std::string Pattern(g->pattern_);

@ -47,7 +47,7 @@ EXIV2_RCSID("@(#) $Id$")
#include <cassert>
#include <cctype>
#if EXV_HAVE_REGEX
#ifdef EXV_HAVE_REGEX
#include <regex.h>
#endif
@ -454,7 +454,7 @@ int Params::evalGrep( const std::string& optarg)
#if __cplusplus >= CPLUSPLUS11
greps_.push_back( std::regex(pattern, bIgnoreCase ? std::regex::icase|std::regex::extended : std::regex::extended) );
#else
#if EXV_HAVE_REGEX
#ifdef EXV_HAVE_REGEX
// 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);

@ -73,14 +73,6 @@ EXIV2_RCSID("@(#) $Id$")
#define EXV_UNICODE_PATH 0
#endif
#ifndef EXV_ENABLE_VIDEO
#define EXV_ENABLE_VIDEO 0
#endif
#ifndef EXV_ENABLE_WEBREADY
#define EXV_ENABLE_WEBREADY 0
#endif
#include "http.hpp"
#include "version.hpp"
#include "makernote_int.hpp"
@ -185,7 +177,7 @@ static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std:
std::smatch m;
bPrint = std::regex_search(Key,m,*g) || std::regex_search(value,m,*g);
#else
#if EXV_HAVE_REGEX
#ifdef EXV_HAVE_REGEX
bPrint = ( 0 == regexec( &(*g), key , 0, NULL, 0)
|| 0 == regexec( &(*g), value.c_str(), 0, NULL, 0)
);
@ -329,10 +321,6 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
int enable_video =0;
int enable_webready =0;
#ifdef EXV_HAVE_DECL_STRERROR_R
have_strerror_r=1;
#endif
#ifdef EXV_HAVE_GMTIME_R
have_gmtime_r=1;
#endif

@ -29,7 +29,15 @@ if(NOT MSVC)
endif()
IF( EXIV2_ENABLE_XMP AND EXIV2_ENABLE_LIBXMP )
check_include_file( "stdint.h" EXV_HAVE_STDINT_H )
ADD_LIBRARY( xmp STATIC ${XMPSRC} )
target_include_directories(xmp PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include)
if (EXV_HAVE_STDINT_H)
target_compile_definitions(xmp PRIVATE EXV_HAVE_STDINT_H)
endif()
GET_TARGET_PROPERTY( XMPLIB xmp LOCATION )
if ( NOT MSVC )
TARGET_LINK_LIBRARIES(xmp ${EXPAT_LIBRARIES})

Loading…
Cancel
Save