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

0001 # Script to build libksane for digiKam bundle.
0002 #
0003 # Copyright (c) 2015-2024 by Gilles Caulier  <caulier dot gilles at gmail dot com>
0004 #
0005 # Redistribution and use is allowed according to the terms of the BSD license.
0006 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0007 #
0008 
0009 set(EXTPREFIX_libksane "${EXTPREFIX}" )
0010 
0011 if(MINGW)
0012 
0013     GetKF5ApplicationMd5Sums(ksanecore ${KA_VERSION})
0014 
0015     ExternalProject_Add(ext_ksanecore
0016                         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0017                         URL https://download.kde.org/stable/release-service/${KA_VERSION}/src/ksanecore-${KA_VERSION}.tar.xz
0018                         URL_MD5 ${KF5_APPLICATION_MD5SUM}
0019 
0020                         INSTALL_DIR ${EXTPREFIX_libksane}
0021 
0022                         CMAKE_ARGS -DMXE_TOOLCHAIN=${MXE_TOOLCHAIN}
0023                                    -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0024                                    -DCMAKE_COLOR_MAKEFILE=ON
0025                                    -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_libksane}
0026                                    -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
0027                                    -DCMAKE_TOOLCHAIN_FILE=${MXE_TOOLCHAIN}
0028                                    -DCMAKE_FIND_PREFIX_PATH=${CMAKE_PREFIX_PATH}
0029                                    -DCMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include
0030                                    -DCMAKE_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include
0031                                    -DCMAKE_LIBRARY_PATH=${CMAKE_PREFIX_PATH}/lib
0032                                    -DZLIB_ROOT=${CMAKE_PREFIX_PATH}
0033                                    ${GLOBAL_PROFILE}
0034                                    -DBUILD_TESTING=OFF
0035                                    -Wno-dev
0036 
0037                         UPDATE_COMMAND ""
0038                         ALWAYS 0
0039     )
0040 
0041     GetKF5ApplicationMd5Sums(libksane ${KA_VERSION})
0042 
0043     ExternalProject_Add(ext_libksane
0044                         DEPENDS ext_ksanecore
0045 
0046                         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0047                         URL https://download.kde.org/stable/release-service/${KA_VERSION}/src/libksane-${KA_VERSION}.tar.xz
0048                         URL_MD5 ${KF5_APPLICATION_MD5SUM}
0049 
0050                         INSTALL_DIR ${EXTPREFIX_libksane}
0051                         PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/libksane-common-rules.patch
0052 
0053                         CMAKE_ARGS -DMXE_TOOLCHAIN=${MXE_TOOLCHAIN}
0054                                    -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0055                                    -DCMAKE_COLOR_MAKEFILE=ON
0056                                    -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_libksane}
0057                                    -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
0058                                    -DCMAKE_TOOLCHAIN_FILE=${MXE_TOOLCHAIN}
0059                                    -DCMAKE_FIND_PREFIX_PATH=${CMAKE_PREFIX_PATH}
0060                                    -DCMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include
0061                                    -DCMAKE_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include
0062                                    -DCMAKE_LIBRARY_PATH=${CMAKE_PREFIX_PATH}/lib
0063                                    -DZLIB_ROOT=${CMAKE_PREFIX_PATH}
0064                                    ${GLOBAL_PROFILE}
0065                                    "${argoptions}"
0066                                    -DWITH_DESIGNER_PLUGIN=OFF
0067                                    -DBUILD_TESTING=OFF
0068                                    -Wno-dev
0069 
0070                         UPDATE_COMMAND ""
0071                         ALWAYS 0
0072     )
0073 
0074 elseif(APPLE)
0075 
0076     GetKF5ApplicationMd5Sums(ksanecore ${KA_VERSION})
0077 
0078     ExternalProject_Add(ext_ksanecore
0079                         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0080                         URL https://download.kde.org/stable/release-service/${KA_VERSION}/src/ksanecore-${KA_VERSION}.tar.xz
0081                         URL_MD5 ${KF5_APPLICATION_MD5SUM}
0082 
0083                         CONFIGURE_COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. &&
0084                                           <SOURCE_DIR>/bootstrap.macports ${EXTPREFIX_libksane} debug x86_64 "-DBUILD_TESTING=OFF -Wno-dev"
0085 
0086                         BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE)
0087 
0088                         INSTALL_COMMAND cd <SOURCE_DIR>/build && make install/fast
0089 
0090                         BUILD_IN_SOURCE 1
0091 
0092                         UPDATE_COMMAND ""
0093                         ALWAYS 0
0094     )
0095 
0096     GetKF5ApplicationMd5Sums(libksane ${KA_VERSION})
0097 
0098     ExternalProject_Add(ext_libksane
0099                         DEPENDS ext_ksanecore
0100 
0101                         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0102                         URL https://download.kde.org/stable/release-service/${KA_VERSION}/src/libksane-${KA_VERSION}.tar.xz
0103                         URL_MD5 ${KF5_APPLICATION_MD5SUM}
0104 
0105                         PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/libksane-common-rules.patch
0106 
0107                         CONFIGURE_COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. &&
0108                                           <SOURCE_DIR>/bootstrap.macports ${EXTPREFIX_libksane} debug x86_64 "-DWITH_DESIGNER_PLUGIN=OFF -DBUILD_TESTING=OFF -Wno-dev"
0109 
0110                         BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE)
0111 
0112                         INSTALL_COMMAND cd <SOURCE_DIR>/build && make install/fast
0113 
0114                         BUILD_IN_SOURCE 1
0115 
0116                         UPDATE_COMMAND ""
0117                         ALWAYS 0
0118     )
0119 
0120 else() # Linux
0121 
0122     GetKF5ApplicationMd5Sums(ksanecore ${KA_VERSION})
0123 
0124     ExternalProject_Add(ext_ksanecore
0125                         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0126                         URL https://download.kde.org/stable/release-service/${KA_VERSION}/src/ksanecore-${KA_VERSION}.tar.xz
0127                         URL_MD5 ${KF5_APPLICATION_MD5SUM}
0128 
0129                         INSTALL_DIR ${EXTPREFIX_libksane}
0130 
0131                         CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_libksane}
0132                                    -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0133                                    ${GLOBAL_PROFILE}
0134                                    -DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX}
0135                                    -DBUILD_TESTING=OFF
0136                                    -Wno-dev
0137 
0138                         UPDATE_COMMAND ""
0139                         ALWAYS 0
0140     )
0141 
0142     GetKF5ApplicationMd5Sums(libksane ${KA_VERSION})
0143 
0144     ExternalProject_Add(ext_libksane
0145                         DEPENDS ext_ksanecore
0146 
0147                         DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
0148                         URL https://download.kde.org/stable/release-service/${KA_VERSION}/src/libksane-${KA_VERSION}.tar.xz
0149                         URL_MD5 ${KF5_APPLICATION_MD5SUM}
0150 
0151                         INSTALL_DIR ${EXTPREFIX_libksane}
0152 
0153                         CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_libksane}
0154                                    -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE}
0155                                    ${GLOBAL_PROFILE}
0156                                    -DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX}
0157                                    -DWITH_DESIGNER_PLUGIN=OFF
0158                                    -DBUILD_TESTING=OFF
0159                                    -Wno-dev
0160 
0161                         PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/libksane-common-rules.patch
0162 
0163                         UPDATE_COMMAND ""
0164                         ALWAYS 0
0165     )
0166 
0167 endif()