ERROR IN THE QTCREATOR, RELATED TO CMAKE AUTO SETUP CONFIG
-
Hello,
I've encountered a very strange bug or whatever it might be called. When I create a new Qt widget or Qt console or any project in Qt-creator, the cmake initialization gives me the following errors,
[cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/Asus/Projects/untitled4 -B C:/Users/Asus/Projects/untitled4/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug in C:\Users\Asus\Projects\untitled4\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug. [cmake] CMake Error at CMakeLists.txt:3 (project): [cmake] project could not find requested file: [cmake] [cmake] C:/Users/Asus/Projects/untitled4/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake [cmake] [cmake] [cmake] CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/FindThreads.cmake:66 (message): [cmake] FindThreads only works if either C or CXX language is enabled [cmake] Call Stack (most recent call first): [cmake] C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package) [cmake] C:/Qt/6.7.3/msvc2019_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency) [cmake] C:/Qt/6.7.3/msvc2019_64/lib/cmake/Qt6/Qt6Dependencies.cmake:27 (_qt_internal_find_third_party_dependencies) [cmake] C:/Qt/6.7.3/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake:124 (include) [cmake] CMakeLists.txt:12 (find_package) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] [cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/Asus/Projects/untitled4 -B C:/Users/Asus/Projects/untitled4/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug" terminated with exit code 1. [cmake] [cmake] Elapsed time: 00:00.However, when I Unset the
CMAKE_PROJECT_INCLUDE_BEFOREvariable from the current configuration, the error disappears. I have already uninstalled and reinstalled Qt several times. How can I delete this variable from the current configuration by default, so that I don't have to unset it every time I create a project in QT?Regards
-
Hello,
I've encountered a very strange bug or whatever it might be called. When I create a new Qt widget or Qt console or any project in Qt-creator, the cmake initialization gives me the following errors,
[cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/Asus/Projects/untitled4 -B C:/Users/Asus/Projects/untitled4/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug in C:\Users\Asus\Projects\untitled4\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug. [cmake] CMake Error at CMakeLists.txt:3 (project): [cmake] project could not find requested file: [cmake] [cmake] C:/Users/Asus/Projects/untitled4/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake [cmake] [cmake] [cmake] CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/FindThreads.cmake:66 (message): [cmake] FindThreads only works if either C or CXX language is enabled [cmake] Call Stack (most recent call first): [cmake] C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package) [cmake] C:/Qt/6.7.3/msvc2019_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency) [cmake] C:/Qt/6.7.3/msvc2019_64/lib/cmake/Qt6/Qt6Dependencies.cmake:27 (_qt_internal_find_third_party_dependencies) [cmake] C:/Qt/6.7.3/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake:124 (include) [cmake] CMakeLists.txt:12 (find_package) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] [cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/Asus/Projects/untitled4 -B C:/Users/Asus/Projects/untitled4/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug" terminated with exit code 1. [cmake] [cmake] Elapsed time: 00:00.However, when I Unset the
CMAKE_PROJECT_INCLUDE_BEFOREvariable from the current configuration, the error disappears. I have already uninstalled and reinstalled Qt several times. How can I delete this variable from the current configuration by default, so that I don't have to unset it every time I create a project in QT?Regards
@Amirreza-Taghizadeh Go to Qt Creator > Preferences > CMake > General and unselect Package manager auto setup.
Your project has two errors:
- project could not find requested file:
C:/Users/Asus/Projects/untitled4/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake - CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/FindThreads.cmake:66 (message):
FindThreads only works if either C or CXX language is enabled
The first error is due to the missing
.qtc/package-manager/auto-setup.cmakewhich should be copied by Qt Creator before running CMake to configure your project.The second error, is weird, as if your project doesn't have the C and CXX languages declared.
How does your
project()function call atCMakeLists.txt:3looks like? - project could not find requested file: