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

0001 # Script to build AVIF library 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 
0009 set(PREFIX_libavif "${EXTPREFIX}")
0010 
0011 set(AVIF_Conf -DBUILD_SHARED_LIBS=ON
0012               -DAVIF_ENABLE_WERROR=OFF
0013               -DAVIF_CODEC_AOM=ON
0014               -DAVIF_CODEC_AOM_DECODE=ON
0015               -DAVIF_CODEC_AOM_ENCODE=ON
0016               -DAVIF_LOCAL_AOM=OFF
0017               -DAVIF_LOCAL_ZLIBPNG=OFF
0018               -DAVIF_LOCAL_JPEG=OFF
0019               -DAVIF_LOCAL_LIBYUV=OFF
0020               -DAVIF_LOCAL_ZLIBPNG=OFF
0021               -DAVIF_CODEC_DAV1D=OFF
0022               -DAVIF_LOCAL_DAV1D=OFF
0023               -DAVIF_CODEC_LIBGAV1=OFF
0024               -DAVIF_LOCAL_LIBGAV1=OFF
0025               -DAVIF_CODEC_RAV1E=OFF
0026               -DAVIF_LOCAL_RAV1E=OFF
0027               -DAVIF_CODEC_SVT=OFF
0028               -DAVIF_LOCAL_SVT=OFF
0029               -DAVIF_ENABLE_COVERAGE=OFF
0030               -DAVIF_BUILD_APPS=OFF
0031               -DAVIF_BUILD_EXAMPLES=OFF
0032               -DAVIF_BUILD_TESTS=OFF
0033 )
0034 
0035 JoinListAsString("${AVIF_Conf}" " " BASH_OPTIONS_AVIF)
0036 
0037 if(MINGW)
0038 
0039     ExternalProject_Add(ext_libavif
0040 
0041         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0042 
0043         GIT_REPOSITORY https://github.com/AOMediaCodec/libavif.git
0044         GIT_TAG v1.0.1
0045 
0046         CONFIGURE_COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.mxe <SOURCE_DIR>/. &&
0047                           <SOURCE_DIR>/bootstrap.mxe ${MXE_BUILDROOT} RelWithDebInfo ${BASH_OPTIONS_AVIF}
0048 
0049         BUILD_COMMAND cd <SOURCE_DIR>/build.mxe && $(MAKE) -j
0050 
0051         INSTALL_COMMAND cd <SOURCE_DIR>/build.mxe && $(MAKE) install/fast
0052 
0053         BUILD_IN_SOURCE 1
0054 
0055         UPDATE_COMMAND ""
0056         ALWAYS 0
0057     )
0058 
0059 elseif(APPLE)
0060 
0061     ExternalProject_Add(ext_libavif
0062 
0063         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0064 
0065         GIT_REPOSITORY https://github.com/AOMediaCodec/libavif.git
0066         GIT_TAG v1.0.1
0067 
0068         CONFIGURE_COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. &&
0069                           <SOURCE_DIR>/bootstrap.macports ${PREFIX_libavif} RelWithDebInfo x86_64 ${BASH_OPTIONS_AVIF}
0070 
0071         BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE)
0072 
0073         INSTALL_COMMAND cd <SOURCE_DIR>/build && $(MAKE) install/fast
0074 
0075         BUILD_IN_SOURCE 1
0076 
0077         UPDATE_COMMAND ""
0078         ALWAYS 0
0079     )
0080 
0081 else() # Linux
0082 
0083     ExternalProject_Add(ext_libavif
0084 
0085         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0086 
0087         GIT_REPOSITORY https://github.com/AOMediaCodec/libavif.git
0088         GIT_TAG v1.0.1
0089 
0090         CONFIGURE_COMMAND $(CMAKE_COMMAND) . -DCMAKE_INSTALL_PREFIX=${PREFIX_libavif}
0091                                              -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0092                                              ${AVIF_Conf}
0093                                              ${GLOBAL_PROFILE}
0094 
0095         BUILD_COMMAND cd <SOURCE_DIR> && $(MAKE)
0096 
0097         INSTALL_COMMAND cd <SOURCE_DIR> && $(MAKE) install/fast
0098 
0099         BUILD_IN_SOURCE 1
0100 
0101         UPDATE_COMMAND ""
0102         ALWAYS 0
0103     )
0104 
0105 endif()