qt5 apps support

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1103 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Matthias Möller
2014-07-17 12:57:04 +00:00
parent 71fd144089
commit 3ff415a5c2
9 changed files with 248 additions and 11 deletions

View File

@@ -41,8 +41,14 @@ if ( BUILD_APPS )
find_package (OpenGL)
find_package (GLUT)
# try to use QT5 if possible otherwise stick to QT4
set (FORCE_QT4 OFF CACHE BOOL "Use Qt4 even if Qt5 was found")
# For the apps, we need qt and opengl to build them
if (NOT QT4_FOUND)
if (NOT QT5_FOUND AND NOT FORCE_QT4)
acg_qt5 ()
endif()
if (NOT QT5_FOUND AND NOT QT4_FOUND)
find_package (Qt4 COMPONENTS QtCore QtGui )
set (QT_USE_QTOPENGL 1)
@@ -55,7 +61,8 @@ if ( BUILD_APPS )
endif()
# check for OpenGL and GLUT as our required dependencies
if (QT4_FOUND AND OPENGL_FOUND AND GLUT_FOUND AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
if ((QT5_FOUND OR QT4_FOUND) AND OPENGL_FOUND AND GLUT_FOUND AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
add_subdirectory (Decimating/DecimaterGui)
add_subdirectory (QtViewer)
add_subdirectory (Subdivider/SubdividerGui)

View File

@@ -30,7 +30,11 @@ set (sources
acg_drop_templates (sources)
# genereate uic and moc targets
acg_qt4_automoc (moc_targets ${headers})
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})

View File

@@ -40,7 +40,11 @@ list (APPEND headers "../QtViewer/MeshViewerWidgetT.hh")
acg_drop_templates (sources)
# genereate uic and moc targets
acg_qt4_automoc (moc_targets ${headers})
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})

View File

@@ -23,8 +23,13 @@ acg_append_files (ui "*.ui" ${directories})
acg_drop_templates (sources)
# genereate uic and moc targets
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
if(QT5_FOUND)
acg_qt5_autouic (uic_targets ${ui})
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)

View File

@@ -48,7 +48,7 @@
#include <OpenMesh/Core/Geometry/VectorT.hh>
#include <QtOpenGL/qgl.h>
#include <QGLWidget>
#include <string>
#include <vector>
#include <map>

View File

@@ -139,7 +139,7 @@ SubdivideWidget(QWidget* _parent, const char* _name)
QButtonGroup* buttonGroup = new QButtonGroup();
buttonGroup->setExclusive( TRUE );
buttonGroup->setExclusive( true );
// insert 2 radiobuttons
QRadioButton* radio1 = new QRadioButton( "Comp. Loop" );
@@ -149,7 +149,7 @@ SubdivideWidget(QWidget* _parent, const char* _name)
QRadioButton* radio5 = new QRadioButton( "Interpolating Sqrt3" );
QRadioButton* radio6 = new QRadioButton( "Modified Butterfly" );
// QRadioButton* radio7 = new QRadioButton( "Catmull Clark" ); // Disabled, as it needs a quad mesh!
radio3->setChecked( TRUE );
radio3->setChecked( true );
sel_topo_type = SOP_UniformLoop;
buttonGroup->addButton(radio1, SOP_UniformCompositeLoop);

View File

@@ -29,7 +29,11 @@ set (sources
acg_drop_templates (sources)
# genereate uic and moc targets
acg_qt4_automoc (moc_targets ${headers})
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})

View File

@@ -23,7 +23,11 @@ list (APPEND headers "../../QtViewer/MeshViewerWidgetT.hh")
acg_drop_templates (sources)
# genereate uic and moc targets
acg_qt4_automoc (moc_targets ${headers})
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})