QT_${basename}_LIBRARY

Peter Kümmel syntheticpp at gmx.net
Thu May 18 15:53:33 CEST 2006


Is there any reason why in FindQt4.cmake originally the
QT_${basename}_LIBRARY variable is not set with the
optimized/debug specifiers, like the
QT_${basename}_LIBRARIES  variable?

previous FindQt4.cmake:
IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
   SET(QT_${basename}_LIBRARY         ${QT_${basename}_LIBRARY_RELEASE})
   SET(QT_${basename}_LIBRARIES       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)


Because QT_${basename}_LIBRARY is always the release
library the debug/msvc projects link against the wrong version.

The current IF(CMAKE_BUILD_TYPE MATCHES Debug) solution
does not work when cmake generates msvc ide-project files.

Means: could I apply following patch?

Index: modules/FindQt4.cmake
===================================================================
--- modules/FindQt4.cmake       (Revision 542114)
+++ modules/FindQt4.cmake       (Arbeitskopie)
@@ -598,13 +598,8 @@
       ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)

       IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
-        IF(CMAKE_BUILD_TYPE MATCHES Debug)
-          SET(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_DEBUG})
-          SET(QT_${basename}_LIBRARIES     ${QT_${basename}_LIBRARY_DEBUG})
-        ELSE(CMAKE_BUILD_TYPE MATCHES Debug)
-          SET(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE})
-          SET(QT_${basename}_LIBRARIES    optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
-        ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
+         SET(QT_${basename}_LIBRARY       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+         SET(QT_${basename}_LIBRARIES     ${QT_${basename}_LIBRARY})
       ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)


This patch equals QT_${basename}_LIBRARY  and  QT_${basename}_LIBRARIES.

Peter


More information about the Kde-buildsystem mailing list