Hello,
I may have found a problem in FindQt4.cmake. It may have been already
solved, in which case I apologize for generating noise on the list.
(but I've been able to find a fix with google...)
In attachement I joined a patch that fix the problem.
I use CMake 2.4.7 under Scientific Linux 5 (RHEL5 clone) and a Qt 4.3.2.
The problem shows when you uses a statically compiled Qt4.
To detect the Qt configuration file "qconfig.pri" the script runs the
command :
qmake-qt4 -query QMAKE_MKSPECS
And assumes the result is a path. But, in fact it's a colon separated
list of pathes. When there is only one path, it works, but when more
than one path is present, it fails. The solution is to iterate over
the path list in the search of qconfig.pri (see attached patch).
On my system, the test also fails for dynamic linking, but the
linking process is less strict than for static and success thus
hiding the bug.
In addition I've added the test for detecting the libraries needed when
the "glib" feature is enabled : system libraries glib-2.0 & gthread.
In the hope to be useful.
--
.-. J e a n - P a u l C h a p u t
/v\ A d m i n i s t r a t e u r S y s t e m e
/(___)\ |
^^ ^^ |-- e-mail : [EMAIL PROTECTED]
`-- Tel : (33) 01.44.27.53.99 [prof.]
06.66.25.35.55 [port.]
01.47.46.01.31 [pers.]
U P M C Universite Pierre & Marie Curie
L I P 6 Laboratoire d'Informatique de Paris VI
A S I M Architecture des Systemes Integres et Micro-electronique
--- FindQt4.cmake.orig 2008-09-08 10:54:05.000000000 +0200
+++ FindQt4.cmake 2008-09-08 10:53:19.000000000 +0200
@@ -318,6 +318,7 @@
OUTPUT_VARIABLE qt_mkspecs_dir )
SET(QT_MKSPECS_DIR ${qt_mkspecs_dir} CACHE PATH "The location of the Qt mkspecs")
ENDIF (NOT QT_MKSPECS_DIR)
+ STRING(REGEX MATCHALL "[^:]+" QT_MKSPECS_DIR_LIST ${QT_MKSPECS_DIR})
# ask qmake for the plugins directory
IF (NOT QT_PLUGINS_DIR)
@@ -870,11 +871,14 @@
# Qt configuration
#
#######################################
- IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
- FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
- STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG ${_qconfig_FILE_contents})
- STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG ${_qconfig_FILE_contents})
- ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ FOREACH(MKSPEC_PATH ${QT_MKSPECS_DIR_LIST})
+ MESSAGE(STATUS "Looking for ${MKSPEC_PATH}/qconfig.pri")
+ IF(EXISTS "${MKSPEC_PATH}/qconfig.pri")
+ FILE(READ ${MKSPEC_PATH}/qconfig.pri _qconfig_FILE_contents)
+ STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG ${_qconfig_FILE_contents})
+ STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG ${_qconfig_FILE_contents})
+ ENDIF(EXISTS "${MKSPEC_PATH}/qconfig.pri")
+ ENDFOREACH(MKSPEC_PATH ${QT_MKSPECS_DIR_LIST})
###############################################
@@ -965,6 +969,17 @@
MARK_AS_ADVANCED(QT_FONTCONFIG_LIBRARY)
ENDIF(QT_QCONFIG MATCHES "fontconfig")
+ ## glib
+ IF(QT_QCONFIG MATCHES "glib")
+ FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 glib)
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_GLIB_LIBRARY})
+ MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
+
+ FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 gthread)
+ SET(QT_GUI_LIB_DEPENDENCIES ${QT_GUI_LIB_DEPENDENCIES} ${QT_GTHREAD_LIBRARY})
+ MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
+ ENDIF(QT_QCONFIG MATCHES "glib")
+
## system-zlib
IF(QT_QCONFIG MATCHES "system-zlib")
FIND_LIBRARY(QT_ZLIB_LIBRARY NAMES z)
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake