Cmake: Add files needed to build with Mir

Change-Id: I640e45db5d586a379674fb209e38075ba7f0cf29
This commit is contained in:
Tony Barbour
2016-12-07 10:19:21 -07:00
parent f38413e531
commit 62da8e0073
4 changed files with 43 additions and 2 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ find_package(PythonInterp 3 REQUIRED)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" OFF)
option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" OFF)
option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON)
option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" ON)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+37
View File
@@ -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 ()
+2
View File
@@ -22,6 +22,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (BUILD_WSI_MIR_SUPPORT)
add_definitions(-DVK_USE_PLATFORM_MIR_KHR)
find_package(Mir REQUIRED)
include_directories(${MIR_INCLUDE_DIR})
endif()
else()
message(FATAL_ERROR "Unsupported Platform!")
+2
View File
@@ -20,6 +20,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (BUILD_WSI_MIR_SUPPORT)
add_definitions(-DVK_USE_PLATFORM_MIR_KHR)
find_package(Mir REQUIRED)
include_directories(${MIR_INCLUDE_DIR})
endif()
else()
message(FATAL_ERROR "Unsupported Platform!")