From: imn Date: Thu, 26 Nov 2015 14:38:21 +0000 (+0300) Subject: Merge Qt5 porting. X-Git-Tag: V8_0_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5495fc6b8179bf51df134b0ae6178c6c8d16db95;p=modules%2Fmed.git Merge Qt5 porting. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c9609047..52675b6ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,11 @@ IF(SALOME_BUILD_GUI) ELSE(EXISTS ${GUI_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR or turn option SALOME_BUILD_GUI to OFF !") ENDIF(EXISTS ${GUI_ROOT_DIR}) - FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui) + IF(NOT SALOME_GUI_BUILD_WITH_QT5) + FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui) + ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) + ENDIF() ENDIF(SALOME_BUILD_GUI) IF(SALOME_MED_ENABLE_PYTHON) @@ -252,7 +256,6 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}") SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}") SET(MEDCOUPLING_ROOT_DIR "${MEDCOUPLING_ROOT_DIR}") -SET(QT4_ROOT_DIR "${QT4_ROOT_DIR}") SET(MPI_ROOT_DIR "${MPI_ROOT_DIR}") SET(OMNIORB_ROOT_DIR "${OMNIORB_ROOT_DIR}") SET(PTHREAD_ROOT_DIR "${PTHREAD_ROOT_DIR}") @@ -263,6 +266,11 @@ SET(CPPUNIT_ROOT_DIR "${CPPUNIT_ROOT_DIR}") SET(GRAPHVIZ_ROOT_DIR "${GRAPHVIZ_ROOT_DIR}") SET(DOXYGEN_ROOT_DIR "${DOXYGEN_ROOT_DIR}") SET(SPHINX_ROOT_DIR "${SPHINX_ROOT_DIR}") +IF(NOT SALOME_BUILD_WITH_QT5) + SET(QT_ROOT_DIR "${QT4_ROOT_DIR}") +ELSE() + SET(QT_ROOT_DIR "${QT5_ROOT_DIR}") +ENDIF() # - in the install tree: # Get the relative path of the include directory so @@ -270,14 +278,19 @@ SET(SPHINX_ROOT_DIR "${SPHINX_ROOT_DIR}") SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}") # Build variables that will be expanded when configuring SalomeConfig.cmake: -SALOME_CONFIGURE_PREPARE(MEDCoupling Qt4 MPI omniORB CppUnit Graphviz Doxygen Sphinx - PThread Python) +IF(NOT SALOME_BUILD_WITH_QT5) + SALOME_CONFIGURE_PREPARE(MEDCoupling Qt4 MPI omniORB CppUnit Graphviz Doxygen Sphinx + PThread Python) + ELSE() + SALOME_CONFIGURE_PREPARE(MEDCoupling Qt5 MPI omniORB CppUnit Graphviz Doxygen Sphinx + PThread Python) +ENDIF() CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX - KERNEL_ROOT_DIR GUI_ROOT_DIR MEDCOUPLING_ROOT_DIR QT4_ROOT_DIR MPI_ROOT_DIR + KERNEL_ROOT_DIR GUI_ROOT_DIR MEDCOUPLING_ROOT_DIR QT_ROOT_DIR MPI_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR SWIG_ROOT_DIR PYTHON_ROOT_DIR CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR SPHINX_ROOT_DIR) diff --git a/src/MEDCalc/gui/CMakeLists.txt b/src/MEDCalc/gui/CMakeLists.txt index 69e62ba23..aec534ad0 100644 --- a/src/MEDCalc/gui/CMakeLists.txt +++ b/src/MEDCalc/gui/CMakeLists.txt @@ -18,9 +18,8 @@ # ADD_DEFINITIONS(${MEDFILE_DEFINITIONS} ${XDR_DEFINITIONS} ${OMNIORB_DEFINITIONS}) -INCLUDE(${QT_USE_FILE}) SET(QT_LIBS "${QT_LIBRARIES}") -INCLUDE(UseQt4Ext) +INCLUDE(UseQtExt) ADD_SUBDIRECTORY(dialogs) @@ -36,8 +35,8 @@ SET(MEDCALCGUI_SOURCES ) SET(MEDCALCGUI_HEADERS MEDModule.hxx MEDEventListener_i.hxx WorkspaceController.hxx DatasourceController.hxx) +QT_WRAP_MOC(MEDCALCGUI_HEADERS_MOC ${MEDCALCGUI_HEADERS}) -QT4_WRAP_CPP(MEDCALCGUI_HEADERS_MOC ${MEDCALCGUI_HEADERS}) INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS} @@ -95,7 +94,7 @@ ENDIF(WITH_MEDMEMGUI) TARGET_LINK_LIBRARIES(MEDCALCGUI ${COMMON_FLAGS}) INSTALL(TARGETS MEDCALCGUI DESTINATION ${SALOME_INSTALL_LIBS}) -QT4_INSTALL_TS_RESOURCES("${MEDCALCGUITS_SOURCES}" "${SALOME_MED_INSTALL_RES_DATA}") +QT_INSTALL_TS_RESOURCES("${MEDCALCGUITS_SOURCES}" "${SALOME_MED_INSTALL_RES_DATA}") FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/MEDCalc/gui/dialogs/CMakeLists.txt b/src/MEDCalc/gui/dialogs/CMakeLists.txt index 3a49dfd8b..732d72d0f 100644 --- a/src/MEDCalc/gui/dialogs/CMakeLists.txt +++ b/src/MEDCalc/gui/dialogs/CMakeLists.txt @@ -19,7 +19,7 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -INCLUDE(UseQt4Ext) +INCLUDE(UseQtExt) SET(MEDCALCGUI_dialogs_FORMS GenericDialog.ui @@ -29,7 +29,7 @@ SET(MEDCALCGUI_dialogs_FORMS DlgInterpolateField.ui DlgImageToMed.ui ) -QT4_WRAP_UI(MEDCALCGUI_dialogs_FORMS_HEADERS ${MEDCALCGUI_dialogs_FORMS}) +QT_WRAP_UIC(MEDCALCGUI_dialogs_FORMS_HEADERS ${MEDCALCGUI_dialogs_FORMS}) SET(MEDCALCGUI_dialogs_FILES GenericDialog.hxx @@ -39,7 +39,7 @@ SET(MEDCALCGUI_dialogs_FILES DlgInterpolateField.hxx DlgImageToMed.hxx ) -QT4_WRAP_CPP(MEDCALCGUI_dialogs_HEADERS_MOC ${MEDCALCGUI_dialogs_FILES}) +QT_WRAP_MOC(MEDCALCGUI_dialogs_HEADERS_MOC ${MEDCALCGUI_dialogs_FILES}) INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS} @@ -47,7 +47,6 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${GUI_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${QT4_INCLUDE_DIRECTORY} ) SET(MEDCALCGUI_dialogs_SOURCES diff --git a/src/MEDGUI/CMakeLists.txt b/src/MEDGUI/CMakeLists.txt index f23692244..7049df7c5 100644 --- a/src/MEDGUI/CMakeLists.txt +++ b/src/MEDGUI/CMakeLists.txt @@ -19,8 +19,7 @@ ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${XDR_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS}) -INCLUDE(${QT_USE_FILE}) -INCLUDE(UseQt4Ext) +INCLUDE(UseQtExt) SET(MEDGUI_SOURCES MEDGUIFileContentDial.cxx @@ -33,9 +32,9 @@ SET(MEDGUI_HEADERS MEDGUIFileContentDial.h MEDGUISelectComponents.h) SET(MEDGUI_FORMS MEDGUIFileContentDial.ui MEDGUISelectComponents.ui) #SET(MEDGUI_RESOURCES images.qrc) -QT4_WRAP_CPP(MEDGUI_HEADERS_MOC ${MEDGUI_HEADERS}) -QT4_WRAP_UI(MEDGUI_FORMS_HEADERS ${MEDGUI_FORMS}) -#QT4_ADD_RESOURCES(MEDGUI_RESOURCES_RCC ${MEDGUI_RESOURCES}) +QT_WRAP_MOC(MEDGUI_HEADERS_MOC ${MEDGUI_HEADERS}) +QT_WRAP_UIC(MEDGUI_FORMS_HEADERS ${MEDGUI_FORMS}) +#QT_ADD_RESOURCES(MEDGUI_RESOURCES_RCC ${MEDGUI_RESOURCES}) INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS} @@ -59,4 +58,4 @@ SET(MEDGUITS_SOURCES ADD_LIBRARY(MEDGUI SHARED ${MEDGUI_SOURCES} ${MEDGUI_HEADERS_MOC} ${MEDGUI_FORMS_HEADERS}) TARGET_LINK_LIBRARIES(MEDGUI medcalculator ${QT_MT_LIBS} ${CAS_KERNEL} ${BOOST_LIBRARIES} ${GUI_LDFLAGS} ${SalomeApp} ${CAM} ${LightApp} ${qtx} ${suit} ${SalomeObject} ${PLATFORM_LIBS} ${SalomeLifeCycleCORBA}) INSTALL(TARGETS MEDGUI DESTINATION ${SALOME_INSTALL_LIBS}) -QT4_INSTALL_TS_RESOURCES("${MEDGUITS_SOURCES}" "${SALOME_MED_INSTALL_RES_DATA}") +QT_INSTALL_TS_RESOURCES("${MEDGUITS_SOURCES}" "${SALOME_MED_INSTALL_RES_DATA}")