Commit e7703643 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

HppWidgetsPlugin is compatible with Qt5

parent 7659b1d7
......@@ -29,9 +29,20 @@ SET(PROJECT_NAME "hpp-gui")
SET(PROJECT_URL "https://github.com/jmirabel/hpp-gui")
SET(PROJECT_DESCRIPTION "Graphical interface for HPP ")
SET(USE_QT4 FALSE CACHE BOOL "Use Qt4 instead of Qt5")
SETUP_PROJECT()
FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGl QtNetwork)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(USE_QT4)
FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGl QtNetwork)
ELSE(USE_QT4)
FOREACH (component "Core" "Widgets" "Gui" "OpenGL" "Concurrent" "Network")
FIND_PACKAGE ("Qt5${component}" REQUIRED)
LIST(APPEND QT_INCLUDE_DIRS ${Qt5${component}_INCLUDE_DIRS})
LIST(APPEND QT_LIBRARIES ${Qt5${component}_LIBRARIES} )
ENDFOREACH (component "Core" "Widgets" "Gui" "OpenGL" "Network")
ENDIF(USE_QT4)
ADD_REQUIRED_DEPENDENCY("gepetto-viewer-corba >= 1.3")
......
......@@ -58,12 +58,17 @@ SET(${PLUGIN_NAME}_FORMS
SET(${PLUGIN_NAME}_RESOURCES
)
QT4_WRAP_CPP(${PLUGIN_NAME}_HEADERS_MOC ${${PLUGIN_NAME}_HEADERS} OPTIONS -I${GEPETTO_VIEWER_CORBA_INCLUDEDIR})
QT4_WRAP_UI(${PLUGIN_NAME}_FORMS_HEADERS ${${PLUGIN_NAME}_FORMS})
QT4_ADD_RESOURCES(${PLUGIN_NAME}_RESOURCES_RCC ${${PLUGIN_NAME}_RESOURCES})
IF(USE_QT4)
QT4_WRAP_CPP(${PLUGIN_NAME}_HEADERS_MOC ${${PLUGIN_NAME}_HEADERS} OPTIONS -I${GEPETTO_VIEWER_CORBA_INCLUDEDIR})
QT4_WRAP_UI(${PLUGIN_NAME}_FORMS_HEADERS ${${PLUGIN_NAME}_FORMS})
QT4_ADD_RESOURCES(${PLUGIN_NAME}_RESOURCES_RCC ${${PLUGIN_NAME}_RESOURCES})
INCLUDE(${QT_USE_FILE})
ELSE(USE_QT4)
QT5_WRAP_CPP(${PLUGIN_NAME}_HEADERS_MOC ${${PLUGIN_NAME}_HEADERS} OPTIONS -I${GEPETTO_VIEWER_CORBA_INCLUDEDIR})
QT5_WRAP_UI(${PLUGIN_NAME}_FORMS_HEADERS ${${PLUGIN_NAME}_FORMS})
QT5_ADD_RESOURCES(${PLUGIN_NAME}_RESOURCES_RCC ${${PLUGIN_NAME}_RESOURCES})
ENDIF(USE_QT4)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_SHARED)
......
......@@ -549,6 +549,8 @@ namespace hpp {
return target;
}
#ifdef USE_QT4
Q_EXPORT_PLUGIN2 (hppwidgetsplugin, HppWidgetsPlugin)
#endif // USE_QT4
} // namespace gui
} // namespace hpp
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment