summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindMir.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/modules/FindMir.cmake')
-rw-r--r--project/cmake/modules/FindMir.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/project/cmake/modules/FindMir.cmake b/project/cmake/modules/FindMir.cmake
new file mode 100644
index 0000000..8847a61
--- /dev/null
+++ b/project/cmake/modules/FindMir.cmake
@@ -0,0 +1,33 @@
1# FindMir
2# -------
3# Finds the Mir library
4#
5# This will will define the following variables::
6#
7# MIR_FOUND - the system has Mir
8# MIR_INCLUDE_DIRS - the Mir include directory
9# MIR_LIBRARIES - the Mir libraries
10# MIR_DEFINITIONS - the Mir definitions
11
12
13if(PKG_CONFIG_FOUND)
14 pkg_check_modules (PC_MIR mirclient QUIET)
15endif()
16
17find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h
18 PATHS ${PC_MIR_INCLUDE_DIRS})
19
20find_library(MIR_LIBRARY NAMES mirclient
21 PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS})
22
23include (FindPackageHandleStandardArgs)
24find_package_handle_standard_args (MIR
25 REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR)
26
27if (MIR_FOUND)
28 set(MIR_LIBRARIES ${MIR_LIBRARY})
29 set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS})
30 set(MIR_DEFINITIONS -DHAVE_MIR=1)
31endif()
32
33mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR)