Warning, /graphics/digikam/project/bundles/3rdparty/ext_lensfun/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # Script to build Lensfun 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(EXTPREFIX_lensfun "${EXTPREFIX}" ) 0010 0011 set(Lensfun_Conf -DBUILD_STATIC=OFF 0012 -DBUILD_TESTS=OFF 0013 -DBUILD_LENSTOOL=OFF 0014 -DBUILD_DOC=OFF 0015 -DINSTALL_PYTHON_MODULE=OFF 0016 -DINSTALL_HELPER_SCRIPTS=OFF 0017 ) 0018 0019 if (MSVC) 0020 0021 set(Lensfun_Conf ${Lensfun_Conf} -DBUILD_WITH_MSVC_STATIC_RUNTIME=ON) 0022 0023 else() 0024 0025 set(Lensfun_Conf ${Lensfun_Conf} -DBUILD_WITH_MSVC_STATIC_RUNTIME=OFF) 0026 0027 endif() 0028 0029 JoinListAsString("${Lensfun_Conf}" " " BASH_OPTIONS) 0030 0031 if (MINGW) 0032 0033 ExternalProject_Add(ext_lensfun 0034 0035 DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} 0036 0037 GIT_REPOSITORY https://github.com/lensfun/lensfun.git 0038 0039 # Rolling-release code do not compile with MinGW 0040 # https://github.com/lensfun/lensfun/issues/2001 0041 GIT_TAG v0.3.3 0042 0043 PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lensfun_regex_mxe.patch 0044 0045 CONFIGURE_COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. && 0046 cd <SOURCE_DIR> && 0047 <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} lensfun && 0048 cp ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.mxe <SOURCE_DIR>/. && 0049 <SOURCE_DIR>/bootstrap.mxe ${MXE_BUILDROOT} RelWithDebInfo ${BASH_OPTIONS} 0050 0051 BUILD_COMMAND cd <SOURCE_DIR>/build.mxe && $(MAKE) 0052 0053 INSTALL_COMMAND cd <SOURCE_DIR>/build.mxe && make install/fast 0054 0055 BUILD_IN_SOURCE 1 0056 0057 UPDATE_COMMAND "" 0058 ALWAYS 0 0059 ) 0060 0061 elseif (APPLE) 0062 0063 ExternalProject_Add(ext_lensfun 0064 0065 DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} 0066 0067 GIT_REPOSITORY https://github.com/lensfun/lensfun.git 0068 # Git revision before deprecated functions removal (dec. 2023). 0069 GIT_TAG 03e4a1057b9a53b8f6c50df52137e7aac818b469 0070 0071 INSTALL_DIR ${EXTPREFIX_lensfun} 0072 0073 CONFIGURE_COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. && 0074 cd <SOURCE_DIR> && 0075 <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} lensfun && 0076 cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. && 0077 <SOURCE_DIR>/bootstrap.macports ${EXTPREFIX_lensfun} RelWithDebInfo ${CMAKE_HOST_SYSTEM_PROCESSOR} ${BASH_OPTIONS} 0078 0079 BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE) 0080 0081 INSTALL_COMMAND cd <SOURCE_DIR>/build && $(MAKE) install/fast 0082 0083 BUILD_IN_SOURCE 1 0084 0085 UPDATE_COMMAND "" 0086 ALWAYS 0 0087 ) 0088 0089 elseif(MSVC) # VCPKG 0090 0091 ExternalProject_Add(ext_lensfun 0092 0093 DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} 0094 0095 GIT_REPOSITORY https://github.com/lensfun/lensfun.git 0096 # Git revision before deprecated functions removal (dec. 2023). 0097 GIT_TAG 03e4a1057b9a53b8f6c50df52137e7aac818b469 0098 0099 INSTALL_DIR ${EXTPREFIX_lensfun} 0100 0101 PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lensfun_fixbuild_vcpkg.patch && 0102 cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. && 0103 cd <SOURCE_DIR> && 0104 bash --noprofile <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} lensfun 0105 0106 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_lensfun} 0107 -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} 0108 -DCMAKE_INSTALL_DATAROOTDIR=${EXTPREFIX_lensfun}/share 0109 ${Lensfun_Conf} 0110 ${GLOBAL_PROFILE} 0111 0112 UPDATE_COMMAND "" 0113 ALWAYS 0 0114 ) 0115 0116 else() # Linux 0117 0118 ExternalProject_Add(ext_lensfun 0119 0120 DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} 0121 0122 GIT_REPOSITORY https://github.com/lensfun/lensfun.git 0123 # Git revision before deprecated functions removal (dec. 2023). 0124 GIT_TAG 03e4a1057b9a53b8f6c50df52137e7aac818b469 0125 0126 INSTALL_DIR ${EXTPREFIX_lensfun} 0127 0128 PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lensfun_fixbuild_vcpkg.patch && 0129 cp -f ${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/create_manifest.sh <SOURCE_DIR>/. && 0130 cd <SOURCE_DIR> && 0131 <SOURCE_DIR>/create_manifest.sh ${EXTERNALS_DOWNLOAD_DIR} lensfun 0132 0133 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_lensfun} 0134 -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} 0135 ${Lensfun_Conf} 0136 ${GLOBAL_PROFILE} 0137 0138 UPDATE_COMMAND "" 0139 ALWAYS 0 0140 ) 0141 0142 endif()