aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Barbour <tony@LunarG.com>2016-12-07 10:19:21 -0700
committerTony Barbour <tony@LunarG.com>2016-12-09 11:48:58 -0700
commit61e9b870c88fa3af43663697ef98960ff97053e5 (patch)
treeb133bf2ac2c7c00a671a0d4b09b794d8fea8e01f
parent4f7ed016c6c2abb832b46baa927ca794c531601a (diff)
downloadusermoji-61e9b870c88fa3af43663697ef98960ff97053e5.tar.xz
Cmake: Add files needed to build with Mir
Change-Id: I640e45db5d586a379674fb209e38075ba7f0cf29
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/FindMir.cmake37
-rw-r--r--demos/CMakeLists.txt12
-rw-r--r--layers/CMakeLists.txt2
-rw-r--r--loader/CMakeLists.txt2
5 files changed, 54 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ba397bc..8e20fd7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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")
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 ()
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
index a07ddd3a..565253ea 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
@@ -21,7 +21,17 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Wayland REQUIRED)
include_directories(${WAYLAND_CLIENT_INCLUDE_DIR})
link_libraries(${WAYLAND_CLIENT_LIBRARIES})
- endif()
+ add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR)
+ elseif(DEMOS_WSI_SELECTION STREQUAL "MIR")
+ if (NOT BUILD_WSI_MIR_SUPPORT)
+ message( FATAL_ERROR "Selected MIR for demos build but not building Mir support" )
+ endif()
+ add_definitions(-DVK_USE_PLATFORM_MIR_KHR)
+ include_directories(${MIR_INCLUDE_DIR})
+ # TODO - Add Mir support
+ else()
+ message( FATAL_ERROR "Unrecognized value for DEMOS_WSI_SELECTION: ${DEMOS_WSI_SELECTION}" )
+ endif()
include_directories ("${PROJECT_SOURCE_DIR}/icd/common")
link_libraries(${API_LOWERCASE} m)
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index 029a51c3..e9cf066c 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -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!")
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index ea5f5565..63ee89a0 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -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!")