summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt27
-rw-r--r--demos/CMakeLists.txt3
-rw-r--r--layers/CMakeLists.txt1
-rw-r--r--loader/CMakeLists.txt1
-rw-r--r--tests/CMakeLists.txt6
5 files changed, 18 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34aa8e5e..0f59335a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,27 +12,39 @@ set(API_NAME "Vulkan" CACHE STRING "API name to use when building")
set(MAJOR "1")
string(TOLOWER ${API_NAME} API_LOWERCASE)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(PythonInterp 3 REQUIRED)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ include(FindPkgConfig)
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" ON)
option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" ON)
option(DEMOS_WSI_SELECTION "Select WSI to use to build demos" XCB)
-endif()
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ if (BUILD_WSI_XCB_SUPPORT)
+ find_package(XCB REQUIRED)
+ endif()
+
+ if (BUILD_WSI_XLIB_SUPPORT)
+ find_package(X11 REQUIRED)
+ endif()
+
+ if (BUILD_WSI_WAYLAND_SUPPORT)
+ find_package(Wayland REQUIRED)
+ endif()
+
+ if (BUILD_WSI_MIR_SUPPORT)
+ find_package(Mir REQUIRED)
+ endif()
+endif()
set(SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts")
# Header file for CMake settings
include_directories("${PROJECT_SOURCE_DIR}/include")
-if(NOT WIN32)
- include(FindPkgConfig)
-endif()
-
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp")
@@ -50,9 +62,6 @@ if(WIN32)
endif()
if(NOT WIN32)
- if (BUILD_WSI_XCB_SUPPORT)
- find_package(XCB REQUIRED)
- endif()
set (BUILDTGT_DIR build)
set (BINDATA_DIR Bin)
set (LIBSOURCE_DIR Lib)
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
index eff654bc..9bf07e53 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
@@ -12,7 +12,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (NOT BUILD_WSI_XCB_SUPPORT)
message( FATAL_ERROR "Selected XCB for demos build but not building Xcb support" )
endif()
- find_package(XCB REQUIRED)
include_directories(${XCB_INCLUDE_DIRS})
link_libraries(${XCB_LIBRARIES})
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
@@ -20,7 +19,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (NOT BUILD_WSI_XLIB_SUPPORT)
message( FATAL_ERROR "Selected XLIB for demos build but not building Xlib support" )
endif()
- find_package(X11 REQUIRED)
include_directories(${X11_INCLUDE_DIR})
link_libraries(${X11_LIBRARIES})
add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
@@ -28,7 +26,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (NOT BUILD_WSI_WAYLAND_SUPPORT)
message( FATAL_ERROR "Selected Wayland for demos build but not building Wayland support" )
endif()
- find_package(Wayland REQUIRED)
include_directories(${WAYLAND_CLIENT_INCLUDE_DIR})
link_libraries(${WAYLAND_CLIENT_LIBRARIES})
add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR)
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index e9cf066c..a9b44286 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -20,7 +20,6 @@ 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()
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 63ee89a0..095098aa 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -22,7 +22,6 @@ 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()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a59cc74d..1cbdaf0c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -20,7 +20,6 @@ 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()
@@ -37,11 +36,6 @@ if (WIN32)
else ()
set (BUILDTGT_DIR build32)
endif()
-else()
- include (FindPkgConfig)
- if (BUILD_WSI_XCB_SUPPORT)
- find_package(XCB REQUIRED)
- endif()
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")