| # Copyright (C) 2015 Valve Corporation |
| if(NOT XCB_FIND_COMPONENTS) |
| set(XCB_FIND_COMPONENTS xcb) |
| include(FindPackageHandleStandardArgs) |
| foreach(comp ${XCB_FIND_COMPONENTS}) |
| string(TOUPPER ${comp} compname) |
| string(REPLACE "-" "_" compname ${compname}) |
| string(REPLACE "xcb-" "" headername xcb/${comp}.h) |
| pkg_check_modules(PC_${comp} QUIET ${comp}) |
| find_path(${compname}_INCLUDE_DIR NAMES ${headername} |
| ${PC_${comp}_INCLUDE_DIRS} |
| find_library(${compname}_LIBRARY NAMES ${libname} |
| ${PC_${comp}_LIBRARY_DIRS} |
| find_package_handle_standard_args(${comp} |
| REQUIRED_VARS ${compname}_INCLUDE_DIR ${compname}_LIBRARY) |
| mark_as_advanced(${compname}_INCLUDE_DIR ${compname}_LIBRARY) |
| list(APPEND XCB_INCLUDE_DIRS ${${compname}_INCLUDE_DIR}) |
| list(APPEND XCB_LIBRARIES ${${compname}_LIBRARY}) |
| list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS) |