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, but Release 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.


Log in to reply