Add patch to fix the build with CMake 3.2.

Explicitly look for X11, since FindOpenGL.cmake no longer does that
automatically.
This commit is contained in:
Raphael Kubo da Costa 2015-06-15 21:49:52 +00:00
parent 7a5ece0d9a
commit 8abcfe50b7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=389757

View file

@ -0,0 +1,22 @@
Explicitly look for X11 when using it.
This fixes the build with CMake 3.2, whose FindOpenGL.cmake stopped
calling find_package(X11).
Instead, do that ourselves when Q_WS_X11 is true, since that is when we
already try to link against libX11.
Sent upstream: https://github.com/cryos/avogadro/pull/13
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -230,6 +230,10 @@ if(NOT Linguist_FOUND)
message(WARNING " Qt4 Linguist not found, please install it if you want Avogadro translations")
endif()
+if(Q_WS_X11)
+ find_package(X11 REQUIRED) # avogadro/src/main.cpp calls XInitThread().
+endif()
+
find_package(Eigen3) # find and setup Eigen3 if available
if(NOT EIGEN3_FOUND)
message(STATUS "Cannot find Eigen3, trying Eigen2")