From a9e50908a1cb3a7f6a7e58bcb4ed6d1ecf7937ee Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sun, 23 Apr 2017 09:34:57 +1000 Subject: [PATCH] For cmake build, skip X11 check for Windows and Apple OSX --- build/cmake/CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index c6beafc..8ec3ac5 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -37,6 +37,14 @@ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +find_package (OpenGL REQUIRED) + +# X11 required when builing visualinfo and glewinfo, +# but not for Windows or Apple OSX platforms +if (BUILD_UTILS AND NOT WIN32 AND NOT APPLE) + find_package (X11) +endif() + if (WIN32) set (GLEW_LIB_NAME glew32) else () @@ -44,11 +52,6 @@ else () set (DLL_PREFIX lib) 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)