Cmake: Move all find_packages to base CMakeLists.txt

Change-Id: Id27307788c7c230e75d620f1bf5470b1450289f2
This commit is contained in:
Tony Barbour 2016-12-07 16:13:35 -07:00
parent 7fc644d709
commit 0c91fb3492
3 changed files with 18 additions and 16 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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")