title: Ubuntu CMake what path to add to CMAKE_MODULE_PATH
body: <p>My OS is Ubuntu. I would like to change from QT4 to QT5 in my project. The native package though is 4.x version in Ubuntu right now.</p>
  
  <p>I have downloaded the Linux installer from QT homepage and installed QT5.4  under <code>/opt/Qt/5.4/</code></p>
  
  <p>This path is not found by </p>
  
  <pre><code>find_package (Qt5 REQUIRED)
  </code></pre>
  
  <p>I tried adding </p>
  
  <pre><code>set(CMAKE_MODULE_PATH "/opt/QT/5.4;${CMAKE_MODULE_PATH}")
  </code></pre>
  
  <p>to my <code>CMAKELIST.txt</code> but that does not help. </p>
  
  <p>Where do I have to link, or am I using the wrong syntax?</p>
  
  <p>Some edits after hint with calling: </p>
  
  <pre><code> cmake -DCMAKE_PREFIX_PATH=/opt/QT/5.4/gcc_64/ ../src/
  </code></pre>
  
  <p>I also have deleted the CMAKE_MODULE_PATH variable.
  I still get the same error:</p>
  
  <pre><code> CMake Error at CMakeLists.txt:3 (find_package):
   Found package configuration file:
   /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake
   but it set Qt5_FOUND to FALSE so package "Qt5" is considered to be NOT
   FOUND.  Reason given by package:
  
   The Qt5 package requires at least one component
  </code></pre>
  
  <p>I dont know why this is happening after reading <a href="https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it" rel="nofollow noreferrer">https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it</a>
  <a href="http://foo.com" rel="nofollow noreferrer"></a>. There it is stated, that the path will be searched before the default search directories. The path I used seems to be right now:</p>
  
  <pre><code>/opt/QT/5.4/gcc_64/
  </code></pre>
  
  <p>Adding subfolder gcc_64 must be right, as this subfolder has "lib", "include" ect as subfolders. </p>
  
  <p>I remeber that I have called also</p>
  
  <pre><code>sudo apt-get install QT5-default 
  </code></pre>
  
  <p>some time ago. This did not help, I needed the installer from QT. Although I removed qt5-default again to prevent cmake from finding the wrong package configuration file, the same error appears. </p>
  
  <p>See discussion below, moved to here:
  <a href="https://stackoverflow.com/questions/28252909/cmake-and-qt5-include-only-takes-one-argument">Cmake and QT5 - Include only takes one argument</a></p>