From d4d531031c04798cd27178bf8b93b1a192d3f96c Mon Sep 17 00:00:00 2001 From: Marc Lagrange Date: Sat, 11 Oct 2008 00:05:56 +0200 Subject: [PATCH] CMake: Use FindX11 for libraries linking for X11 Signed-off-by: Marc Lagrange --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 443ca7b..dafabfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,15 +41,21 @@ set(CFLAGS "-g -Wall") set(CMAKE_C_FLAGS ${CFLAGS}) find_package(Freetype) if(FREETYPE_FOUND) - message("Found Freetype: ${FREETYPE_LIBRARIES}") include_directories(${FREETYPE_INCLUDE_DIRS}) else (FREETYPE_FOUND) message(FATAL_ERROR "Could not find Freetype") endif (FREETYPE_FOUND) + +find_package(X11) +if(X11_FOUND) + include_directories(${X11_INCLUDE_DIR}) +else (X11_FOUND) + message(FATAL_ERROR "Could not find X11") +endif (X11_FOUND) # Link Libraries set(LIBRARIES_TO_LINK ${FREETYPE_LIBRARIES} - X11 + ${X11_LIBRARIES} confuse) target_link_libraries(wmfs ${LIBRARIES_TO_LINK})