Hi,
I wanted to migrate to cmake and I was very happy following successful the
tutorial.
But now with my project I’m in trouble.
I wanted to manually write cmake files and not use generated stuff from
qtcreator.
I have several qt toolkits installed and I’m not able to select the desired
toolkit with cmake. I started with settings CMAKE_PREFIX_PATH but nothing
changed.
I have to say, that I have CMakeLists.txt opened in editor and parallel a
running cmake-gui, where I delete cache and then press “Configure” …
Next try was to setup a _DIR variable for every used package like this:
set(Qt5_DIR "/opt/qt5.15/5.15.12/gcc_64/lib/cmake/Qt5" CACHE PATH "Qt5 Root directory")
set(Qt5Core_DIR "/opt/qt5.15/5.15.12/gcc_64/lib/cmake/Qt5Core" CACHE PATH "Qt5 Core directory")
set(Qt5Widgets_DIR "/opt/qt5.15/5.15.12/gcc_64/lib/cmake/Qt5Widgets" CACHE PATH "Qt5 Widgets directory")
set(Qt5UiTools_DIR "/opt/qt5.15/5.15.12/gcc_64/lib/cmake/Qt5UiTools" CACHE PATH "Qt5 UiTools directory")
set(Qt5Sql_DIR "/opt/qt5.15/5.15.12/gcc_64/lib/cmake/Qt5Sql" CACHE PATH "Qt5 Sql directory")
set(Qt5Xml_DIR "/opt/qt5.15/5.15.12/gcc_64/lib/cmake/Qt5Xml" CACHE PATH "Qt5 Xml directory")
followed by the obvious:
find_package(Qt5Core REQUIRED CONFIG)
find_package(Qt5Widgets REQUIRED CONFIG)
find_package(Qt5UiTools REQUIRED CONFIG)
find_package(Qt5Sql REQUIRED CONFIG)
find_package(Qt5Xml REQUIRED CONFIG)
I verified the filesystem, that every searched file is at coded location.
I don’t know why, but package Qt5Sql and Qt5Xml are found, the rest is taken
from /usr/lib …
What am I missing / doing wrong?