File: FindMenuCache.cmake

package info (click to toggle)
lxqt-build-tools 2.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: perl: 42; sh: 14; makefile: 6
file content (88 lines) | stat: -rw-r--r-- 2,488 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# BSD-3-Clause file for details.

#.rst:
# FindMenuCache
# -----------
#
# Try to find the MenuCache library
#
# Once done this will define
#
# ::
#
#   MENUCACHE_FOUND - System has the MenuCache library
#   MENUCACHE_INCLUDE_DIR - The MenuCache library include directory
#   MENUCACHE_INCLUDE_DIRS - Location of the headers needed to use the MenuCache library
#   MENUCACHE_LIBRARIES - The libraries needed to the MenuCache library
#   MENUCACHE_DEFINITIONS - Compiler switches required for using the MenuCache library
#   MENUCACHE_VERSION_STRING - the version of MenuCache library found


# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig)
pkg_check_modules(PC_MENUCACHE libmenu-cache)
set(MENUCACHE_DEFINITIONS ${PC_MENUCACHE_CFLAGS_OTHER})

find_path(MENUCACHE_INCLUDE_DIRS
    NAMES
        menu-cache.h
        menu-cache/menu-cache.h
   HINTS
       ${PC_MENUCACHE_INCLUDEDIR}
       ${PC_MENUCACHE_INCLUDE_DIRS}
   PATH_SUFFIXES
        libmenu-cache
)

find_library(MENUCACHE_LIBRARIES
    NAMES
        menu-cache
        libmenu-cache
   HINTS
       ${PC_MENUCACHE_LIBDIR}
       ${PC_MENUCACHE_LIBRARY_DIRS}
)


# iterate over all dependencies
unset(FD_LIBRARIES)
foreach(depend ${PC_MENUCACHE_LIBRARIES})
    find_library(_DEPEND_LIBRARIES
        NAMES
            ${depend}
        HINTS
            ${PC_MENUCACHE_LIBDIR}
            ${PC_MENUCACHE_LIBRARY_DIRS}
    )

    if (_DEPEND_LIBRARIES)
        list(APPEND FD_LIBRARIES ${_DEPEND_LIBRARIES})
    endif()
    unset(_DEPEND_LIBRARIES CACHE)
endforeach()

set(MENUCACHE_VERSION_STRING ${PC_MENUCACHE_VERSION})
set(MENUCACHE_INCLUDE_DIR ${PC_MENUCACHE_INCLUDEDIR})

list(APPEND MENUCACHE_INCLUDE_DIRS
    ${MENUCACHE_INCLUDE_DIR}
    ${PC_MENUCACHE_INCLUDE_DIRS}
)
list(REMOVE_DUPLICATES MENUCACHE_INCLUDE_DIRS)

list(APPEND MENUCACHE_LIBRARIES
    ${FD_LIBRARIES}
)

list(REMOVE_DUPLICATES MENUCACHE_LIBRARIES)

# handle the QUIETLY and REQUIRED arguments and set MENUCACHE_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MenuCache
                                  REQUIRED_VARS MENUCACHE_LIBRARIES MENUCACHE_INCLUDE_DIR MENUCACHE_INCLUDE_DIRS
                                  VERSION_VAR MENUCACHE_VERSION_STRING)

mark_as_advanced(MENUCACHE_INCLUDE_DIR MENUCACHE_LIBRARIES)