Warning, /pim/trojita/cmake/FindMimetic.cmake is written in an unsupported language. File is not indexed.

0001 # Copyright (C) 2014-2015 Stephan Platz <trojita@paalsteek.de>
0002 #
0003 # This file is part of the Trojita Qt IMAP e-mail client,
0004 # http://trojita.flaska.net/
0005 #
0006 # This program is free software; you can redistribute it and/or
0007 # modify it under the terms of the GNU General Public License as
0008 # published by the Free Software Foundation; either version 2 of
0009 # the License or (at your option) version 3 or any later version
0010 # accepted by the membership of KDE e.V. (or its successor approved
0011 # by the membership of KDE e.V.), which shall act as a proxy
0012 # defined in Section 14 of version 3 of the license.
0013 #
0014 # This program is distributed in the hope that it will be useful,
0015 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 # GNU General Public License for more details.
0018 #
0019 # You should have received a copy of the GNU General Public License
0020 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 # - Try to find the mimetic library
0023 # Once done this will define
0024 #  Mimetic_FOUND - System has the mimetic library
0025 #  Mimetic_INCLUDE_DIRS - The MIMETIC include directories
0026 #  Mimetic_LIBRARIES - The libraries for use with target_link_libraries()
0027 #  Mimetic_DEFINITIONS - Compiler switches required for using MIMETIC
0028 #
0029 # If Mimetic_Found is TRUE, it will also define the following imported
0030 # target:
0031 # Mimetic::Mimetic
0032 
0033 find_package(PkgConfig)
0034 pkg_check_modules(PC_MIMETIC QUIET mimetic)
0035 set(MIMETIC_DEFINITIONS ${PC_MIMETIC_CFLAGS_OTHER})
0036 
0037 find_path(Mimetic_INCLUDE_DIRS mimetic.h
0038           HINTS ${PC_MIMETIC_INCLUDEDIR} ${PC_MIMETIC_INCLUDE_DIRS}
0039           PATH_SUFFIXES mimetic)
0040 
0041 find_library(Mimetic_LIBRARIES NAMES mimetic libmimetic
0042              HINTS ${PC_MIMETIC_LIBDIR} ${PC_MIMETIC_LIBRARY_DIRS} )
0043 
0044 include(FindPackageHandleStandardArgs)
0045 find_package_handle_standard_args(Mimetic
0046     FOUND_VAR
0047         Mimetic_FOUND
0048     REQUIRED_VARS
0049         Mimetic_LIBRARIES
0050         Mimetic_INCLUDE_DIRS
0051 )
0052 
0053 if (Mimetic_FOUND AND NOT TARGET Mimetic::Mimetic)
0054     add_library(Mimetic::Mimetic UNKNOWN IMPORTED)
0055     set_target_properties(Mimetic::Mimetic PROPERTIES
0056         IMPORTED_LOCATION "${Mimetic_LIBRARIES}"
0057         INTERFACE_INCLUDE_DIRECTORIES "${Mimetic_INCLUDE_DIRS}"
0058     )
0059 endif()
0060 
0061 mark_as_advanced(Mimetic_INCLUDE_DIRS Mimetic_LIBRARIES)
0062 
0063 include(FeatureSummary)
0064 set_package_properties(Mimetic PROPERTIES
0065     URL "https://www.codesink.org/mimetic_mime_library.html"
0066     DESCRIPTION "A full featured, STL-based, standards compliant C++ MIME library"
0067 )