diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2009-09-22 03:07:44 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2009-09-22 03:07:44 (GMT) |
commit | ad5a455bb576c52a3e7ad55af797c25d8ebf9147 (patch) | |
tree | 8cedfd078af2b2c01f3a0311e76ee13bdcb99236 | |
parent | bc7989020595208d4f932b52135ff1f67d88f51d (diff) | |
download | CMake-ad5a455bb576c52a3e7ad55af797c25d8ebf9147.zip CMake-ad5a455bb576c52a3e7ad55af797c25d8ebf9147.tar.gz CMake-ad5a455bb576c52a3e7ad55af797c25d8ebf9147.tar.bz2 |
Fix issue 9581. Qt 4.5+ needs gobject-2.0.
-rw-r--r-- | Modules/FindQt4.cmake | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 8326c9b..c63f1a9 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1544,6 +1544,33 @@ IF (QT4_QMAKE_FOUND) ${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY}) ENDIF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY) + + # Qt 4.5+ also links to gobject-2.0 + IF(QT_VERSION_MINOR GREATER 4) + IF(NOT QT_GOBJECT_LIBRARY) + EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L gobject-2.0 + OUTPUT_VARIABLE _glib_query_output + RESULT_VARIABLE _glib_result + ERROR_VARIABLE _glib_query_output ) + + IF(_glib_result MATCHES 0) + STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}") + SEPARATE_ARGUMENTS(_glib_query_output) + ELSE(_glib_result MATCHES 0) + SET(_glib_query_output) + ENDIF(_glib_result MATCHES 0) + + FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} ) + + MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY) + ENDIF(NOT QT_GOBJECT_LIBRARY) + + IF(QT_GOBJECT_LIBRARY) + SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} + ${QT_GOBJECT_LIBRARY}) + ENDIF(QT_GOBJECT_LIBRARY) + ENDIF(QT_VERSION_MINOR GREATER 4) + ENDIF(QT_QCONFIG MATCHES "glib") ## clock-monotonic, just see if we need to link with rt |