Unsolved Can not set QTSDK DIRs within QTCreator
-
What value do you have for the CMake variable
CMAKE_PREFIX_PATH
?Otherwise CMake has the
--debug-find
which prints information about thefind_package
calls and the locations where it looks for packages. -
@sierdzio It is already autorecognised, I think the problem comes from cmake setting.
-
@cristian-adam HI,
Thanks for your answer.
I set it here:
In QtCreator parameters.
Regards,
Emmanuel -
For the
CMAKE_PREFIX_PATH
you only need the path withoutlib/cmake
since CMake is adding that automagically, see https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedureYou can set
CMAKE_IGNORE_PATH
to/usr/x86_64-linux-gnu/
but that might not find other CMake packages in the system.CMake's
--debug-find
is your friend here, you can find out what CMake is doing by analyzing the output. -
@cristian-adam said in Can not set QTSDK DIRs within QTCreator:
/usr/x86_64-linux-gn
Thanks a lot for your help. I will have time on wednesday to work furthur on my problem and will let you posted of my progress.
Emmanuel -
Hi,
When running in command line, everything is fine:
CMake Debug Log at /home/charruau/Qt5_15_2/5.15.2/gcc_64/lib/cmake/Qt5Network/Qt5NetworkConfig.cmake:99 (find_package):
/home/charruau/Qt5_15_2/5.15.2/gcc_64/lib/cmake/Qt5Core/Qt5CoreConfig.cmakeCall Stack (most recent call first):
/home/charruau/Qt5_15_2/5.15.2/gcc_64/lib/cmake/Qt5Qml/Qt5QmlConfig.cmake:99 (find_package)
/home/charruau/Qt5_15_2/5.15.2/gcc_64/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
CMakeLists.txt:102 (find_package)It is pointing to the right libs.
I am still not able to do the same within QTCreator :(
QTCreator is still point at libs within /usr !
-
You can import a console build in Qt Creator, and use that configuration.
But Qt Creator when it configures a project does the same thing that you would do from command line. A clean build or "Re-configure with initial parameters" should fix the issue.
-
Just a note, since this is a behavior that I myself regularly stumble over:
If you have an existing build, with an existing CMakeCache.txt, and that detected a framework like Qt but a version that you didn't want, if just change the CMAKE_PREFIX_PATH to something else and re-run CMake, it will not re-detect the framework with the new cmake prefix path. It already found the framework, so it doesn't re-detect. You have to remove the CMakeCache.txt first, then call CMake with the new CMAKE_PREFIX_PATH to force it to re-detect the different version.
-
@ziller I removed the CMakeCache.txt.
Somehow now it is compiling, but I can not know what I did.
But I am quite sure I need still to resolve the following problem.
All my qt dirs
are pointing to the distro files.
I would like them to be my qt sdk one, example:
/home/charruau/Qt5_15_2/5.15.2/gcc_64/lib/cmake/Qt5Core/ for QT5_Core.
How do you do to do this?
My cmake_prefix_path is pointing to the right place.
cmake_install_prefix is not doing anything.
Thanks in advance -
I can only assume that you have a Kit that doesn't have the Qt SDK selected as the Qt version and you configure with an empty
CMAKE_PREFIX_PATH
and then CMake picks up your system Qt.Then you tried changing the
CMAKE_PREFIX_PATH
in the Current configuration and not the Initial Configuration, but that only changes theCMAKE_PREFIX_PATH
cache variable and not all theQt5*_DIR
cache variables.I have made a screencast showcasing this case: https://bugreports.qt.io/secure/attachment/128619/QtCreator-7.0.2-Linux-system-vs-qtsdk.mp4
Make sure that your Kit contains the right Qt version and / or that you change the Initial Configuration value of
CMAKE_PREFIX_PATH
.