diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d89b0c..27ba8eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,131 +1,135 @@ ########################################################################## ## ## ## This CMake file is part of Kooka, a KDE scanning/OCR application. ## ## ## ## This file may be distributed and/or modified under the terms of ## ## the GNU General Public License version 2, as published by the ## ## Free Software Foundation and appearing in the file COPYING ## ## included in the packaging of this file. ## ## ## ## Author: Jonathan Marten ## ## ## ########################################################################## cmake_minimum_required(VERSION 2.8.12) project(kooka5) set(VERSION "0.90") message(STATUS "Configuring for Kooka/libkookascan version ${VERSION}") cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) set(QT_MIN_VERSION "5.4.0") set(KF5_MIN_VERSION "5.10.0") set(ECM_MIN_VERSION "1.2.0") # ECM setup (Extra Cmake Modules) find_package(ECM ${ECM_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(FeatureSummary) include(ECMSetupVersion) include(ECMGenerateHeaders) include(ECMPackageConfigHelpers) include(CheckFunctionExists) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(GenerateExportHeader) include(ECMInstallIcons) # Options option(INSTALL_BINARIES "Install the binaries and libraries, turn off for development in place" ON) # Required Qt5 components to build this package find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets) # Rigourousness add_definitions("-DQT_USE_FAST_CONCATENATION") add_definitions("-DQT_USE_FAST_OPERATOR_PLUS") add_definitions("-DQT_NO_CAST_FROM_BYTEARRAY") add_definitions("-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT") add_definitions("-DQT_NO_CAST_TO_ASCII") add_definitions("-DQT_NO_URL_CAST_FROM_STRING") # Permissiveness remove_definitions("-DQT_NO_CAST_FROM_ASCII") remove_definitions("-DQT_NO_SIGNALS_SLOTS_KEYWORDS") # Support for SANE, here because library and sanedump both need it # # Prefer pkg-config(1), because sane-config(1) was removed from Debian # package sane-backends 1.0.25 in December 2016. Assuming here that # pkg-config(1) is available on any reasonable system. find_package(PkgConfig) if (PkgConfig_FOUND) pkg_check_modules(SANE sane-backends) endif (PkgConfig_FOUND) if (SANE_FOUND) set(SANE_INCLUDES "${SANE_CFLAGS}") set(SANE_LIBRARIES "${SANE_LDFLAGS}") else (SANE_FOUND) # if pkg-config(1) did not find anything, then fall back to sane-config(1) message(STATUS "SANE not found via pkg-config(1), trying sane-config(1)") if (SANECONFIG_BIN) set(SANECONFIG_PROG ${SANECONFIG_BIN}) message(STATUS "Specified sane-config(1), ${SANECONFIG_PROG}") else (SANECONFIG_BIN) find_program(SANECONFIG_PROG NAMES sane-config) message(STATUS "Found sane-config(1), ${SANECONFIG_PROG}") endif (SANECONFIG_BIN) if (SANECONFIG_PROG) set(SANE_FOUND true) execute_process(COMMAND ${SANECONFIG_PROG} --version OUTPUT_VARIABLE SANE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${SANECONFIG_PROG} --cflags OUTPUT_VARIABLE SANE_INCLUDES OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${SANECONFIG_PROG} --libs OUTPUT_VARIABLE SANE_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Found SANE, version ${SANE_VERSION}") endif (SANECONFIG_PROG) endif (SANE_FOUND) if (SANE_FOUND) set(HAVE_SANE true) message(STATUS " SANE includes: ${SANE_INCLUDES}") message(STATUS " SANE libraries: ${SANE_LIBRARIES}") else (SANE_FOUND) message(SEND_ERROR "libkookascan needs SANE (http://www.sane-project.org) - install package or specify location of sane-config(1) with SANECONFIG_BIN") endif (SANE_FOUND) +############### Common install locations ############### + +set(PICS_INSTALL_DIR ${DATA_INSTALL_DIR}/kooka/pics) + ############### Now, we add the Kooka components ############### add_subdirectory(libdialogutil) add_subdirectory(libkookascan) add_subdirectory(libfiletree) add_subdirectory(app) add_subdirectory(plugins) add_subdirectory(doc) add_subdirectory(tools EXCLUDE_FROM_ALL) ############### VCS revision number in vcsversion.h ############### add_custom_target(vcsversion ALL COMMENT "Checking VCS version" VERBATIM COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/vcsversion.sh ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${VERSION} ) # ########### documentation ############### # # if (HAVE_APIDOX) # add_custom_target(apidox # COMMENT "Generating API documentation in ${CMAKE_CURRENT_BINARY_DIR}..." # VERBATIM # COMMAND sh -c "${KDELIBS_SOURCE_DIR}/doc/api/doxygen.sh --no-modulename --recurse --doxdatadir=${KDELIBS_SOURCE_DIR}/doc/common ${CMAKE_CURRENT_SOURCE_DIR}; echo 'API documentation at file://${CMAKE_CURRENT_BINARY_DIR}/apidocs/index.html';") # endif (HAVE_APIDOX) ############### Configuration information ############### feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/app/pics/CMakeLists.txt b/app/pics/CMakeLists.txt index c2fce64..9f19f38 100644 --- a/app/pics/CMakeLists.txt +++ b/app/pics/CMakeLists.txt @@ -1,44 +1,41 @@ ########################################################################## ## ## ## This CMake file is part of Kooka, a KDE scanning/OCR application. ## ## ## ## This file may be distributed and/or modified under the terms of ## ## the GNU General Public License version 2, as published by the ## ## Free Software Foundation and appearing in the file COPYING ## ## included in the packaging of this file. ## ## ## ## Author: Jonathan Marten ## ## ## ########################################################################## project(kooka5) ########### install files ############### set(kooka_PICS lockzoom.png mirror-both.png mirror-horiz.png mirror-vert.png newfromselect.png ocr.png ocr-select.png - gocr.png - ocrad.png - tesseract.png photocopy.png preview.png scan.png scanadd.png scanselect.png scaleorig.png scaletoheight.png scaletowidth.png thumbviewtile.png rotate-acw.png rotate-cw.png rotate-180.png autoselect.png ) -install(FILES ${kooka_PICS} DESTINATION ${DATA_INSTALL_DIR}/kooka/pics) +install(FILES ${kooka_PICS} DESTINATION ${PICS_INSTALL_DIR}) diff --git a/plugins/ocr/gocr/CMakeLists.txt b/plugins/ocr/gocr/CMakeLists.txt index dbf8239..a3c4f71 100644 --- a/plugins/ocr/gocr/CMakeLists.txt +++ b/plugins/ocr/gocr/CMakeLists.txt @@ -1,37 +1,38 @@ ########################################################################## ## ## ## This CMake file is part of Kooka, a KDE scanning/OCR application. ## ## ## ## This file may be distributed and/or modified under the terms of ## ## the GNU General Public License version 2, as published by the ## ## Free Software Foundation and appearing in the file COPYING ## ## included in the packaging of this file. ## ## ## ## Author: Jonathan Marten ## ## ## ########################################################################## project(kooka5) ######################################################################### # # # OCR plugin for GOCR # # # ######################################################################### set(kookaocrgocr_SRCS ocrgocrengine.cpp ocrgocrdialog.cpp ) add_library(kookaocrgocr MODULE ${kookaocrgocr_SRCS}) kcoreaddons_desktop_to_json(kookaocrgocr kookaocr-gocr.desktop) target_link_libraries(kookaocrgocr Qt5::Core Qt5::Gui) target_link_libraries(kookaocrgocr KF5::I18n KF5::WidgetsAddons) target_link_libraries(kookaocrgocr kookaocr kookascan) if (INSTALL_BINARIES) install(TARGETS kookaocrgocr DESTINATION ${PLUGIN_INSTALL_DIR}/kooka) endif (INSTALL_BINARIES) install(FILES kookaocr-gocr.desktop DESTINATION ${SERVICES_INSTALL_DIR}) +install(FILES gocr.png DESTINATION ${PICS_INSTALL_DIR}) diff --git a/app/pics/gocr.png b/plugins/ocr/gocr/gocr.png similarity index 100% rename from app/pics/gocr.png rename to plugins/ocr/gocr/gocr.png diff --git a/plugins/ocr/ocrad/CMakeLists.txt b/plugins/ocr/ocrad/CMakeLists.txt index 928be00..59d0e39 100644 --- a/plugins/ocr/ocrad/CMakeLists.txt +++ b/plugins/ocr/ocrad/CMakeLists.txt @@ -1,37 +1,38 @@ ########################################################################## ## ## ## This CMake file is part of Kooka, a KDE scanning/OCR application. ## ## ## ## This file may be distributed and/or modified under the terms of ## ## the GNU General Public License version 2, as published by the ## ## Free Software Foundation and appearing in the file COPYING ## ## included in the packaging of this file. ## ## ## ## Author: Jonathan Marten ## ## ## ########################################################################## project(kooka5) ######################################################################### # # # OCR plugin for OCRAD # # # ######################################################################### set(kookaocrocrad_SRCS ocrocradengine.cpp ocrocraddialog.cpp ) add_library(kookaocrocrad MODULE ${kookaocrocrad_SRCS}) kcoreaddons_desktop_to_json(kookaocrocrad kookaocr-ocrad.desktop) target_link_libraries(kookaocrocrad Qt5::Core Qt5::Gui) target_link_libraries(kookaocrocrad KF5::I18n KF5::WidgetsAddons) target_link_libraries(kookaocrocrad kookaocr kookascan) if (INSTALL_BINARIES) install(TARGETS kookaocrocrad DESTINATION ${PLUGIN_INSTALL_DIR}/kooka) endif (INSTALL_BINARIES) install(FILES kookaocr-ocrad.desktop DESTINATION ${SERVICES_INSTALL_DIR}) +install(FILES ocrad.png DESTINATION ${PICS_INSTALL_DIR}) diff --git a/app/pics/ocrad.png b/plugins/ocr/ocrad/ocrad.png similarity index 100% rename from app/pics/ocrad.png rename to plugins/ocr/ocrad/ocrad.png diff --git a/plugins/ocr/tesseract/CMakeLists.txt b/plugins/ocr/tesseract/CMakeLists.txt index 4e555ad..2ed81bf 100644 --- a/plugins/ocr/tesseract/CMakeLists.txt +++ b/plugins/ocr/tesseract/CMakeLists.txt @@ -1,37 +1,38 @@ ########################################################################## ## ## ## This CMake file is part of Kooka, a KDE scanning/OCR application. ## ## ## ## This file may be distributed and/or modified under the terms of ## ## the GNU General Public License version 2, as published by the ## ## Free Software Foundation and appearing in the file COPYING ## ## included in the packaging of this file. ## ## ## ## Author: Jonathan Marten ## ## ## ########################################################################## project(kooka5) ######################################################################### # # # OCR plugin for Tesseract # # # ######################################################################### set(kookaocrtesseract_SRCS ocrtesseractengine.cpp ocrtesseractdialog.cpp ) add_library(kookaocrtesseract MODULE ${kookaocrtesseract_SRCS}) kcoreaddons_desktop_to_json(kookaocrtesseract kookaocr-tesseract.desktop) target_link_libraries(kookaocrtesseract Qt5::Core Qt5::Gui) target_link_libraries(kookaocrtesseract KF5::I18n KF5::WidgetsAddons) target_link_libraries(kookaocrtesseract kookaocr kookascan) if (INSTALL_BINARIES) install(TARGETS kookaocrtesseract DESTINATION ${PLUGIN_INSTALL_DIR}/kooka) endif (INSTALL_BINARIES) install(FILES kookaocr-tesseract.desktop DESTINATION ${SERVICES_INSTALL_DIR}) +install(FILES tesseract.png DESTINATION ${PICS_INSTALL_DIR}) diff --git a/app/pics/tesseract.png b/plugins/ocr/tesseract/tesseract.png similarity index 100% rename from app/pics/tesseract.png rename to plugins/ocr/tesseract/tesseract.png