]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Retrieve correct Qt version for PyQt sip flags
authorvsr <vsr@opencascade.com>
Tue, 15 Feb 2011 11:51:52 +0000 (11:51 +0000)
committervsr <vsr@opencascade.com>
Tue, 15 Feb 2011 11:51:52 +0000 (11:51 +0000)
adm_local/cmake_files/FindSIPPYQT.cmake

index 448e6a980dd3ea956c24894b99b856fd92b3e315..15cdb6319d6027fc6dfdc4b67aeac69394f23234 100644 (file)
@@ -63,11 +63,7 @@ SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtAssistant -I${PYQT_SIPS}/QtD
 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtNetwork -I${PYQT_SIPS}/QtSql)
 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtSvg -I${PYQT_SIPS}/QtTest)
 
-file(READ ${PYQT_SIPS}/QtCore/QtCoremod.sip SUPPORTED)
-STRING(REGEX MATCH "Qt_[0-9]_[0-9]_[0-9]}" SUPPORTED ${SUPPORTED})
-STRING(LENGTH ${SUPPORTED} len)
-MATH(EXPR len "${len}-1")
-STRING(SUBSTRING ${SUPPORTED} 0 ${len} SUPPORTED)
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re, pyqtconfig; s=pyqtconfig.Configuration().pyqt_sip_flags;m=re.search('(Qt_[0-9_]+)',s);print m.group(1)" OUTPUT_VARIABLE SUPPORTED)
 
 IF(WINDOWS)
   SET(ws_flag WS_WIN)