Warning, /graphics/kooka/libkookascan/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 ##########################################################################
0002 ## ##
0003 ## This CMake file is part of libkscan, a KDE scanning library. ##
0004 ## ##
0005 ## This file may be distributed and/or modified under the terms of ##
0006 ## the GNU General Public License version 2, as published by the ##
0007 ## Free Software Foundation and appearing in the file COPYING ##
0008 ## included in the packaging of this file. ##
0009 ## ##
0010 ## Author: Jonathan Marten <jjm AT keelhaul DOT me DOT uk> ##
0011 ## ##
0012 ##########################################################################
0013
0014 project(kookascan)
0015
0016 ########### dependencies ###############
0017
0018 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n Config IconThemes KIO)
0019
0020 # libpaper (at least in Gentoo Linux) provides neither a
0021 # Find<package>.cmake or a pkg-config file.
0022 find_library(LIBPAPER_LIB NAMES "libpaper" "libpaper.so")
0023 find_file(LIBPAPER_HDR "paper.h")
0024 if (LIBPAPER_LIB AND LIBPAPER_HDR)
0025 message(STATUS "libpaper library: ${LIBPAPER_LIB}")
0026 message(STATUS "libpaper header: ${LIBPAPER_HDR}")
0027 set(HAVE_LIBPAPER 1)
0028 else (LIBPAPER_LIB AND LIBPAPER_HDR)
0029 message(STATUS "libpaper library not found, using built-in list of paper sizes")
0030 endif (LIBPAPER_LIB AND LIBPAPER_HDR)
0031
0032 ############### Support for multi-page TIFF images ###############
0033
0034 include(FindTIFF)
0035 if (TIFF_FOUND)
0036 message(STATUS "TIFF includes: ${TIFF_INCLUDE_DIR}")
0037 message(STATUS "TIFF libraries: ${TIFF_LIBRARIES}")
0038 set(HAVE_TIFF true)
0039 else (TIFF_FOUND)
0040 message(STATUS "TIFF library not found, no multi-page image support")
0041 endif (TIFF_FOUND)
0042
0043 ########### subdirectories ###############
0044
0045 add_subdirectory(pics)
0046 add_subdirectory(desktop)
0047
0048 ########### setup ###############
0049
0050 if (HAVE_SANE)
0051 add_definitions(-DHAVE_SANE)
0052 add_definitions(-DSANE_VERSION=\"${SANE_VERSION}\")
0053 include_directories(${SANE_INCLUDES})
0054 endif (HAVE_SANE)
0055 if (HAVE_LIBPAPER)
0056 add_definitions(-DHAVE_LIBPAPER)
0057 get_filename_component(LIBPAPER_INCLUDES ${LIBPAPER_HDR} PATH)
0058 include_directories(${LIBPAPER_INCLUDES})
0059 endif (HAVE_LIBPAPER)
0060 if (HAVE_TIFF)
0061 add_definitions(-DHAVE_TIFF)
0062 include_directories(${TIFF_INCLUDE_DIR})
0063 endif (HAVE_TIFF)
0064
0065 ########### I18N ###############
0066
0067 add_definitions(-DTRANSLATION_DOMAIN="libkookascan")
0068
0069 ########### library ###############
0070
0071 # TODO: rename some of these to match class name, others are obsolete
0072 set(kookascan_SRCS
0073 scanglobal.cpp
0074 imageformat.cpp
0075 scanimage.cpp
0076 kscandevice.cpp
0077 scandevices.cpp
0078 kscancontrols.cpp
0079 kgammatable.cpp
0080 kscanoption.cpp
0081 kscanoptset.cpp
0082 gammadialog.cpp
0083 gammawidget.cpp
0084 scanparams.cpp
0085 scanparamspage.cpp
0086 deviceselector.cpp
0087 adddevicedialog.cpp
0088 imagecanvas.cpp
0089 previewer.cpp
0090 imgscaledialog.cpp
0091 sizeindicator.cpp
0092 scansizeselector.cpp
0093 autoselectbar.cpp
0094 autoselectdialog.cpp
0095 scanicons.cpp
0096 )
0097 kconfig_add_kcfg_files(kookascan_SRCS scansettings.kcfgc)
0098 ecm_qt_declare_logging_category(kookascan_SRCS
0099 HEADER "libkookascan_logging.h"
0100 IDENTIFIER "LIBKOOKASCAN_LOG"
0101 CATEGORY_NAME "libkookascan"
0102 EXPORT kookalogging
0103 DESCRIPTION "libkookascan (Kooka)")
0104
0105 add_library(kookascan SHARED ${kookascan_SRCS})
0106 generate_export_header(kookascan BASE_NAME kookascan)
0107 target_link_libraries(kookascan
0108 dialogutil
0109 KF5::I18n
0110 KF5::ConfigCore KF5::ConfigGui KF5::ConfigWidgets
0111 KF5::KIOCore KF5::KIOWidgets
0112 KF5::IconThemes
0113 )
0114
0115 if (HAVE_SANE)
0116 target_link_libraries(kookascan ${SANE_LIBRARIES})
0117 endif (HAVE_SANE)
0118 if (HAVE_LIBPAPER)
0119 target_link_libraries(kookascan ${LIBPAPER_LIB})
0120 endif (HAVE_LIBPAPER)
0121 if (HAVE_TIFF)
0122 target_link_libraries(kookascan ${TIFF_LIBRARIES})
0123 endif (HAVE_TIFF)
0124
0125 set_target_properties(kookascan PROPERTIES VERSION 2.0.0 SOVERSION 2)
0126
0127 ########### installation ###############
0128
0129 if (INSTALL_BINARIES)
0130 install(TARGETS kookascan ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0131 endif (INSTALL_BINARIES)
0132 install(FILES scansettings.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})