Debug configuration missing error
-
I have been getting the following error:
error: No "Debug" CMake configuration found. Available configuration: "Release". Make sure that CMAKE_BUILD_TYPE variable matches the "Build type" field.
And my initial CMake parameters are:
-GNinja -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake -DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} -DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} -DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
I honestly don't know what the problem is. The
Release
type works fine.Update
I am using Conan cmake tool, removing or keeping does not make any difference
-
@akshaybabloo said in Debug configuration missing error:
I honestly don't know what the problem is. The Release type works fine.
Same issue for me, for some of the projects, though in the different way -
Debug
works, butRelease
does not :)CMakee 3.18.4 on Debian 10 Buster,
Qt Creator 6.0.1,
Qt 5.15.7 and Qt 5.13.2 -
Could you resolve it? I'm having the same problem as @akshaybabloo, I've tried everything without success, this is making me crazy.
EDIT: SOLVED IT!! @akshaybabloo and @Talkless, check your CMakeLists.txt file, the one in the base of your project; there you must have a line saying
set(CMAKE_BUILD_TYPE Release)
Just surround it with if's, just like this
if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif()
Now everything works as expected.
-
Hi, I had the same problem i.e. the cmake configuration issue.
How I need to solve the issues(just follow the image)
How I need to build and debug with the STM32 Boards?
-
根本原因是Qt Creator不保存CMAKE变量CMAKE_BUILD_TYPE,该变量一直保持着第一次设置的值。所以,当我们切换构建类型时需要改变该变量为当前构建类型,手动修改该变量或者点击用初始参数重新配置。
设置完记得Run CMake
-
@chenqichen please write in english or use the appropriate subforum for your language.