#1269 Thank You to Ben for reporting this and providing the patch.

v0.27.3
Robin Mills 8 years ago
parent e4388d4f80
commit be0945016b

@ -51,13 +51,14 @@ OPTION( EXIV2_ENABLE_BUILD_PO "Build translations files"
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 )
IF (WIN32) IF (WIN32)
OPTION( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF )
OPTION( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) OPTION( EXIV2_ENABLE_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() ELSE()
OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON ) OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON )
OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON )
SET ( EXIV2_ENABLE_DYNAMIC_RUNTIME OFF )
ENDIF() ENDIF()
# set include path for FindXXX.cmake files # set include path for FindXXX.cmake files
@ -110,6 +111,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/include/ ${CM
if( MSVC ) if( MSVC )
# cmake_policy(SET CMP0008) # cmake_policy(SET CMP0008)
ADD_DEFINITIONS(-DPSAPI_VERSION=1) # to be compatible with <= WinVista (#905) ADD_DEFINITIONS(-DPSAPI_VERSION=1) # to be compatible with <= WinVista (#905)
set(CMAKE_DEBUG_POSTFIX "d")
endif( MSVC ) endif( MSVC )
IF( EXIV2_ENABLE_XMP ) IF( EXIV2_ENABLE_XMP )

@ -4,10 +4,10 @@
## ##
# msvc tuning macros # msvc tuning macros
macro(msvc_runtime_set_static_ignores bDynamic) macro(msvc_runtime_set_static_ignores bDynamic bDynamicRuntime)
if(MSVC) if(MSVC)
# don't link msvcrt for .exe which use shared libraries (use default libcmt) # don't link msvcrt for .exe which use shared libraries (use default libcmt)
if ( ${bDynamic} STREQUAL "OFF" ) if ( ${bDynamic} STREQUAL "OFF" AND ${bDynamicRuntime} STREQUAL "OFF")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRTD") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRTD")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:MSVCRT") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:MSVCRT")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/NODEFAULTLIB:MSVCRT") set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/NODEFAULTLIB:MSVCRT")
@ -17,7 +17,7 @@ macro(msvc_runtime_set_static_ignores bDynamic)
endmacro() endmacro()
# http://stackoverflow.com/questions/10113017/setting-the-msvc-runtime-in-cmake # http://stackoverflow.com/questions/10113017/setting-the-msvc-runtime-in-cmake
macro(msvc_runtime_configure bDynamic) macro(msvc_runtime_configure bDynamic bDynamicRuntime)
if(MSVC) if(MSVC)
set(variables set(variables
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG
@ -29,7 +29,7 @@ macro(msvc_runtime_configure bDynamic)
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO
) )
if( ${bDynamic} STREQUAL "ON" ) if( ${bDynamic} STREQUAL "ON" OR ${bDynamicRuntime} STREQUAL "ON")
message(STATUS "MSVC -> forcing use of dynamically-linked runtime." ) message(STATUS "MSVC -> forcing use of dynamically-linked runtime." )
foreach(variable ${variables}) foreach(variable ${variables})
if(${variable} MATCHES "/MT") if(${variable} MATCHES "/MT")
@ -55,7 +55,7 @@ macro(msvc_runtime_configure bDynamic)
endif() endif()
endforeach() endforeach()
endforeach() endforeach()
msvc_runtime_set_static_ignores(${bDynamic}) msvc_runtime_set_static_ignores(${bDynamic} ${bDynamicRuntime})
endif() endif()
endmacro() endmacro()

@ -111,6 +111,7 @@ ENDIF( EXIV2_ENABLE_NLS )
IF( EXIV2_ENABLE_WIN_UNICODE ) IF( EXIV2_ENABLE_WIN_UNICODE )
IF (WIN32) IF (WIN32)
SET ( UNICODE_PATH 1 ) SET ( UNICODE_PATH 1 )
SET ( EXV_UNICODE_PATH 1 )
ENDIF() ENDIF()
ENDIF() ENDIF()
@ -337,6 +338,7 @@ OptionOutput( "USE Libcurl for HttpIo: " EXIV2_ENABLE_CURL
OptionOutput( "USE Libssh for SshIo: " EXIV2_ENABLE_SSH ) OptionOutput( "USE Libssh for SshIo: " EXIV2_ENABLE_SSH )
endif ( EXIV2_ENABLE_WEBREADY ) endif ( EXIV2_ENABLE_WEBREADY )
IF (WIN32) IF (WIN32)
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()
MESSAGE( STATUS "------------------------------------------------------------------" ) MESSAGE( STATUS "------------------------------------------------------------------" )

@ -42,7 +42,7 @@ SET( SAMPLES addmoddel.cpp
## ##
# msvn tuning # msvn tuning
include(../CMake_msvc.txt) include(../CMake_msvc.txt)
msvc_runtime_configure(${EXIV2_ENABLE_SHARED}) msvc_runtime_configure(${EXIV2_ENABLE_SHARED} ${EXIV2_ENABLE_DYNAMIC_RUNTIME})
FOREACH(entry ${SAMPLES}) FOREACH(entry ${SAMPLES})
STRING( REPLACE ".cpp" "" target ${entry}) STRING( REPLACE ".cpp" "" target ${entry})

@ -231,7 +231,7 @@ ENDIF( MSVC )
# msvn tuning # msvn tuning
IF( MSVC ) IF( MSVC )
include(../CMake_msvc.txt) include(../CMake_msvc.txt)
msvc_runtime_configure(${EXIV2_ENABLE_SHARED}) msvc_runtime_configure(${EXIV2_ENABLE_SHARED} ${EXIV2_ENABLE_DYNAMIC_RUNTIME})
ENDIF( MSVC ) ENDIF( MSVC )
# ****************************************************************************** # ******************************************************************************
@ -311,7 +311,7 @@ ENDIF(CYGWIN OR MINGW)
INSTALL( TARGETS exiv2lib ${INSTALL_TARGET_STANDARD_ARGS} ) INSTALL( TARGETS exiv2lib ${INSTALL_TARGET_STANDARD_ARGS} )
include(../CMake_msvc.txt) include(../CMake_msvc.txt)
msvc_runtime_configure(${EXIV2_ENABLE_SHARED}) msvc_runtime_configure(${EXIV2_ENABLE_SHARED} ${EXIV2_ENABLE_DYNAMIC_RUNTIME})
# ****************************************************************************** # ******************************************************************************
# exiv2 application # exiv2 application

@ -7,7 +7,7 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(../CMake_msvc.txt) include(../CMake_msvc.txt)
msvc_runtime_configure(${EXIV2_ENABLE_SHARED}) msvc_runtime_configure(${EXIV2_ENABLE_SHARED} ${EXIV2_ENABLE_DYNAMIC_RUNTIME})
if( POLICY CMP0026 ) if( POLICY CMP0026 )
cmake_policy(SET CMP0026 OLD) # Something to do with location cmake_policy(SET CMP0026 OLD) # Something to do with location

Loading…
Cancel
Save