diff options
author | Tony Barbour <tony@LunarG.com> | 2016-12-07 10:19:21 -0700 |
---|---|---|
committer | Tony Barbour <tony@LunarG.com> | 2016-12-09 11:48:58 -0700 |
commit | 5c8ad0352dcc78d20b5ed5308ff7cb5f933940fb (patch) | |
tree | 0d3e7221222e6fe6a199dc22a97a07b4f2eb8639 /cmake | |
parent | 3808074f5da7ec522be4dd36627e67067fb69915 (diff) |
Cmake: Add files needed to build with Mir
Change-Id: I640e45db5d586a379674fb209e38075ba7f0cf29
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindMir.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cmake/FindMir.cmake b/cmake/FindMir.cmake new file mode 100644 index 00000000..3f1fb0b3 --- /dev/null +++ b/cmake/FindMir.cmake @@ -0,0 +1,37 @@ +# Try to find Mir on a Unix system +# +# This will define: +# +# MIR_FOUND - System has Mir +# MIR_LIBRARIES - Link these to use Mir +# MIR_INCLUDE_DIR - Include directory for Mir +# MIR_DEFINITIONS - Compiler switches required for using Mir + +if (NOT WIN32) + + find_package (PkgConfig) + pkg_check_modules (PKG_MIR QUIET mirclient) + set(MIR_DEFINITIONS ${PKG_MIR_CFLAGS_OTHER}) + + find_path(MIR_INCLUDE_DIR + NAMES xkbcommon/xkbcommon.h + HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} + ) + + find_library(MIR_LIBRARY + NAMES mirclient + HINTS ${PKG_MIR_LIBRARIES} ${MIR_LIBRARY_DIRS} + ) + + set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS}) + set (MIR_LIBRARIES ${MIR_LIBRARY}) + + include (FindPackageHandleStandardArgs) + find_package_handle_standard_args (MIR DEFAULT_MSG + MIR_LIBRARIES + MIR_INCLUDE_DIR + ) + + mark_as_advanced (MIR_LIBRARIES MIR_INCLUDE_DIR) + +endif () |