summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/FindElementary.cmake
blob: 5b75bfceddf3623b0913c26837fde8a5fc9e2caa (plain)
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
# - Try to find elementary
# Once done this will define
#  ELEMENTARY_FOUND - System has elementary
#  ELEMENTARY_INCLUDE_DIRS - The elementary include directories
#  ELEMENTARY_LIBRARIES - The libraries needed to use elementary
#  ELEMENTARY_DEFINITIONS - Compiler switches required for using elementary

find_package(PkgConfig)
pkg_check_modules(PC_LIBELEMENTARY QUIET elementary)
set(ELEMENTARY_DEFINITIONS ${PC_LIBELEMENTARY_CFLAGS_OTHER})

find_path(ELEMENTARY_INCLUDE_DIR Elementary.h
          HINTS ${PC_LIBELEMENTARY_INCLUDEDIR} ${PC_LIBELEMENTARY_INCLUDE_DIRS}
          PATH_SUFFIXES elementary )

find_library(ELEMENTARY_LIBRARY NAMES elementary
             HINTS ${PC_LIBELEMENTARY_LIBDIR} ${PC_LIBELEMENTARY_LIBRARY_DIRS} )

set(ELEMENTARY_LIBRARIES ${ELEMENTARY_LIBRARY} )
set(ELEMENTARY_INCLUDE_DIRS ${PC_LIBELEMENTARY_INCLUDEDIR} ${PC_LIBELEMENTARY_INCLUDE_DIRS} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set ELEMENTARY_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(elementary  DEFAULT_MSG
                                  ELEMENTARY_LIBRARY ELEMENTARY_INCLUDE_DIR)

mark_as_advanced(ELEMENTARY_INCLUDE_DIR ELEMENTARY_LIBRARY )