summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-28 21:48:26 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-09-09 00:35:12 +0200
commit2eec2c156b386e3a84889d473d94299b70c3916d (patch)
tree8167b9b28abedf99c631a1c786a8a6781813af10
parentCMake: Add option to download Qt and GLFW binaries over HTTP (diff)
downloadyuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar.gz
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar.bz2
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar.lz
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar.xz
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.tar.zst
yuzu-2eec2c156b386e3a84889d473d94299b70c3916d.zip
-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)
if (DEFINED QT_VER)
download_bundled_external("qt/" ${QT_VER} QT_PREFIX)
- list(APPEND CMAKE_PREFIX_PATH "${QT_PREFIX}")
endif()
elseif (DEFINED ENV{QTDIR})
# Set CMAKE_PREFIX_PATH if QTDIR is defined in the environment This allows CMake to
# automatically find the Qt packages on Windows
- list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}")
+ set(QT_PREFIX "$ENV{QTDIR}")
+ endif()
+
+ # Passing an empty HINTS seems to cause default system paths to get ignored in CMake 2.8 so make
+ # sure to not pass anything if we don't have one
+ if (DEFINED QT_PREFIX)
+ set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
+ else()
+ set(QT_PREFIX_HINT)
endif()
if (NOT CITRA_FORCE_QT4)
- find_package(Qt5 COMPONENTS Widgets OpenGL)
+ find_package(Qt5 COMPONENTS Widgets OpenGL ${QT_PREFIX_HINT})
set(CITRA_QT_LIBS Qt5::Widgets Qt5::OpenGL)
endif()
if (CITRA_FORCE_QT4 OR NOT Qt5_FOUND)
# Try to fallback to Qt4
- find_package(Qt4 REQUIRED COMPONENTS QtGui QtOpenGL)
+ find_package(Qt4 REQUIRED COMPONENTS QtGui QtOpenGL ${QT_PREFIX_HINT})
set(CITRA_QT_LIBS Qt4::QtGui Qt4::QtOpenGL)
endif()
endif()