]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Additional correction for pyrcc
authorvsr <vsr@opencascade.com>
Fri, 11 Oct 2013 11:51:45 +0000 (11:51 +0000)
committervsr <vsr@opencascade.com>
Fri, 11 Oct 2013 11:51:45 +0000 (11:51 +0000)
adm_local/cmake_files/FindPyQt4.cmake
adm_local/cmake_files/FindSalomePyQt4.cmake
adm_local/cmake_files/UsePyQt4.cmake

index 706197425d2026c5e82b7e4d4d16727816064163..37ff974e1f93fc9095e0c70ce548c82e7f059529 100644 (file)
@@ -1,7 +1,7 @@
 # - Find PyQt4 installation
 # Sets the following variables:
-#    PYQT_PYUIC_EXECUTABLE  - command to launch pyuic with the correct PYTHONPATH
-#    PYQT_PYUIC_PATH        - path to the pyuic executable
+#    PYQT_PYUIC_EXECUTABLE  - path to the pyuic executable
+#    PYQT_PYRCC_EXECUTABLE  - path to the pyrcc executable
 #    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,11 +43,11 @@ IF(NOT PyQt4_FIND_QUIETLY)
   MESSAGE(STATUS "Looking for PyQt4 ...")
 ENDIF()
 
-FIND_PROGRAM(PYQT_PYUIC_PATH NAMES pyuic4 pyuic4.bat)
-FIND_PROGRAM(PYQT_PYRCC_EXECUTABLE NAMES pyrcc4 pyrcc4.exe)
+FIND_PROGRAM(PYQT_PYUIC_EXECUTABLE NAMES pyuic4 pyuic4.bat)
+FIND_PROGRAM(PYQT_PYRCC_EXECUTABLE NAMES pyrcc4 pyrcc4.bat)
 
 # Get root dir locally, going up two levels from the exec:
-GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${PYQT_PYUIC_PATH}" PATH)
+GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${PYQT_PYUIC_EXECUTABLE}" PATH)
 GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
 
 # Typical locations of qobject.sip are: 
@@ -94,5 +94,5 @@ FOREACH(_dir ${PYQT_INCLUDE_DIRS})
 ENDFOREACH()
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PyQt4 REQUIRED_VARS PYQT_PYUIC_PATH PYQT_SIPS_DIR PYQT_SIPFLAGS )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PyQt4 REQUIRED_VARS PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_SIPFLAGS )
 
index b49dc38c0269851428ad263ab7bf0ce9255ac30f..390b6f6849b22256b9f0fb5cfeea04801ca5ddf6 100644 (file)
@@ -28,15 +28,19 @@ IF(NOT SalomeSIP_FOUND AND NOT SalomePyQt4_FIND_QUIETLY)
    MESSAGE(WARNING "PyQt4 needs SIP to be detected correctly!")
 ENDIF()   
 
-SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyQt4 PYQT_PYUIC_PATH 2)
-MARK_AS_ADVANCED(PYQT_PYUIC_EXECUTABLE PYQT_SIPS_DIR PYQT_PYUIC_PATH)
+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 executable so that it always uses the proper environment:
+# 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_EXECUTABLE set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYUIC_PATH})
+  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_EXECUTABLE 
-      /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYUIC_PATH})
+  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 f783dad0ba20a542d23f9111713106a20493d520..b0d00b64636849ea507bc9a3bc3a4a9a27b3e710 100644 (file)
@@ -69,7 +69,7 @@ MACRO(PYQT4_WRAP_UIC outfiles)
     SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
     ADD_CUSTOM_COMMAND(
       OUTPUT ${_output}
-      COMMAND ${PYQT_PYUIC_EXECUTABLE} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+      COMMAND ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
       MAIN_DEPENDENCY ${_input}
       )
     SET(${outfiles} ${${outfiles}} ${_output})
@@ -165,7 +165,7 @@ MACRO(PYQT4_WRAP_QRC outfiles)
     SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
     ADD_CUSTOM_COMMAND(
       OUTPUT ${_output}
-      COMMAND ${PYQT_PYRCC_EXECUTABLE} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+      COMMAND ${PYQT_PYRCC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
       MAIN_DEPENDENCY ${_input}
       )
     SET(${outfiles} ${${outfiles}} ${_output})