Project

General

Profile

Bug #1270 » cpp11-cmake.diff

cmake changes - Ben Touchette, 17 Feb 2017 18:02

View differences:

exiv2-0.26-svn-1/CMakeLists.txt 2017-01-13 12:44:58.000000000 -0500
38 38
SET( GENERIC_LIB_SOVERSION  "14" )
39 39

  
40 40
# options and their default values
41
OPTION( EXIV2_CPP_STANDARD           "Set the C++ Standard to compile with"                 11  )
42
OPTION( EXIV2_CPP_STANDARD_REQUIRED  "Set C++ Standard to required"                         ON  )
43
OPTION( EXIV2_CPP_EXTENSION          "Set C++ Extensions to required"                       OFF )
44
OPTION( EXIV2_ENABLE_VERBOSITY       "Enable verbosity"                                     OFF )
41 45
OPTION( EXIV2_ENABLE_SHARED        "Build exiv2 as a shared library (dll)"                 ON  )
42 46
OPTION( EXIV2_ENABLE_XMP           "Build with XMP metadata support"                       ON  )
43 47
OPTION( EXIV2_ENABLE_LIBXMP        "Build a static convenience Library for XMP"            ON  )
......
60 64

  
61 65
ENDIF()
62 66

  
67
SET ( CMAKE_VERBOSE_MAKEFILE ${EXIV2_ENABLE_VERBOSITY} )
68
IF ( NOT ${EXIV2_CPP_STANDARD} )
69
    SET ( EXIV2_CPP_STANDARD 11 )
70
ENDIF ()
71

  
63 72
# set include path for FindXXX.cmake files
64 73
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/config/")
65 74

  
......
86 95

  
87 96
    message(STATUS Compiler: ${COMPILER} " Major:" ${GCC_MAJOR} " Minor:" ${GCC_MINOR})
88 97

  
89
    IF ( CYGWIN OR ( ${GCC_MAJOR} GREATER 5 ))
90
        ADD_DEFINITIONS( -std=gnu++98 ) # to support snprintf
91
    ELSE()
92
        ADD_DEFINITIONS( -std=c++98 )
93
    ENDIF()
94

  
95 98
ENDIF( MINGW OR UNIX )
96 99

  
100
set( CMAKE_CXX_STANDARD ${EXIV2_CPP_STANDARD} )
101
set( CMAKE_CXX_STANDARD_REQUIRED ${EXIV2_CPP_STANDARD_REQUIRED} )
102
set( CMAKE_CXX_EXTENSIONS ${EXIV2_CPP_EXTENSION} )
103

  
104
IF ( ${EXIV2_CPP_STANDARD} LESS 98 AND ${EXIV2_CPP_STANDARD} GREATER 10  )
105
    ADD_DEFINITIONS( -DEXV_USING_CPP_ELEVEN=1  )
106
ENDIF()
107

  
97 108
IF( EXIV2_ENABLE_COMMERCIAL )
98 109
    SET (EXIV2_ENABLE_LENSDATA OFF)
99 110
    SET (EXIV2_ENABLE_NLS OFF)
exiv2-0.26-svn-1/config/CMakeChecks.txt 2017-01-13 12:42:37.000000000 -0500
319 319

  
320 320
MESSAGE( STATUS "------------------------------------------------------------------" )
321 321
MESSAGE( STATUS "${PACKAGE_STRING} configure results        <${PACKAGE_URL}>"        )
322
MESSAGE( STATUS "C++ standard                        ${EXIV2_CPP_STANDARD}"          )
323
OptionOutput( "C++ standard required               " EXIV2_CPP_STANDARD_REQUIRED     )
324
OptionOutput( "C++ extensions required             " EXIV2_CPP_EXTENSION             )
325
OptionOutput( "Enabled compilation verbosity       " EXIV2_ENABLE_VERBOSITY          )
322 326
OptionOutput( "Building PNG support:               " EXIV2_ENABLE_PNG AND ZLIB_FOUND )
323 327
OptionOutput( "Building shared library:            " EXIV2_ENABLE_SHARED             )
324 328
OptionOutput( "XMP metadata support:               " EXIV2_ENABLE_XMP                )
(4-4/6)