]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Changes SIP/PyQt check procedures:
authorvsr <vsr@opencascade.com>
Tue, 15 Oct 2013 07:23:41 +0000 (07:23 +0000)
committervsr <vsr@opencascade.com>
Tue, 15 Oct 2013 07:23:41 +0000 (07:23 +0000)
- all variables related to PyQt4 are set in FindPyQt4
- FindSalomePyQt4 automatically calls FindSalomeSIP

adm_local/cmake_files/FindPyQt4.cmake
adm_local/cmake_files/FindSalomePyQt4.cmake

index 37ff974e1f93fc9095e0c70ce548c82e7f059529..a7f0349ac12cec383932eab086b56d836c555145 100644 (file)
@@ -2,6 +2,8 @@
 # Sets the following variables:
 #    PYQT_PYUIC_EXECUTABLE  - path to the pyuic executable
 #    PYQT_PYRCC_EXECUTABLE  - path to the pyrcc executable
+#    PYQT_PYUIC_PATH        - command to launch pyuic with the correct PYTHONPATH
+#    PYQT_PYRCC_PATH        - command to launch pyrcc with the correct PYTHONPATH
 #    PYQT_PYTHONPATH        - path to the PyQt Python modules
 #    PYQT_SIPS_DIR          - path to main include directory (which contains several sub folders)
 #    PYQT_INCLUDE_DIRS      - list of paths to include when compiling (all rooted on PYQT_SIP_DIRS)
@@ -43,6 +45,10 @@ IF(NOT PyQt4_FIND_QUIETLY)
   MESSAGE(STATUS "Looking for PyQt4 ...")
 ENDIF()
 
+IF(NOT SIP_FOUND AND NOT PyQt4_FIND_QUIETLY)
+   MESSAGE(WARNING "PyQt4 needs SIP to be detected correctly!")
+ENDIF()
+
 FIND_PROGRAM(PYQT_PYUIC_EXECUTABLE NAMES pyuic4 pyuic4.bat)
 FIND_PROGRAM(PYQT_PYRCC_EXECUTABLE NAMES pyrcc4 pyrcc4.bat)
 
@@ -96,3 +102,16 @@ ENDFOREACH()
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PyQt4 REQUIRED_VARS PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_SIPFLAGS )
 
+# Wrap the final executables so that they always use the proper environment (PYTHONPATH):
+# The results are put to variables:
+#   PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH
+#   PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH
+# TODO: should be done like Sphinx in KERNEL (i.e. generating a shell script)?
+IF(WIN32 AND NOT CYGWIN)
+  MESSAGE(WARNING "PyQt4 command was not tested under Win32")
+  SET(PYQT_PYUIC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYUIC_EXECUTABLE})
+  SET(PYQT_PYRCC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYRCC_EXECUTABLE})
+ELSE()
+  SET(PYQT_PYUIC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYUIC_EXECUTABLE})
+  SET(PYQT_PYRCC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYRCC_EXECUTABLE})
+ENDIF()
index 390b6f6849b22256b9f0fb5cfeea04801ca5ddf6..279bcbc54851be3b248e5720b4f4e611d7745d6e 100644 (file)
 #  !! Please read the generic detection procedure in SalomeMacros.cmake !!
 #
 
-IF(NOT SalomeSIP_FOUND AND NOT SalomePyQt4_FIND_QUIETLY)
-   MESSAGE(WARNING "PyQt4 needs SIP to be detected correctly!")
-ENDIF()   
+# PyQt needs SIP, call it automatically
+FIND_PACKAGE(SalomeSIP REQUIRED)
 
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyQt4 PYQT_PYUIC_EXECUTABLE 2)
 MARK_AS_ADVANCED(PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_PYUIC_PATH PYQT_PYRCC_PATH)
-
-# Wrap the final executables so that they always use the proper environment (PYTHONPATH):
-# The results are put to variables:
-#   PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH
-#   PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH
-# TODO: should be done like Sphinx in KERNEL (i.e. generating a shell script)?
-IF(WIN32 AND NOT CYGWIN)
-  MESSAGE(WARNING "PyQt4 command was not tested under Win32")
-  SET(PYQT_PYUIC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYUIC_EXECUTABLE})
-  SET(PYQT_PYRCC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYRCC_EXECUTABLE})
-ELSE()
-  SET(PYQT_PYUIC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYUIC_EXECUTABLE})
-  SET(PYQT_PYRCC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYRCC_EXECUTABLE})
-ENDIF()