From: barate Date: Thu, 14 Feb 2013 17:02:18 +0000 (+0000) Subject: Find correct PyQt Sip flags from PyQT configuration with CMake X-Git-Tag: V6_main_FINAL~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=56f2f37f90c2f54ddf0bb401616d703895201542;p=modules%2Fgui.git Find correct PyQt Sip flags from PyQT configuration with CMake --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d121cbe66..5df173487 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,9 +287,16 @@ if(EXISTS ${PYQT_ROOT_DIR}) set(CMAKE_PROGRAM_PATH ${PYQT_ROOT_DIR}/bin) endif(EXISTS ${PYQT_ROOT_DIR}) FIND_PROGRAM(PYQT_PYUIC_EXECUTABLE NAMES pyuic4 pyuic4.bat) -FIND_PATH(PYQT_SIPS_DIR NAMES QtCore QtGui QtXml QtOpenGL QtAssistant QtDesigner QtNetwork QtSql QtSvg QtTest HINTS /usr/share/sip/PyQt4) -SET(PYQT_SIPFLAGS -s .cc -c . -t Qt_${QT_VERSION_MAJOR}_${QT_VERSION_MINOR}_${QT_VERSION_PATCH} -t WS_X11 - -I ${PYQT_SIPS_DIR} +FIND_PATH(PYQT_SIPS_DIR NAMES QtCore QtGui QtXml QtOpenGL QtAssistant QtDesigner QtNetwork QtSql QtSvg QtTest HINTS /usr/share/sip/PyQt4) +SET(PYQT_PYTHONPATH "") +if(EXISTS ${PYQT_ROOT_DIR}) + set(PYQT_PYTHONPATH ${PYQT_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) +endif(EXISTS ${PYQT_ROOT_DIR}) +EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.path[:0] = ['${PYQT_PYTHONPATH}']; from PyQt4 import pyqtconfig; sys.stdout.write(pyqtconfig.Configuration().pyqt_sip_flags)" + OUTPUT_VARIABLE PYQT_SIPFLAGS) +SEPARATE_ARGUMENTS(PYQT_SIPFLAGS) +SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} -s .cc -c . + -I ${PYQT_SIPS_DIR} -I ${PYQT_SIPS_DIR}/QtCore -I ${PYQT_SIPS_DIR}/QtGui -I ${PYQT_SIPS_DIR}/QtXml -I ${PYQT_SIPS_DIR}/QtOpenGL -I ${PYQT_SIPS_DIR}/QtAssistant -I ${PYQT_SIPS_DIR}/QtDesigner -I ${PYQT_SIPS_DIR}/QtNetwork -I ${PYQT_SIPS_DIR}/QtSql -I ${PYQT_SIPS_DIR}/QtSvg -I ${PYQT_SIPS_DIR}/QtTest )