1 # Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 FIND_PROGRAM(SIP_EXECUTABLE sip)
22 SET(SIP_ROOT ${SIP_EXECUTABLE})
24 GET_FILENAME_COMPONENT(SIP_ROOT ${SIP_ROOT} PATH)
25 GET_FILENAME_COMPONENT(SIP_ROOT ${SIP_ROOT} PATH)
28 SET(SIP_INCLUDES -I${SIP_ROOT}/include/python${PYTHON_VERSION}) # to be removed
29 SET(SIP_INCLUDE_DIRS ${SIP_ROOT}/include/python${PYTHON_VERSION})
31 SET(SIP_INCLUDES ${SIP_INCLUDES} -I${SIP_ROOT}/include) # to be removed
32 SET(SIP_INCLUDE_DIRS ${SIP_INCLUDE_DIRS} ${SIP_ROOT}/include)
36 FIND_PROGRAM(PYUIC_EXECUTABLE NAMES pyuic4 pyuic4.bat)
38 FIND_PROGRAM(PYUIC_EXECUTABLE NAMES pyuic4)
41 SET(PYUIC_ROOT ${PYUIC_EXECUTABLE})
43 GET_FILENAME_COMPONENT(PYUIC_ROOT ${PYUIC_ROOT} PATH)
44 GET_FILENAME_COMPONENT(PYUIC_ROOT ${PYUIC_ROOT} PATH)
47 SET(PYQT_SIPS $ENV{PYQT_SIPS})
50 SET(PYQT_SIPS ${PYUIC_ROOT}/sip)
52 IF(PYUIC_ROOT STREQUAL /usr)
53 SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip/PyQt4)
54 ELSE(PYUIC_ROOT STREQUAL /usr)
55 SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip)
56 ENDIF(PYUIC_ROOT STREQUAL /usr)
60 SET(PYQT_INCLUDES -I${PYQT_SIPS})
61 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtCore -I${PYQT_SIPS}/QtGui)
62 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtXml -I${PYQT_SIPS}/QtOpenGL)
63 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtAssistant -I${PYQT_SIPS}/QtDesigner)
64 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtNetwork -I${PYQT_SIPS}/QtSql)
65 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtSvg -I${PYQT_SIPS}/QtTest)
68 COMMAND ${PYTHON_EXECUTABLE} -c "import re, PyQt4.pyqtconfig ; s = PyQt4.pyqtconfig.Configuration().pyqt_sip_flags ; print s;"
69 OUTPUT_VARIABLE COMPILE_FLAGS
70 OUTPUT_STRIP_TRAILING_WHITESPACE
72 string(REPLACE " " ";" FLAGS_LIST ${COMPILE_FLAGS})
73 FOREACH(FLG ${FLAGS_LIST})
74 SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${FLG})
75 ENDFOREACH(FLG ${FLAGS_LIST})
77 SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} -s .cc -c . )
78 SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${PYQT_INCLUDES} )