Cannot surpress QDebug output in relesae build
08:08 25 Mar 2022

I work on a Qt project and I use cmake. In my CMakeLists.txt I have:

target_compile_definitions(${PROJECT_NAME} PUBLIC
        QT_DEBUG_NO_OUTPUT
        QT_NO_INFO_OUTPUT
        QT_NO_WARNING_OUTPUT
        )

and to test that in my main.cpp I have:

#ifndef NDEBUG
    qDebug() << "QDEBUG IS ACTIVE!";
    std::cout << "Compiled in DEBUG\n";
#else
    qDebug() << "QDEBUG IS ACTIVE!";
    std::cout << "Compiled in RELEASE\n";
#endif

Does not matter if I compile in Release or Debug configuration, the line "QDEBUG IS ACTIVE!" gets printed.

P.S. I get correct cout for release and debug, so the configurations are working!

What am I doing wrong?

c++ qt cmake qt-creator qdebug