diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index e1ca44973b157..e479d746c16a3 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -347,39 +347,17 @@ if(x11) if(X11_X11_INCLUDE_PATH) set(X11_FIND_QUIETLY 1) endif() - find_package(X11 REQUIRED) - if(X11_FOUND) - list(REMOVE_DUPLICATES X11_INCLUDE_DIR) - if(NOT X11_FIND_QUIETLY) - message(STATUS "X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}") - message(STATUS "X11_LIBRARIES: ${X11_LIBRARIES}") - endif() - else() - message(FATAL_ERROR "libX11 and X11 headers must be installed.") - endif() - if(X11_Xpm_FOUND) - if(NOT X11_FIND_QUIETLY) - message(STATUS "X11_Xpm_INCLUDE_PATH: ${X11_Xpm_INCLUDE_PATH}") - message(STATUS "X11_Xpm_LIB: ${X11_Xpm_LIB}") - endif() - else() - message(FATAL_ERROR "libXpm and Xpm headers must be installed.") - endif() - if(X11_Xft_FOUND) - if(NOT X11_FIND_QUIETLY) - message(STATUS "X11_Xft_INCLUDE_PATH: ${X11_Xft_INCLUDE_PATH}") - message(STATUS "X11_Xft_LIB: ${X11_Xft_LIB}") - endif() - else() - message(FATAL_ERROR "libXft and Xft headers must be installed.") - endif() - if(X11_Xext_FOUND) - if(NOT X11_FIND_QUIETLY) - message(STATUS "X11_Xext_INCLUDE_PATH: ${X11_Xext_INCLUDE_PATH}") - message(STATUS "X11_Xext_LIB: ${X11_Xext_LIB}") - endif() - else() - message(FATAL_ERROR "libXext and Xext headers must be installed.") + find_package(X11 REQUIRED COMPONENTS Xpm Xft Xext) + list(REMOVE_DUPLICATES X11_INCLUDE_DIR) + if(NOT X11_FIND_QUIETLY) + message(STATUS "X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}") + message(STATUS "X11_LIBRARIES: ${X11_LIBRARIES}") + message(STATUS "X11_Xpm_INCLUDE_PATH: ${X11_Xpm_INCLUDE_PATH}") + message(STATUS "X11_Xpm_LIB: ${X11_Xpm_LIB}") + message(STATUS "X11_Xft_INCLUDE_PATH: ${X11_Xft_INCLUDE_PATH}") + message(STATUS "X11_Xft_LIB: ${X11_Xft_LIB}") + message(STATUS "X11_Xext_INCLUDE_PATH: ${X11_Xext_INCLUDE_PATH}") + message(STATUS "X11_Xext_LIB: ${X11_Xext_LIB}") endif() endif()