diff --git a/CMakeLists.txt b/CMakeLists.txt index 491bf44..d891c94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,35 +1,34 @@ project(Koko) cmake_minimum_required(VERSION 2.8.12) -find_package(ECM 0.0.9 REQUIRED NO_MODULE) +find_package(ECM 5.53.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH}) find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Widgets Test Sql Positioning) find_package(KF5 5.5 REQUIRED COMPONENTS I18n Declarative Config DBusAddons KIO GuiAddons CoreAddons Notifications IconThemes) -find_package(Exiv2 0.21 REQUIRED) +find_package(LibExiv2 0.21 REQUIRED) include(FeatureSummary) include(ECMAddTests) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings) include(GenerateExportHeader) include(ECMInstallIcons) include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src - ${EXIV2_INCLUDE_DIR} ) kde_enable_exceptions() add_subdirectory(src) add_subdirectory(autotests) add_subdirectory(qml) add_subdirectory(icons) install(FILES org.kde.koko.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/cmake/FindExiv2.cmake b/cmake/FindExiv2.cmake deleted file mode 100644 index fc729d4..0000000 --- a/cmake/FindExiv2.cmake +++ /dev/null @@ -1,117 +0,0 @@ -#.rst: -# FindExiv2 -# --------- -# -# Try to find the Exiv2 library. -# -# This will define the following variables: -# -# ``Exiv2_FOUND`` -# System has Exiv2. -# -# ``Exiv2_VERSION`` -# The version of Exiv2. -# -# ``Exiv2_INCLUDE_DIRS`` -# This should be passed to target_include_directories() if -# the target is not used for linking. -# -# ``Exiv2_LIBRARIES`` -# The Exiv2 library. -# This can be passed to target_link_libraries() instead of -# the ``Exiv2::Exiv2`` target -# -# If ``Exiv2_FOUND`` is TRUE, the following imported target -# will be available: -# -# ``Exiv2::Exiv2`` -# The Exiv2 library -# -# -#============================================================================= -# Copyright (c) 2010, Alexander Neundorf, -# Copyright (c) 2008, Gilles Caulier, -# -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_EXIV2 QUIET exiv2) - -find_path(Exiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp - HINTS ${PC_EXIV2_INCLUDEDIR} -) - -find_library(Exiv2_LIBRARIES NAMES exiv2 libexiv2 - HINTS ${PC_EXIV2_LIBRARY_DIRS} -) - -set(Exiv2_VERSION ${PC_EXIV2_VERSION}) - -if(NOT Exiv2_VERSION AND DEFINED Exiv2_INCLUDE_DIRS) - # With exiv >= 0.27, the version #defines are in exv_conf.h instead of version.hpp - foreach(_exiv2_version_file "version.hpp" "exv_conf.h") - if(EXISTS "${Exiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}") - file(READ "${Exiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}" _exiv_version_file_content) - string(REGEX MATCH "#define EXIV2_MAJOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MAJOR_VERSION_MATCH ${_exiv_version_file_content}) - string(REGEX MATCH "#define EXIV2_MINOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MINOR_VERSION_MATCH ${_exiv_version_file_content}) - string(REGEX MATCH "#define EXIV2_PATCH_VERSION[ ]+\\([0-9]+\\)" EXIV2_PATCH_VERSION_MATCH ${_exiv_version_file_content}) - if(EXIV2_MAJOR_VERSION_MATCH) - string(REGEX REPLACE ".*_MAJOR_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_MAJOR_VERSION ${EXIV2_MAJOR_VERSION_MATCH}) - string(REGEX REPLACE ".*_MINOR_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_MINOR_VERSION ${EXIV2_MINOR_VERSION_MATCH}) - string(REGEX REPLACE ".*_PATCH_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_PATCH_VERSION ${EXIV2_PATCH_VERSION_MATCH}) - endif() - endif() - endforeach() - - set(Exiv2_VERSION "${EXIV2_MAJOR_VERSION}.${EXIV2_MINOR_VERSION}.${EXIV2_PATCH_VERSION}") -endif() - -# Deprecated, for backward compatibility -set(EXIV2_INCLUDE_DIR "${Exiv2_INCLUDE_DIRS}") -set(EXIV2_LIBRARIES "${Exiv2_LIBRARIES}") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Exiv2 - FOUND_VAR Exiv2_FOUND - REQUIRED_VARS Exiv2_LIBRARIES Exiv2_INCLUDE_DIRS - VERSION_VAR Exiv2_VERSION -) - -mark_as_advanced(Exiv2_INCLUDE_DIRS Exiv2_LIBRARIES) - -if(Exiv2_FOUND AND NOT TARGET Exiv2::Exiv2) - add_library(Exiv2::Exiv2 UNKNOWN IMPORTED) - set_target_properties(Exiv2::Exiv2 PROPERTIES - IMPORTED_LOCATION "${Exiv2_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${Exiv2_INCLUDE_DIRS}" - ) -endif() - -include(FeatureSummary) -set_package_properties(Exiv2 PROPERTIES - URL "http://www.exiv2.org" - DESCRIPTION "Image metadata support" -) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 39a3a8b..e3106ec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,140 +1,140 @@ # # Common Library # set(LIB_SRCS imagestorage.cpp filesystemimagefetcher.cpp ${LIB_SRCS} ) add_library(kokocommon SHARED ${LIB_SRCS}) target_link_libraries(kokocommon Qt5::Core Qt5::Positioning Qt5::Sql KF5::CoreAddons ) generate_export_header(kokocommon BASE_NAME KOKO EXPORT_FILE_NAME koko_export.h) set_target_properties(kokocommon PROPERTIES VERSION 0.0.1 SOVERSION 0.0.1 ) install(TARGETS kokocommon EXPORT KokoLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) # # Application # add_executable(koko main.cpp reversegeocoder.cpp filesystemtracker.cpp processor.cpp committimer.cpp imageprocessorrunnable.cpp exiv2extractor.cpp kokoconfig.cpp kdtree.c ) target_link_libraries(koko Qt5::Quick Qt5::Widgets Qt5::Qml Qt5::Positioning KF5::ConfigCore KF5::DBusAddons KF5::I18n KF5::CoreAddons KF5::KIOCore KF5::IconThemes kokocommon - ${EXIV2_LIBRARIES} + LibExiv2::LibExiv2 ) install(TARGETS koko ${INSTALL_TARGETS_DEFAULT_ARGS}) # # QML Plugin # set (qml_plugin_SRCS qmlplugins.cpp tagmodel.cpp imagelocationmodel.cpp imagetimemodel.cpp imagefoldermodel.cpp sortmodel.cpp allimagesmodel.cpp imagelistmodel.cpp notificationmanager.cpp types.cpp roles.cpp imagedocument.cpp ) add_library (kokoqmlplugin SHARED ${qml_plugin_SRCS}) target_link_libraries (kokoqmlplugin Qt5::Qml KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::GuiAddons KF5::I18n KF5::Notifications kokocommon ) install (TARGETS kokoqmlplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/koko) install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/koko) install (FILES org.kde.koko.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) # # Reverse GeoLookup Data # # Packagers can download the file and put it in the tarball if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cities1000.zip) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/cities1000.zip DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) endif() if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/cities1000.zip) file (DOWNLOAD "http://download.geonames.org/export/dump/cities1000.zip" ${CMAKE_CURRENT_BINARY_DIR}/cities1000.zip SHOW_PROGRESS ) endif() execute_process( COMMAND ${CMAKE_COMMAND} -E tar -xzf ${CMAKE_CURRENT_BINARY_DIR}/cities1000.zip WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/admin1CodesASCII.txt) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/admin1CodesASCII.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) endif() if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/admin1CodesASCII.txt) file (DOWNLOAD "http://download.geonames.org/export/dump/admin1CodesASCII.txt" ${CMAKE_CURRENT_BINARY_DIR}/admin1CodesASCII.txt SHOW_PROGRESS ) endif() file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/admin1CodesASCII.txt ${CMAKE_CURRENT_BINARY_DIR}/admin1Codes.txt) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/admin2Codes.txt) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/admin2Codes.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) endif() if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/admin2Codes.txt) file (DOWNLOAD "http://download.geonames.org/export/dump/admin2Codes.txt" ${CMAKE_CURRENT_BINARY_DIR}/admin2Codes.txt SHOW_PROGRESS ) endif() install (FILES ${CMAKE_CURRENT_BINARY_DIR}/cities1000.txt DESTINATION ${DATA_INSTALL_DIR}/koko) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/admin1Codes.txt DESTINATION ${DATA_INSTALL_DIR}/koko) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/admin2Codes.txt DESTINATION ${DATA_INSTALL_DIR}/koko) install (FILES countries.csv DESTINATION ${DATA_INSTALL_DIR}/koko) install (FILES koko.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})