First, let's look at an excerpt from my CMakeLists.txt :
find_package(Qt4 4.8.0 COMPONENTS QtCore QtGui QtOpenGL REQUIRED) include(${QT_USE_FILE}) add_definitions(${QT_DEFINITIONS})
Therefore, by default, we get the following definitions in debug mode:
-DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_DLL -DQT_DEBUG
So, the first question: why are there two definitions -DQT_DLL ?
Now, if I add, for example, remove_definitions(-DQT_DEBUG) , nothing changes. In other words, the remove_definitions command is remove_definitions , or these definitions are just carved out of stone.
Then I thought, "OK, maybe the remove_definitions command is really listening, let it do it differently." And I made a list(REMOVE_ITEM QT_DEFINITIONS -DQT_DEBUG) . However, this did not work either.
Therefore, the second question: are these definitions really built-in and permanent and cannot be changed under any circumstances?
NOTE. . Despite problems with editing these built-in definitions, you can add custom definitions, for example:
add_definitions(-DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT)