diff options
| author | Alexander Neundorf <neundorf@kde.org> | 2009-12-23 15:04:04 +0000 | 
|---|---|---|
| committer | Alexander Neundorf <neundorf@kde.org> | 2009-12-23 15:04:04 +0000 | 
| commit | cb44bade9b0d2ee0eaf730e782ed67592e464234 (patch) | |
| tree | 0f6a80701f64d34e187db3b5eae0cdce513aec6e | |
| parent | 701ce8260d794ed1f8b86782603f923e9afa1e0a (diff) | |
| download | extra-cmake-modules-cb44bade9b0d2ee0eaf730e782ed67592e464234.tar.gz extra-cmake-modules-cb44bade9b0d2ee0eaf730e782ed67592e464234.tar.bz2 | |
-handle the case that release- as well as debug-version have been found first, because otherwise we always run into this branch (because the release-only and debug-only branches set both variables)
Alex
svn path=/trunk/KDE/kdelibs/; revision=1065525
| -rw-r--r-- | modules/FindQt4.cmake | 28 | 
1 files changed, 15 insertions, 13 deletions
| diff --git a/modules/FindQt4.cmake b/modules/FindQt4.cmake index 91712888..864828f8 100644 --- a/modules/FindQt4.cmake +++ b/modules/FindQt4.cmake @@ -894,6 +894,20 @@ IF (QT4_QMAKE_FOUND)    MACRO (_QT4_ADJUST_LIB_VARS basename)      IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) +      # if the release- as well as the debug-version of the library have been found: +      IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) +        # if the generator supports configuration types then set +        # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value +        IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) +          SET(QT_${basename}_LIBRARY       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) +        ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) +          # if there are no configuration types and CMAKE_BUILD_TYPE has no value +          # then just use the release libraries +          SET(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE} ) +        ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) +        SET(QT_${basename}_LIBRARIES       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) +      ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) +        # if only the release version was found, set the debug variable also to the release version        IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)          SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE}) @@ -908,19 +922,7 @@ IF (QT4_QMAKE_FOUND)          SET(QT_${basename}_LIBRARIES       ${QT_${basename}_LIBRARY_DEBUG})        ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) -      IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) -        # if the generator supports configuration types then set -        # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value -        IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) -          SET(QT_${basename}_LIBRARY       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) -        ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) -          # if there are no configuration types and CMAKE_BUILD_TYPE has no value -          # then just use the release libraries -          SET(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE} ) -        ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) -        SET(QT_${basename}_LIBRARIES       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) -      ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) - +      # put the value in the cache:        SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)        IF (QT_${basename}_LIBRARY) | 
