title: cmake find_packages(QT5) does not use correct version of QT binaries despite setting prefix path
body: <p>I was looking up how to compile QT dynamically linked projects in cmake with clion IDE.  I've run into issues with the following project set up.  I've followed <a href="http://doc.qt.io/qt-5/gettingstartedqt.html" rel="nofollow noreferrer">this</a> tutorial, compiled, and ran it with mingw32 bit <em>and</em> a kit with that links to Qt compiled with mingw-w64 (whose qmake file is found in C:/msys64/mingw64/bin)</p>
  
  <p>My project setup looks like this:</p>
  
  <pre><code>CMakeLists.txt
  main.cpp
  notepad.cpp
  notepad.h
  notepad.ui
  </code></pre>
  
  <p>In clion, I've used the follwing cmake file in order to build this project.</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.7)
  set(CMAKE_PREFIX_PATH C:/msys64/mingw64/bin)
  project(qttest)
  
  set(QT_ROOT_DIR "C:/msys64/mingw64/bin")
  
  set(QT_QMAKE_EXECUTABLE ${QT_ROOT_DIR}/qmake)
  
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  set(CMAKE_CXX_STANDARD 14)
  set(CMAKE_AUTOMOC ON)
  set(CMAKE_AUTOUIC ON)
  
  
  find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui)
  
  add_library(notepad notepad.cpp)
  target_link_libraries (notepad Qt5::Core Qt5::Widgets Qt5::Gui)
  
  
  
  
  set(SOURCE_FILES main.cpp)
  add_executable(qttest ${SOURCE_FILES})
  target_link_libraries(qttest notepad)
  </code></pre>
  
  <p>After getting the following errors on build:</p>
  
  <pre><code>{projectdir}/qttest/main.cpp:6: undefined reference to `__imp__ZN12QApplicationC1ERiPPci'
  ... (1000 of these types of errors) ...
  CMakeFiles\qttest.dir\build.make:127: recipe for target 'qttest.exe' failed
  CMakeFiles\Makefile2:104: recipe for target 'CMakeFiles/qttest.dir/all' failed
  mingw32-make.exe[3]: *** [qttest.exe] Error 1
  mingw32-make.exe[2]: *** [CMakeFiles/qttest.dir/all] Error 2
  mingw32-make.exe[1]: *** [CMakeFiles/qttest.dir/rule] Error 2
  CMakeFiles\Makefile2:116: recipe for target 'CMakeFiles/qttest.dir/rule' failed
  Makefile:130: recipe for target 'qttest' failed
  mingw32-make.exe: *** [qttest] Error 2
  </code></pre>
  
  <p>I googled for a solution, and it appears that it was linking to the 32bit mingw installation of QT.  This would make sense since I'm compiling with mingw-w64, so I look for a <a href="https://stackoverflow.com/questions/25989448/implementing-qt-project-through-cmake">solution here</a>(to include qt via findpackages) to solve this issue.  This doesn't really work, so I go to find another <a href="https://stackoverflow.com/questions/12511370/how-to-include-a-certain-qt-installation-using-cmake">solution here</a>, which also happens to not work (setting enviroment variable to qmake directory).  <a href="https://stackoverflow.com/questions/38031603/setting-up-qt-for-clion">This one</a> also failed do do anything (appending path variable specifically to C:/msys64/mingw64/bin).</p>
  
  <p>Not sure what the issue is, but any help would be appreciated. </p>
  
  <p>EDIT: Current sitatuation, I feel like I've tried everything, but I foudn that when doing the following: </p>
  
  <pre><code>get_target_property(QtCore_location Qt5::Core LOCATION)
  message("qtcore location ${QtCore_location}")
  </code></pre>
  
  <p>the cmake output is actually </p>
  
  <pre><code>qtcore location C:/ProgramData/Anaconda3/Library/bin/Qt5Core.dll
  </code></pre>
  
  <p>So clearly its linking to my anaconda installation, but <em>why how do I stop it!!!</em>  It doesn't seem to want to use anything else, Anaconda appears in path but I need to keep it there. </p>