Tony Barbour | c53c727 | 2016-12-07 10:19:21 -0700 | [diff] [blame] | 1 | # Try to find Mir on a Unix system |
| 2 | # |
| 3 | # This will define: |
| 4 | # |
| 5 | # MIR_FOUND - System has Mir |
| 6 | # MIR_LIBRARIES - Link these to use Mir |
| 7 | # MIR_INCLUDE_DIR - Include directory for Mir |
| 8 | # MIR_DEFINITIONS - Compiler switches required for using Mir |
| 9 | |
| 10 | if (NOT WIN32) |
| 11 | |
| 12 | find_package (PkgConfig) |
| 13 | pkg_check_modules (PKG_MIR QUIET mirclient) |
| 14 | set(MIR_DEFINITIONS ${PKG_MIR_CFLAGS_OTHER}) |
| 15 | |
| 16 | find_path(MIR_INCLUDE_DIR |
| 17 | NAMES xkbcommon/xkbcommon.h |
| 18 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} |
| 19 | ) |
| 20 | |
| 21 | find_library(MIR_LIBRARY |
| 22 | NAMES mirclient |
| 23 | HINTS ${PKG_MIR_LIBRARIES} ${MIR_LIBRARY_DIRS} |
| 24 | ) |
| 25 | |
| 26 | set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS}) |
| 27 | set (MIR_LIBRARIES ${MIR_LIBRARY}) |
| 28 | |
| 29 | include (FindPackageHandleStandardArgs) |
| 30 | find_package_handle_standard_args (MIR DEFAULT_MSG |
| 31 | MIR_LIBRARIES |
| 32 | MIR_INCLUDE_DIR |
| 33 | ) |
| 34 | |
| 35 | mark_as_advanced (MIR_LIBRARIES MIR_INCLUDE_DIR) |
| 36 | |
| 37 | endif () |