summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-08-28 16:48:26 -0300
committerGravatar Yuri Kunde Schlesner2015-09-08 19:35:12 -0300
commit2eec2c156b386e3a84889d473d94299b70c3916d (patch)
tree8167b9b28abedf99c631a1c786a8a6781813af10
parentCMake: Add option to download Qt and GLFW binaries over HTTP (diff)
downloadyuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar.gz
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar.xz
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.zip
CMake: Use HINTS option instead of modifying CMAKE_PREFIX_PATH for Qt
-rw-r--r--CMakeLists.txt15
1 files changed, 11 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7844eb38..81bb9bb17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,22 +189,29 @@ if (ENABLE_QT)
189 189
190 if (DEFINED QT_VER) 190 if (DEFINED QT_VER)
191 download_bundled_external("qt/" ${QT_VER} QT_PREFIX) 191 download_bundled_external("qt/" ${QT_VER} QT_PREFIX)
192 list(APPEND CMAKE_PREFIX_PATH "${QT_PREFIX}")
193 endif() 192 endif()
194 elseif (DEFINED ENV{QTDIR}) 193 elseif (DEFINED ENV{QTDIR})
195 # Set CMAKE_PREFIX_PATH if QTDIR is defined in the environment This allows CMake to 194 # Set CMAKE_PREFIX_PATH if QTDIR is defined in the environment This allows CMake to
196 # automatically find the Qt packages on Windows 195 # automatically find the Qt packages on Windows
197 list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}") 196 set(QT_PREFIX "$ENV{QTDIR}")
197 endif()
198
199 # Passing an empty HINTS seems to cause default system paths to get ignored in CMake 2.8 so make
200 # sure to not pass anything if we don't have one
201 if (DEFINED QT_PREFIX)
202 set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
203 else()
204 set(QT_PREFIX_HINT)
198 endif() 205 endif()
199 206
200 if (NOT CITRA_FORCE_QT4) 207 if (NOT CITRA_FORCE_QT4)
201 find_package(Qt5 COMPONENTS Widgets OpenGL) 208 find_package(Qt5 COMPONENTS Widgets OpenGL ${QT_PREFIX_HINT})
202 set(CITRA_QT_LIBS Qt5::Widgets Qt5::OpenGL) 209 set(CITRA_QT_LIBS Qt5::Widgets Qt5::OpenGL)
203 endif() 210 endif()
204 211
205 if (CITRA_FORCE_QT4 OR NOT Qt5_FOUND) 212 if (CITRA_FORCE_QT4 OR NOT Qt5_FOUND)
206 # Try to fallback to Qt4 213 # Try to fallback to Qt4
207 find_package(Qt4 REQUIRED COMPONENTS QtGui QtOpenGL) 214 find_package(Qt4 REQUIRED COMPONENTS QtGui QtOpenGL ${QT_PREFIX_HINT})
208 set(CITRA_QT_LIBS Qt4::QtGui Qt4::QtOpenGL) 215 set(CITRA_QT_LIBS Qt4::QtGui Qt4::QtOpenGL)
209 endif() 216 endif()
210endif() 217endif()