diff options
author | Tony Barbour <tony@LunarG.com> | 2016-12-07 16:13:35 -0700 |
---|---|---|
committer | Tony Barbour <tony@LunarG.com> | 2016-12-09 11:48:58 -0700 |
commit | 23428842008bdb4a08ff807009aecee24e60c412 (patch) | |
tree | 120a11f78b02326f67fba4d28d54598bdff92058 /CMakeLists.txt | |
parent | 0394191ea288611bb919194d46fde101947df54a (diff) |
Cmake: Move all find_packages to base CMakeLists.txt
Change-Id: Id27307788c7c230e75d620f1bf5470b1450289f2
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 27 |
1 files changed, 18 insertions, 9 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) |