Warning, /graphics/digikam/project/bundles/3rdparty/ext_exiv2/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # Script to build Exiv2 for digiKam bundle.
0002 #
0003 # SPDX-FileCopyrightText: 2015-2024 by Gilles Caulier  <caulier dot gilles at gmail dot com>
0004 #
0005 # SPDX-License-Identifier: BSD-3-Clause
0006 #
0007 
0008 set(PREFIX_ext_exiv2 "${EXTPREFIX}")
0009 
0010 set(Exiv2_Conf -DBUILD_SHARED_LIBS=ON
0011                -DEXIV2_ENABLE_XMP=ON
0012                -DEXIV2_ENABLE_EXTERNAL_XMP=OFF
0013                -DEXIV2_ENABLE_PNG=ON
0014                -DEXIV2_ENABLE_NLS=ON
0015                -DEXIV2_ENABLE_BMFF=ON
0016                -DEXIV2_ENABLE_BROTLI=ON
0017                -DEXIV2_ENABLE_PRINTUCS2=ON
0018                -DEXIV2_ENABLE_LENSDATA=ON
0019                -DEXIV2_ENABLE_VIDEO=OFF
0020                -DEXIV2_ENABLE_WEBREADY=OFF
0021                -DEXIV2_ENABLE_DYNAMIC_RUNTIME=OFF
0022                -DEXIV2_ENABLE_CURL=OFF
0023                -DEXIV2_ENABLE_SSH=OFF
0024                -DEXIV2_ENABLE_INIH=OFF
0025                -DEXIV2_BUILD_SAMPLES=OFF
0026                -DEXIV2_BUILD_PO=OFF
0027                -DEXIV2_BUILD_EXIV2_COMMAND=OFF
0028                -DEXIV2_BUILD_UNIT_TESTS=OFF
0029                -DEXIV2_BUILD_FUZZ_TESTS=OFF
0030                -DEXIV2_BUILD_DOC=OFF
0031                -DEXIV2_TEAM_EXTRA_WARNINGS=OFF
0032                -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF
0033                -DEXIV2_TEAM_USE_SANITIZERS=OFF
0034                -D EXIV2_TEAM_OSS_FUZZ=OFF
0035                -DEXIV2_TEAM_PACKAGING=OFF
0036 )
0037 
0038 if(MINGW)
0039 
0040     set(Exiv2_Conf ${Exiv2_Conf}
0041                -DEXIV2_ENABLE_WIN_UNICODE=ON
0042     )
0043 
0044 endif()
0045 
0046 JoinListAsString("${Exiv2_Conf}" " " BASH_OPTIONS)
0047 
0048 if(MINGW)
0049 
0050     ExternalProject_Add(ext_exiv2
0051         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0052 
0053         GIT_REPOSITORY https://github.com/Exiv2/exiv2.git
0054 
0055         # To use official release tag
0056 #        GIT_TAG v0.28.0
0057         # See the bug https://github.com/Exiv2/exiv2/issues/2637
0058         GIT_TAG 0.27-maintenance
0059 
0060 #        PATCH_COMMAND git reset --hard &&
0061 #                      ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/exiv2-mxe-mmap.patch
0062 
0063         CONFIGURE_COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. &&
0064                           cd <SOURCE_DIR> &&
0065                           <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} exiv2 &&
0066                           cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.mxe <SOURCE_DIR>/. &&
0067                           <SOURCE_DIR>/bootstrap.mxe ${MXE_BUILDROOT} RelWithDebInfo ${BASH_OPTIONS}
0068 
0069         BUILD_COMMAND cd <SOURCE_DIR>/build.mxe && $(MAKE) -j
0070 
0071         INSTALL_COMMAND cd <SOURCE_DIR>/build.mxe && $(MAKE) install/fast
0072 
0073         BUILD_IN_SOURCE 1
0074 
0075         UPDATE_COMMAND ""
0076         ALWAYS 0
0077     )
0078 
0079 elseif(APPLE)
0080 
0081     ExternalProject_Add(ext_exiv2
0082         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0083 
0084         GIT_REPOSITORY https://github.com/Exiv2/exiv2.git
0085         GIT_TAG v0.28.1
0086 
0087         CONFIGURE_COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. &&
0088                           cd <SOURCE_DIR> &&
0089                           <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} exiv2 &&
0090                           cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. &&
0091                           <SOURCE_DIR>/bootstrap.macports ${PREFIX_ext_exiv2} RelWithDebInfo ${CMAKE_HOST_SYSTEM_PROCESSOR} ${BASH_OPTIONS}
0092 
0093         BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE)
0094 
0095         INSTALL_COMMAND cd <SOURCE_DIR>/build && $(MAKE) install/fast
0096 
0097         BUILD_IN_SOURCE 1
0098 
0099         UPDATE_COMMAND ""
0100         ALWAYS 0
0101     )
0102 
0103 elseif(MSVC)
0104 
0105     ExternalProject_Add(ext_exiv2
0106         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0107 
0108         GIT_REPOSITORY https://github.com/Exiv2/exiv2.git
0109         GIT_TAG v0.28.1
0110 
0111         PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/exiv2-brotli-vcpkg.patch &&
0112                       cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. &&
0113                       cd <SOURCE_DIR> &&
0114                       bash --noprofile <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} exiv2
0115 
0116         CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_exiv2}
0117                    -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0118                    ${Exiv2_Conf}
0119                    ${GLOBAL_PROFILE}
0120 
0121         UPDATE_COMMAND ""
0122         ALWAYS 0
0123     )
0124 
0125 else() # Linux
0126 
0127     ExternalProject_Add(ext_exiv2
0128         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0129 
0130         GIT_REPOSITORY https://github.com/Exiv2/exiv2.git
0131         GIT_TAG v0.28.1
0132 
0133         CONFIGURE_COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. &&
0134                           cd <SOURCE_DIR> &&
0135                           <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} exiv2 &&
0136                           $(CMAKE_COMMAND) . -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_exiv2}
0137                                              -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0138                                              -DICONV_INCLUDE_DIR=${PREFIX_ext_exiv2}/include
0139                                              ${Exiv2_Conf}
0140                                              ${GLOBAL_PROFILE}
0141 
0142         BUILD_COMMAND cd <SOURCE_DIR> && $(MAKE)
0143 
0144         INSTALL_COMMAND cd <SOURCE_DIR> && $(MAKE) install/fast
0145 
0146         UPDATE_COMMAND ""
0147         ALWAYS 0
0148     )
0149 
0150 endif()