From: TMA Salome Date: Tue, 23 Feb 2016 14:51:32 +0000 (+0100) Subject: MAJ des CMakeLists pour Qt5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ff2e6894faa923a974e3a7a71cb3060d285b9134;p=tools%2Feficas.git MAJ des CMakeLists pour Qt5 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bed3fb8b..43a5c347 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,37 +44,38 @@ 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 PyQt4 -if (NOT PYQT4_FOUND) - execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\"import PyQt4\"" +# Detection de QT5 +find_package (Qt5Core) +find_package (Qt5Gui) +#include( ${QT_USE_FILE} ) + +# 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 ) diff --git a/UiQT4/CMakeLists.txt b/UiQT4/CMakeLists.txt index bd331262..79bbd9ee 100644 --- a/UiQT4/CMakeLists.txt +++ b/UiQT4/CMakeLists.txt @@ -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}" )