"Fossies" - the Fresh Open Source Software Archive

Member "exiv2-0.27.6-Source/CMakeLists.txt" (18 Jan 2023, 6244 Bytes) of package /linux/misc/exiv2-0.27.6-Source.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 0.27.5_vs_0.27.6.

    1 # Minimum version imposed by Debian:9
    2 cmake_minimum_required( VERSION 3.7.2 )
    3 
    4 project(exiv2
    5     VERSION 0.27.6
    6     LANGUAGES CXX
    7 )
    8 
    9 if(NOT CMAKE_BUILD_TYPE)
   10     set (CMAKE_BUILD_TYPE Release)
   11 endif()
   12 
   13 include(cmake/mainSetup.cmake  REQUIRED)
   14 
   15 # options and their default values
   16 option( BUILD_SHARED_LIBS             "Build exiv2lib as a shared library"                    ON  )
   17 option( EXIV2_ENABLE_XMP              "Build with XMP metadata support"                       ON  )
   18 option( EXIV2_ENABLE_EXTERNAL_XMP     "Use external version of XMP"                           OFF )
   19 option( EXIV2_ENABLE_PNG              "Build with png support (requires libz)"                ON  )
   20 option( EXIV2_ENABLE_NLS              "Build native language support (requires gettext)"      OFF )
   21 option( EXIV2_ENABLE_PRINTUCS2        "Build with Printucs2"                                  ON  )
   22 option( EXIV2_ENABLE_LENSDATA         "Build including lens data"                             ON  )
   23 option( EXIV2_ENABLE_VIDEO            "Build video support into library"                      OFF )
   24 option( EXIV2_ENABLE_DYNAMIC_RUNTIME  "Use dynamic runtime (used for static libs)"            ON  )
   25 option( EXIV2_ENABLE_WIN_UNICODE      "Use Unicode paths (wstring) on Windows"                OFF )
   26 option( EXIV2_ENABLE_WEBREADY         "Build webready support into library"                   OFF )
   27 option( EXIV2_ENABLE_CURL             "USE Libcurl for HttpIo (WEBREADY)"                     OFF )
   28 option( EXIV2_ENABLE_SSH              "USE Libssh for SshIo (WEBREADY)"                       OFF )
   29 option( EXIV2_ENABLE_BMFF             "Build with BMFF support"                               OFF )
   30 
   31 option( EXIV2_BUILD_SAMPLES           "Build sample applications"                             ON  )
   32 option( EXIV2_BUILD_EXIV2_COMMAND     "Build exiv2 command-line executable"                   ON  )
   33 option( EXIV2_BUILD_UNIT_TESTS        "Build unit tests"                                      OFF )
   34 option( EXIV2_BUILD_FUZZ_TESTS        "Build fuzz tests (libFuzzer)"                          OFF )
   35 option( EXIV2_BUILD_DOC               "Add 'doc' target to generate documentation"            OFF )
   36 
   37 # Only intended to be used by Exiv2 developers/contributors
   38 option( EXIV2_TEAM_EXTRA_WARNINGS     "Add more sanity checks using compiler flags"           OFF )
   39 option( EXIV2_TEAM_WARNINGS_AS_ERRORS "Treat warnings as errors"                              OFF )
   40 option( EXIV2_TEAM_USE_SANITIZERS     "Enable ASAN and UBSAN when available"                  OFF )
   41 option( EXIV2_TEAM_PACKAGING          "Additional stuff for generating packages"              OFF )
   42 set(EXTRA_COMPILE_FLAGS " ")
   43 
   44 mark_as_advanced(
   45     EXIV2_TEAM_EXTRA_WARNINGS
   46     EXIV2_TEAM_WARNINGS_AS_ERRORS
   47     EXIV2_ENABLE_EXTERNAL_XMP
   48     EXTRA_COMPILE_FLAGS
   49     EXIV2_TEAM_USE_SANITIZERS
   50 )
   51 
   52 option( BUILD_WITH_CCACHE             "Use ccache to speed up compilations"                   OFF )
   53 option( BUILD_WITH_COVERAGE           "Add compiler flags to generate coverage stats"         OFF )
   54 
   55 set( PACKAGE_BUGREPORT                "http://github.com/exiv2/exiv2" )
   56 set( PACKAGE_URL                      "https://exiv2.org")
   57 set( PROJECT_DESCRIPTION              "Exif/IPTC/Xmp C++ metadata library and tools plus ICC Profiles, Previews and more.")
   58 
   59 if ( EXIV2_ENABLE_EXTERNAL_XMP )
   60     set(EXIV2_ENABLE_XMP OFF)
   61 endif()
   62 
   63 if( EXIV2_BUILD_UNIT_TESTS )
   64     set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Requires CMake 3.3.3
   65 endif()
   66 
   67 include(cmake/findDependencies.cmake   REQUIRED)
   68 include(cmake/compilerFlags.cmake      REQUIRED)
   69 include(cmake/generateConfigFile.cmake REQUIRED)
   70 
   71 if (EXIV2_BUILD_DOC)
   72     include(cmake/generateDoc.cmake        REQUIRED)
   73     generate_documentation("${PROJECT_SOURCE_DIR}/cmake/Doxyfile.in")
   74 endif()
   75 
   76 
   77 include_directories(${CMAKE_BINARY_DIR})  # Make the exv_conf.h file visible for the full project
   78 
   79 if( EXIV2_ENABLE_XMP )
   80     add_subdirectory( xmpsdk )
   81 endif()
   82 
   83 include(cmake/compilerFlagsExiv2.cmake REQUIRED)
   84 
   85 add_subdirectory( include )
   86 add_subdirectory( src )
   87 
   88 if( EXIV2_BUILD_UNIT_TESTS )
   89     add_subdirectory ( unitTests )
   90 endif()
   91 
   92 if( EXIV2_BUILD_FUZZ_TESTS )
   93     if ((NOT COMPILER_IS_CLANG) OR (NOT EXIV2_TEAM_USE_SANITIZERS))
   94         message(FATAL_ERROR "You need to build with Clang and sanitizers for the fuzzers to work. "
   95                 "Use Clang and -DEXIV2_TEAM_USE_SANITIZERS=ON")
   96     endif()
   97     add_subdirectory ( fuzz )
   98 endif()
   99 
  100 if( EXIV2_BUILD_SAMPLES )
  101     add_subdirectory( samples )
  102     get_directory_property(SAMPLES DIRECTORY samples DEFINITION APPLICATIONS)
  103     if (Python3_Interpreter_FOUND)
  104         add_test(NAME bashTests
  105             WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests
  106             COMMAND cmake -E env EXIV2_BINDIR=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${Python3_EXECUTABLE} runner.py --verbose bash_tests
  107         )
  108         add_test(NAME bugfixTests
  109             WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests
  110             COMMAND cmake -E env EXIV2_BINDIR=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${Python3_EXECUTABLE} runner.py --verbose bugfixes
  111         )
  112         add_test(NAME tiffTests
  113             WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests
  114             COMMAND cmake -E env EXIV2_BINDIR=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${Python3_EXECUTABLE} runner.py --verbose tiff_test
  115         )
  116         add_test(NAME versionTests
  117             WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests
  118             COMMAND cmake -E env EXIV2_BINDIR=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${Python3_EXECUTABLE} runner.py --verbose bash_tests/version_test.py 
  119         )
  120     endif()
  121 endif()
  122 
  123 if( EXIV2_ENABLE_NLS )
  124     add_subdirectory( po )
  125 endif()
  126 
  127 if (EXIV2_TEAM_PACKAGING)
  128     include(cmake/packaging.cmake)
  129 endif()
  130 
  131 join_paths(libdir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
  132 join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
  133 configure_file(cmake/exiv2.pc.in exiv2.pc @ONLY)
  134 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/exiv2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
  135 
  136 # ******************************************************************************
  137 # Man page
  138 install( FILES ${PROJECT_SOURCE_DIR}/man/man1/exiv2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
  139 
  140 
  141 include(cmake/printSummary.cmake)
  142 
  143 # That's all Folks!
  144 ##