From 9297c604caae0fb18e962eb16db041f2f8234b6a Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Fri, 8 Jan 2016 23:25:46 +1000 Subject: [PATCH] For cmake 3.4 - link X11 libs for glewinfo and visualinfo unless not available, or GLEW_OSMESA mode. --- build/cmake/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 353be7f..a8cfec7 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -39,6 +39,8 @@ else () endif () find_package (OpenGL REQUIRED) +find_package (X11) + set (GLEW_LIBRARIES ${OPENGL_LIBRARIES}) add_definitions (-DGLEW_NO_GLU) @@ -65,6 +67,7 @@ if (GLEW_OSMESA) endif () add_definitions (-DGLEW_OSMESA) set (GLEW_LIBRARIES ${OSMESA_LIB_NAME} ${OPENGL_LIBRARIES}) + set (X11_LIBRARIES) endif () #### GLEW #### @@ -116,14 +119,14 @@ if (BUILD_UTILS) list (APPEND GLEWINFO_SRC_FILES ${GLEW_DIR}/build/glewinfo.rc) endif () add_executable (glewinfo ${GLEWINFO_SRC_FILES}) - target_link_libraries (glewinfo glew) + target_link_libraries (glewinfo glew ${X11_LIBRARIES}) set (VISUALINFO_SRC_FILES ${GLEW_DIR}/src/visualinfo.c) if (WIN32) list (APPEND VISUALINFO_SRC_FILES ${GLEW_DIR}/build/visualinfo.rc) endif () add_executable (visualinfo ${VISUALINFO_SRC_FILES}) - target_link_libraries (visualinfo glew) + target_link_libraries (visualinfo glew ${X11_LIBRARIES}) install ( TARGETS glewinfo visualinfo DESTINATION bin)