MantisBT - CMake
View Issue Details
0007123CMakeModulespublic2008-05-29 14:142008-06-10 22:24
tanguy_k 
Clinton Stimpson 
normalminoralways
closedno change required 
CMake-2-6 
 
0007123: QT_DEBUG define should be moved from UseQt4.cmake to FindQt4.cmake
I noticed that QT_DEBUG and QT_NO_DEBUG are quite important flags.

In the case of Phonon backends, it was impossible to load a backend (== a Qt plugin) compiled with MinGW without QT_DEBUG/QT_NO_DEBUG being defined.
This issue was detected only with MinGW, it worked fine with MSVC and Linux/GCC. Once the flags QT_DEBUG/QT_NO_DEBUG were added, the problem was solved.
This typically a kind of issue very difficult to solve, who thinks about a define not there when it works using other compilers/OS?

For the full story about how the problem was detected: http://groups.google.com/group/phonon-vlc-mplayer/browse_thread/thread/334efdff70fab22f [^]

How can other people not get into QT_DEBUG/QT_NO_DEBUG issue:
- QT_DEBUG/QT_NO_DEBUG are defined inside UseQt4.cmake
- a lot of libraries/apps only use FindQt4.cmake without using UseQt4.cmake

The solution I propose is to move QT_DEBUG/QT_NO_DEBUG definitions to FindQt4.cmake in order to prevent this.

Patch attached
No tags attached.
diff FindQt4_QT_DEBUG.diff (1,834) 2008-05-29 14:14
https://public.kitware.com/Bug/file/1510/FindQt4_QT_DEBUG.diff
Issue History
2008-05-29 14:14tanguy_kNew Issue
2008-05-29 14:14tanguy_kFile Added: FindQt4_QT_DEBUG.diff
2008-06-06 11:11Bill HoffmanStatusnew => assigned
2008-06-06 11:11Bill HoffmanAssigned To => Clinton Stimpson
2008-06-10 22:24Clinton StimpsonStatusassigned => closed
2008-06-10 22:24Clinton StimpsonNote Added: 0012314
2008-06-10 22:24Clinton StimpsonResolutionopen => no change required

Notes
(0012314)
Clinton Stimpson   
2008-06-10 22:24   
There's no way to properly put it in the FindQt4.cmake and without adding an extra burden on the user.

Using the UseQt4.cmake is the best way to go.
Or, just copy the few lines that set QT_NO_DEBUG/QT_DEBUG in UseQt4.cmake into your own CMakeLists.txt file.