CMake: Remove support for QTDIR environment variable

Using this variable is problematic is the user has several versions of
Qt installed on their system. There is no way to know ahead of time if
the Qt version pointed to by QTDIR matches the toolchain that is being
targeted.

The Qt installation path can still be easily specified if it's not found
by CMake by setting the Qt5_DIR cache variable after the initial
configuration run, so this shouldn't present an usability issue.
This commit is contained in:
Yuri Kunde Schlesner 2015-09-07 23:32:53 -03:00
parent fdb0f8203e
commit 70d0d8890a
2 changed files with 3 additions and 9 deletions

View file

@ -190,17 +190,11 @@ if (ENABLE_QT)
if (DEFINED QT_VER) if (DEFINED QT_VER)
download_bundled_external("qt/" ${QT_VER} QT_PREFIX) download_bundled_external("qt/" ${QT_VER} QT_PREFIX)
endif() 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
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}") set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
else() else()
# 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.
set(QT_PREFIX_HINT) set(QT_PREFIX_HINT)
endif() endif()

View file

@ -18,7 +18,7 @@ install:
before_build: before_build:
- mkdir build - mkdir build
- cd build - cd build
- cmake -G "Visual Studio 12 Win64" -DCITRA_USE_BUNDLED_GLFW=1 .. - cmake -G "Visual Studio 12 Win64" -DCITRA_USE_BUNDLED_GLFW=1 -DQt5_DIR=%QTDIR%/lib/cmake/Qt5 ..
- cd .. - cd ..
after_build: after_build: