]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
Qt5 fix for Eficas tool.
authortma <tma.edf@opencascade.com>
Tue, 5 Jul 2016 09:45:37 +0000 (11:45 +0200)
committertma <tma.edf@opencascade.com>
Tue, 5 Jul 2016 09:45:37 +0000 (11:45 +0200)
CMakeLists.txt
UiQT5/CMakeLists.txt
UiQT5/eficas_en.qm [deleted file]
UiQT5/eficas_fr.qm [deleted file]

index 136a1442a1c33b0d86233d26b38e67acb485d0a9..d85efc0eedb2b980b4ea15593f735b74a49a1dca 100644 (file)
@@ -44,37 +44,40 @@ print '%d.%d' % ( sys.version_info[0], sys.version_info[1] )
   file ( REMOVE ${tmpPyScript} )
 endif (PYTHONINTERP_FOUND)
 message ( STATUS "Using Python version ${PYTHON_VERSION}" )
-# Detection de QT4
-find_package ( Qt4 COMPONENTS QtCore QtGui REQUIRED )
-include( ${QT_USE_FILE} )
+# Detection de QT5
+find_package ( Qt5 COMPONENTS Core REQUIRED )
 
-# Detection de PyQt4
-if (NOT PYQT4_FOUND)
-  execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\"import PyQt4\""
+FIND_PACKAGE(Qt5LinguistTools)
+GET_TARGET_PROPERTY(QT_LRELEASE_EXECUTABLE Qt5::lrelease LOCATION)
+MARK_AS_ADVANCED(QT_LRELEASE_EXECUTABLE)
+
+# Detection de PyQt5
+if (NOT PYQT5_FOUND)
+  execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\"import PyQt5\""
                     RESULT_VARIABLE _res
                    OUTPUT_VARIABLE _trashout
                    ERROR_VARIABLE  _trasherr
                   )
   if (NOT _res)
-    message ( STATUS "Looking for Python package PyQt4 - found" )
-    set ( PYQT4_FOUND 1 CACHE INTERNAL "True if Python package PyQt4 is here" )
+    message ( STATUS "Looking for Python package PyQt5 - found" )
+    set ( PYQT5_FOUND 1 CACHE INTERNAL "True if Python package PyQt5 is here" )
   else (NOT _res)
-    message ( STATUS "Looking for Python package PyQt4 - not found" )
-    set ( PYQT4_FOUND 0 CACHE INTERNAL "True if Python package PyQt4 is here" )
+    message ( STATUS "Looking for Python package PyQt5 - not found" )
+    set ( PYQT5_FOUND 0 CACHE INTERNAL "True if Python package PyQt5 is here" )
   endif (NOT _res)
-endif (NOT PYQT4_FOUND)
+endif (NOT PYQT5_FOUND)
 
-if (NOT PYQT4_FOUND)
-  message ( FATAL_ERROR "Python package PyQt4 is REQUIRED" )
-endif (NOT PYQT4_FOUND)
+if (NOT PYQT5_FOUND)
+  message ( FATAL_ERROR "Python package PyQt5 is REQUIRED" )
+endif (NOT PYQT5_FOUND)
 
-# Detection de pyuic4
-find_program ( PYUIC4 NAMES pyuic4
-               DOC  "Path to the pyuic4 compilation tool"
+# Detection de PYUIC5
+find_program ( PYUIC5 NAMES pyuic5
+               DOC  "Path to the pyuic5 compilation tool"
              )
-if (NOT PYUIC4)
-  message ( FATAL_ERROR "pyuic4 tool is REQUIRED" )
-endif (NOT PYUIC4)
+if (NOT PYUIC5)
+  message ( FATAL_ERROR "pyuic5 tool is REQUIRED" )
+endif (NOT PYUIC5)
 
 # Definition des options de CMake
 option ( WITH_ALL_PACKAGES "Install all package files" OFF )
@@ -154,7 +157,7 @@ add_subdirectory ( Extensions )
 add_subdirectory ( Ihm )
 install ( DIRECTORY InterfaceQT4 DESTINATION ${CMAKE_INSTALL_PREFIX} )
 add_subdirectory ( Noyau )
-add_subdirectory ( UiQT4 )
+add_subdirectory ( UiQT5 )
 add_subdirectory ( Validation )
 add_subdirectory ( convert )
 add_subdirectory ( generator )
index 48ed0f90411d36739e16c715b0db178d2f27acf5..c2af2c8c55e6156e87c5a30bfe8c4cc864e18565 100644 (file)
@@ -24,7 +24,7 @@ macro ( eficas_compile_ui uifile )
   get_filename_component ( _file_we ${uifile} NAME_WE )
   set ( _pyfile "${_file_we}.py" )
   add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_pyfile}
-                       COMMAND ${PYUIC4} ARGS -x -o ${CMAKE_CURRENT_BINARY_DIR}/${_pyfile} ${CMAKE_CURRENT_SOURCE_DIR}/${uifile}
+                       COMMAND ${PYUIC5} ARGS -x -o ${CMAKE_CURRENT_BINARY_DIR}/${_pyfile} ${CMAKE_CURRENT_SOURCE_DIR}/${uifile}
                        MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${uifile}
                        COMMENT "Compiling ${uifile}"
                      )
@@ -84,7 +84,7 @@ add_custom_target ( CompileUI ALL DEPENDS ${_PYFILES}
                   )
 
 install ( FILES ${_PYFILES}
-          DESTINATION ${CMAKE_INSTALL_PREFIX}/UiQT4
+          DESTINATION ${CMAKE_INSTALL_PREFIX}/UiQT5
         )
 
 # Rules to compile TS files
@@ -98,11 +98,12 @@ FOREACH(input ${TSFILES})
   SET(QMFILES ${QMFILES} ${output})
   ADD_CUSTOM_COMMAND(OUTPUT ${output}
     COMMAND ${QT_LRELEASE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${input} -qm ${output}
+    #    EXECUTE_PROCESS(COMMAND \${MYLRELEASE} \${MYTSFILE} -qm \${MYFULLDIR}/\${MYOUTQMFILE})
     MAIN_DEPENDENCY ${input})
 ENDFOREACH(input ${TSFILES})
 
 ADD_CUSTOM_TARGET(CompileTS ALL DEPENDS ${QMFILES})
-INSTALL(FILES ${QMFILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/UiQT4)
+INSTALL(FILES ${QMFILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/UiQT5)
 
 ### Local Variables:
 ### mode: cmake
diff --git a/UiQT5/eficas_en.qm b/UiQT5/eficas_en.qm
deleted file mode 100644 (file)
index 885409e..0000000
Binary files a/UiQT5/eficas_en.qm and /dev/null differ
diff --git a/UiQT5/eficas_fr.qm b/UiQT5/eficas_fr.qm
deleted file mode 100644 (file)
index 9bfe425..0000000
Binary files a/UiQT5/eficas_fr.qm and /dev/null differ