~ubuntu-touch-coreapps-drivers/trojita/git-kde

« back to all changes in this revision

Viewing changes to cmake/FindMimetic.cmake

  • Committer: Jan Kundrát
  • Date: 2022-03-03 11:26:42 UTC
  • mfrom: (4947.1.7)
  • Revision ID: git-v1:f570812c3283bc9b40d008212994d2d88b8273ff
Merge commit 'merge-requests/14/head' into master

Change-Id: Ia008d46f9a5071bc313344aba0690c8367123e43

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
# - Try to find the mimetic library
23
23
# Once done this will define
24
 
#  MIMETIC_FOUND - System has MIMETIC
25
 
#  MIMETIC_INCLUDE_DIRS - The MIMETIC include directories
26
 
#  MIMETIC_LIBRARIES - The libraries needed to use MIMETIC
27
 
#  MIMETIC_DEFINITIONS - Compiler switches required for using MIMETIC
 
24
#  Mimetic_FOUND - System has the mimetic library
 
25
#  Mimetic_INCLUDE_DIRS - The MIMETIC include directories
 
26
#  Mimetic_LIBRARIES - The libraries for use with target_link_libraries()
 
27
#  Mimetic_DEFINITIONS - Compiler switches required for using MIMETIC
 
28
#
 
29
# If Mimetic_Found is TRUE, it will also define the following imported
 
30
# target:
 
31
# Mimetic::Mimetic
28
32
 
29
33
find_package(PkgConfig)
30
34
pkg_check_modules(PC_MIMETIC QUIET mimetic)
31
35
set(MIMETIC_DEFINITIONS ${PC_MIMETIC_CFLAGS_OTHER})
32
36
 
33
 
find_path(MIMETIC_INCLUDE_DIR mimetic.h
 
37
find_path(Mimetic_INCLUDE_DIRS mimetic.h
34
38
          HINTS ${PC_MIMETIC_INCLUDEDIR} ${PC_MIMETIC_INCLUDE_DIRS}
35
39
          PATH_SUFFIXES mimetic)
36
40
 
37
 
find_library(MIMETIC_LIBRARY NAMES mimetic libmimetic
 
41
find_library(Mimetic_LIBRARIES NAMES mimetic libmimetic
38
42
             HINTS ${PC_MIMETIC_LIBDIR} ${PC_MIMETIC_LIBRARY_DIRS} )
39
43
 
40
 
set(MIMETIC_LIBRARIES ${MIMETIC_LIBRARY} )
41
 
set(MIMETIC_INCLUDE_DIRS ${MIMETIC_INCLUDE_DIR} )
42
 
 
43
44
include(FindPackageHandleStandardArgs)
44
 
# handle the QUIETLY and REQUIRED arguments and set MIMETIC_FOUND to TRUE
45
 
# if all listed variables are TRUE
46
 
find_package_handle_standard_args(Mimetic  DEFAULT_MSG
47
 
                                  MIMETIC_LIBRARY MIMETIC_INCLUDE_DIR)
48
 
 
49
 
set(Mimetic_FOUND ${MIMETIC_FOUND})
50
 
 
51
 
mark_as_advanced(MIMETIC_INCLUDE_DIR MIMETIC_LIBRARY )
 
45
find_package_handle_standard_args(Mimetic
 
46
    FOUND_VAR
 
47
        Mimetic_FOUND
 
48
    REQUIRED_VARS
 
49
        Mimetic_LIBRARIES
 
50
        Mimetic_INCLUDE_DIRS
 
51
)
 
52
 
 
53
if (Mimetic_FOUND AND NOT TARGET Mimetic::Mimetic)
 
54
    add_library(Mimetic::Mimetic UNKNOWN IMPORTED)
 
55
    set_target_properties(Mimetic::Mimetic PROPERTIES
 
56
        IMPORTED_LOCATION "${Mimetic_LIBRARIES}"
 
57
        INTERFACE_INCLUDE_DIRECTORIES "${Mimetic_INCLUDE_DIRS}"
 
58
    )
 
59
endif()
 
60
 
 
61
mark_as_advanced(Mimetic_INCLUDE_DIRS Mimetic_LIBRARIES)
 
62
 
 
63
include(FeatureSummary)
 
64
set_package_properties(Mimetic PROPERTIES
 
65
    URL "https://www.codesink.org/mimetic_mime_library.html"
 
66
    DESCRIPTION "A full featured, STL-based, standards compliant C++ MIME library"
 
67
)