From 29a4848d0d2b9fd6707bc868bb80e3b3ddcfc075 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 8 Jan 2017 11:13:00 +1000 Subject: [PATCH] cmake build: X11 is needed for linking glewinfo and visualinfo --- build/cmake/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 1563f9f..114c914 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -37,6 +37,10 @@ else () endif () find_package (OpenGL REQUIRED) +#X11 is only required when builing utils/ +if(BUILD_UTILS) + find_package (X11) +endif() set (GLEW_LIBRARIES ${OPENGL_LIBRARIES}) add_definitions (-DGLEW_NO_GLU) @@ -88,9 +92,15 @@ install ( TARGETS ${targets_to_install} if (BUILD_UTILS) add_executable (glewinfo ${GLEW_DIR}/src/glewinfo.c) target_link_libraries (glewinfo glew) + if (NOT WIN32) + target_link_libraries(glewinfo ${X11_LIBRARIES}) + endif () add_executable (visualinfo ${GLEW_DIR}/src/visualinfo.c) target_link_libraries (visualinfo glew) + if (NOT WIN32) + target_link_libraries(visualinfo ${X11_LIBRARIES}) + endif () install ( TARGETS glewinfo visualinfo DESTINATION bin)