CMake does not work with Qt 6.7.0
-
@odelaune run command
locate Qt6CoreConfigureFileTemplate.in
to check where it is. It is located under
/home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core
Check your path and lib settings for 6.7.0 since you have a local installation.I just tested a cmake build with Qt 6.7.0 and did not see any issue.
-
The
locate
command tells me that the file is located in /home/user/Qt/online/6.7.0/gcc_64/lib/cmake/Qt6Core (as expected). I also checked my $PATH and my $LD_LIBRARY_PATH. I did not see anything weird (everything is similar with Qt 6.6.3 that works fine). -
I installed a fresh Ubuntu 22.04.4 LTS and then installed QT 6.7.1 from Qt Maintenance. Qt is installed in my home and I added this location to the $PATH environment variable. Yet, I get exactly the same error
CMake Error: File /Qt6CoreConfigureFileTemplate.in does not exist.
-
Hi,
You should not alter your PATH environnement variable.
What if you use the
qt-cmake
wrapper from your Qt installation ? -
Here is my
.bash_aliases
export QT=$HOME/Qt/6.7.1/gcc_64 export LD_LIBRARY_PATH=$QT/lib:$LD_LIBRARY_PATH
And, then I simply try to run
cmake
like this (in the build directory as a subdirectory of the folder where sources are located):~/Qt/6.7.1/gcc_64/bin/qt-cmake ..
Yet, still the same CMake error.
Same result with the "system" cmake. -
Can you try with 6.7.0 ?
Beside that, don't change LD_LIBRARY_PATH like that. You don't want your system to try and load your development Qt libraries in place of the ones provided by your distribution.
-
@SGaist said in CMake does not work with Qt 6.7.0:
Can you try with 6.7.0 ?
I get the same error with Qt 6.7.0, but not with Qt 6.6.x...
Beside that, don't change LD_LIBRARY_PATH like that. You don't want your system to try and load your development Qt libraries in place of the ones provided by your distribution.
How should I change the LD_LIBRARY_PATH? Is there a better way to inform the system where to find the Qt libraries?
-
@odelaune said in CMake does not work with Qt 6.7.0:
Is there a better way to inform the system where to find the Qt libraries?
There is no need for that, You executable contains the information where the Qt libs are, as long as they are still there your application will work. See https://en.wikipedia.org/wiki/Rpath
-
Someone has the same problem as me here. So there is indeed an issue with Qt 6.7.x. It will be fixed in the 6.7.3 release.
Meanwhile, I fixed the problem moving
find_package(Qt6 COMPONENTS LinguistTools Widgets REQUIRED)
to the root directory's CMakeLists.txt.
-