--- CMakeLists.txt.orig	2016-04-17 08:55:32 UTC
+++ CMakeLists.txt
@@ -4,6 +4,11 @@ PROJECT( XKB-SWITCH )
 
 FIND_PROGRAM(CTAGS ctags)
 
+FIND_PACKAGE(X11 REQUIRED)
+
+INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
+LINK_DIRECTORIES(${X11_LIBRARY_DIR})
+
 ADD_EXECUTABLE(xkb-switch XKbSwitch.cpp XKeyboard.cpp)
 
 TARGET_LINK_LIBRARIES(xkb-switch X11 xkbfile)
