diff options
Diffstat (limited to 'find-modules/FindX11_XCB.cmake')
-rw-r--r-- | find-modules/FindX11_XCB.cmake | 82 |
1 files changed, 38 insertions, 44 deletions
diff --git a/find-modules/FindX11_XCB.cmake b/find-modules/FindX11_XCB.cmake index 05d18d5a..eafa08e2 100644 --- a/find-modules/FindX11_XCB.cmake +++ b/find-modules/FindX11_XCB.cmake @@ -2,7 +2,7 @@ # FindX11_XCB # ----------- # -# Try to find the X11 XCB compatibility library on a Unix system +# Try to find the X11 XCB compatibility library. # # This will define the following variables: # @@ -68,55 +68,49 @@ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindX11_XCB.cmake") endif() -if(NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PKG_X11_XCB QUIET x11-xcb) +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig) +pkg_check_modules(PKG_X11_XCB QUIET x11-xcb) - set(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS_OTHER}) - set(X11_XCB_VERSION ${PKG_X11_XCB_VERSION}) +set(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS_OTHER}) +set(X11_XCB_VERSION ${PKG_X11_XCB_VERSION}) - find_path(X11_XCB_INCLUDE_DIR - NAMES X11/Xlib-xcb.h - HINTS ${PKG_X11_XCB_INCLUDE_DIRS} - ) - find_library(X11_XCB_LIBRARY - NAMES X11-xcb - HINTS ${PKG_X11_XCB_LIBRARY_DIRS} - ) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(X11_XCB - FOUND_VAR - X11_XCB_FOUND - REQUIRED_VARS - X11_XCB_LIBRARY - X11_XCB_INCLUDE_DIR - VERSION_VAR - X11_XCB_VERSION - ) +find_path(X11_XCB_INCLUDE_DIR + NAMES X11/Xlib-xcb.h + HINTS ${PKG_X11_XCB_INCLUDE_DIRS} +) +find_library(X11_XCB_LIBRARY + NAMES X11-xcb + HINTS ${PKG_X11_XCB_LIBRARY_DIRS} +) - if(X11_XCB_FOUND AND NOT TARGET X11::XCB) - add_library(X11::XCB UNKNOWN IMPORTED) - set_target_properties(X11::XCB PROPERTIES - IMPORTED_LOCATION "${X11_XCB_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${X11_XCB_DEFINITIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${X11_XCB_INCLUDE_DIR}" - ) - endif() +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(X11_XCB + FOUND_VAR + X11_XCB_FOUND + REQUIRED_VARS + X11_XCB_LIBRARY + X11_XCB_INCLUDE_DIR + VERSION_VAR + X11_XCB_VERSION +) - mark_as_advanced(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARY) +if(X11_XCB_FOUND AND NOT TARGET X11::XCB) + add_library(X11::XCB UNKNOWN IMPORTED) + set_target_properties(X11::XCB PROPERTIES + IMPORTED_LOCATION "${X11_XCB_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${X11_XCB_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_XCB_INCLUDE_DIR}" + ) +endif() - # compatibility variables - set(X11_XCB_LIBRARIES ${X11_XCB_LIBRARY}) - set(X11_XCB_INCLUDE_DIRS ${X11_XCB_INCLUDE_DIR}) - set(X11_XCB_VERSION_STRING ${X11_XCB_VERSION}) +mark_as_advanced(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARY) -else() - message(STATUS "FindX11_XCB.cmake cannot find X11-XCB on Windows systems.") - set(X11_XCB_FOUND FALSE) -endif() +# compatibility variables +set(X11_XCB_LIBRARIES ${X11_XCB_LIBRARY}) +set(X11_XCB_INCLUDE_DIRS ${X11_XCB_INCLUDE_DIR}) +set(X11_XCB_VERSION_STRING ${X11_XCB_VERSION}) include(FeatureSummary) set_package_properties(X11_XCB PROPERTIES |