From 85d676282884c28870a73c5842da6ae7f7628e42 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sat, 6 Jul 2024 17:24:42 +0800 Subject: [PATCH] chore: remove vendored FindLibExiv2.cmake --- CMakeLists.txt | 22 ++++----- LICENSES/BSD-3-Clause.txt | 11 ----- appveyor.yml | 2 +- cmake/FindLibExiv2.cmake | 96 --------------------------------------- 4 files changed, 10 insertions(+), 121 deletions(-) delete mode 100644 LICENSES/BSD-3-Clause.txt delete mode 100644 cmake/FindLibExiv2.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 5730dbb..1994d2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,6 @@ cmake_minimum_required (VERSION 3.9.5) project (pineapple-pictures) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) - include (GNUInstallDirs) include (FeatureSummary) @@ -41,8 +39,8 @@ if (${QT_VERSION_MAJOR} EQUAL "6") endif () if (EXIV2_METADATA_SUPPORT) - find_package(LibExiv2) - set_package_properties(LibExiv2 PROPERTIES + find_package(Exiv2) + set_package_properties(Exiv2 PROPERTIES URL "https://www.exiv2.org" DESCRIPTION "image metadata support" TYPE OPTIONAL @@ -50,7 +48,6 @@ if (EXIV2_METADATA_SUPPORT) ) endif () -#LibExiv2_FOUND set (PPIC_CPP_FILES app/main.cpp app/framelesswindow.cpp @@ -128,17 +125,16 @@ if (${QT_VERSION_MAJOR} EQUAL "6") target_link_libraries (${EXE_NAME} Qt::SvgWidgets) endif () -if (LibExiv2_FOUND) - message(INFO ${LibExiv2_INCLUDE_DIRS}) - target_include_directories(${EXE_NAME} - PRIVATE - ${LibExiv2_INCLUDE_DIRS} - ) +if (Exiv2_FOUND) + if(NOT TARGET Exiv2::exiv2lib AND TARGET exiv2lib) + # for exiv2 0.27.x + add_library(Exiv2::exiv2lib ALIAS exiv2lib) + endif() target_link_libraries (${EXE_NAME} - LibExiv2::LibExiv2 + Exiv2::exiv2lib ) target_compile_definitions(${EXE_NAME} PRIVATE - HAVE_EXIV2_VERSION="${LibExiv2_VERSION}" + HAVE_EXIV2_VERSION="${Exiv2_VERSION}" ) endif () diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt deleted file mode 100644 index ea890af..0000000 --- a/LICENSES/BSD-3-Clause.txt +++ /dev/null @@ -1,11 +0,0 @@ -Copyright (c) . - -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 above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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. diff --git a/appveyor.yml b/appveyor.yml index be82da9..9fc954e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -132,7 +132,7 @@ build_script: # finally... - mkdir build - cd build - - cmake .. -G "Ninja" %PPIC_CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX='%cd%' + - cmake .. -G "Ninja" %PPIC_CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%CMAKE_INSTALL_PREFIX% -DCMAKE_INSTALL_PREFIX='%cd%' - cmake --build . --config Release - cmake --build . --config Release --target install/strip # fixme: I don't know how to NOT make the binary installed to the ./bin/ folder... diff --git a/cmake/FindLibExiv2.cmake b/cmake/FindLibExiv2.cmake deleted file mode 100644 index 93f77ff..0000000 --- a/cmake/FindLibExiv2.cmake +++ /dev/null @@ -1,96 +0,0 @@ -#.rst: -# FindLibExiv2 -# ------------ -# -# Try to find the Exiv2 library. -# -# This will define the following variables: -# -# ``LibExiv2_FOUND`` -# True if (the requested version of) Exiv2 is available -# -# ``LibExiv2_VERSION`` -# The version of Exiv2 -# -# ``LibExiv2_INCLUDE_DIRS`` -# The include dirs of Exiv2 for use with target_include_directories() -# -# ``LibExiv2_LIBRARIES`` -# The Exiv2 library for use with target_link_libraries(). -# This can be passed to target_link_libraries() instead of -# the ``LibExiv2::LibExiv2`` target -# -# If ``LibExiv2_FOUND`` is TRUE, it will also define the following imported -# target: -# -# ``LibExiv2::LibExiv2`` -# The Exiv2 library -# -# In general we recommend using the imported target, as it is easier to use. -# Bear in mind, however, that if the target is in the link interface of an -# exported library, it must be made available by the package config file. -# -# Since 5.53.0. -# -#============================================================================= -# SPDX-FileCopyrightText: 2018 Christophe Giboudeaux -# SPDX-FileCopyrightText: 2010 Alexander Neundorf -# SPDX-FileCopyrightText: 2008 Gilles Caulier -# -# SPDX-License-Identifier: BSD-3-Clause -#============================================================================= - -find_package(PkgConfig QUIET) -pkg_check_modules(PC_EXIV2 QUIET exiv2) - -find_path(LibExiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp - HINTS ${PC_EXIV2_INCLUDEDIR} -) - -find_library(LibExiv2_LIBRARIES NAMES exiv2 libexiv2 - HINTS ${PC_EXIV2_LIBRARY_DIRS} -) - -set(LibExiv2_VERSION ${PC_EXIV2_VERSION}) - -if(NOT LibExiv2_VERSION AND DEFINED LibExiv2_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 "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}") - file(READ "${LibExiv2_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(LibExiv2_VERSION "${EXIV2_MAJOR_VERSION}.${EXIV2_MINOR_VERSION}.${EXIV2_PATCH_VERSION}") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibExiv2 - FOUND_VAR LibExiv2_FOUND - REQUIRED_VARS LibExiv2_LIBRARIES LibExiv2_INCLUDE_DIRS - VERSION_VAR LibExiv2_VERSION -) - -mark_as_advanced(LibExiv2_INCLUDE_DIRS LibExiv2_LIBRARIES) - -if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2) - add_library(LibExiv2::LibExiv2 UNKNOWN IMPORTED) - set_target_properties(LibExiv2::LibExiv2 PROPERTIES - IMPORTED_LOCATION "${LibExiv2_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${LibExiv2_INCLUDE_DIRS}" - ) -endif() - -include(FeatureSummary) -set_package_properties(LibExiv2 PROPERTIES - URL "https://www.exiv2.org" - DESCRIPTION "Image metadata support" -)