Skip to content

Commit

Permalink
[CMake] Simplify search for X11 components
Browse files Browse the repository at this point in the history
  • Loading branch information
guitargeek committed Jul 10, 2024
1 parent cecf4c6 commit 5838526
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 5838526

Please sign in to comment.