Commit b2b687b2 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'Enable_autouic' into 'master'

Enable autouic

See merge request OpenFlipper-Free/OpenFlipper!123
parents 549bde32 09829c8b
......@@ -80,9 +80,6 @@ acg_append_files (ui "*.ui" ${directories})
# remove template cc files from source file list
acg_drop_templates (sources)
# genereate uic targets
acg_qt5_autouic (uic_targets ${ui})
set(RC_SRC "")
if ( EXISTS ${BRANDING_DIRECTORY}/branding.qrc )
......@@ -114,14 +111,14 @@ RECURSE_GROUPS( ${CMAKE_CURRENT_SOURCE_DIR}/../../ )
if (WIN32)
# add app icon rc file to windows build
acg_add_executable (${OPENFLIPPER_PRODUCT_STRING} WIN32 ${CMAKE_CURRENT_SOURCE_DIR}/CoreApp.rc ${uic_targets} ${sources} ${headers} ${RC_SRC})
acg_add_executable (${OPENFLIPPER_PRODUCT_STRING} WIN32 ${CMAKE_CURRENT_SOURCE_DIR}/CoreApp.rc ${ui} ${sources} ${headers} ${RC_SRC})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (${OPENFLIPPER_PRODUCT_STRING} ${QT_QTMAIN_LIBRARY})
elseif (APPLE)
# generate bundle on mac
acg_add_executable (${OPENFLIPPER_PRODUCT_STRING} MACOSX_BUNDLE ${uic_targets} ${sources} ${headers} ${RC_SRC})
acg_add_executable (${OPENFLIPPER_PRODUCT_STRING} MACOSX_BUNDLE ${ui} ${sources} ${headers} ${RC_SRC})
else ()
acg_add_executable (${OPENFLIPPER_PRODUCT_STRING} ${uic_targets} ${sources} ${headers} ${RC_SRC})
acg_add_executable (${OPENFLIPPER_PRODUCT_STRING} ${ui} ${sources} ${headers} ${RC_SRC})
endif ()
# Mark this build part as building OpenFlippers Core
......
......@@ -5,6 +5,7 @@
- <b>Breaking changes</b>
- Picking functions use size_t instead of unsigned int now (Required to get rid of a lot of warnings during compilation)
- Enabled AUTOMOC in cmake for QT ( If you get redefinition errors, guard the corresponding headers with a #pragma once ; If you get gl.h before glew.h errors, move your widgets not using OpenGL into a subdir and add that to the DIRS macro in your CMakeLists.txt)
- Enabled AUTOUIC in cmake for QT ( If you get trouble finding generated ui_*.hh headers, change your include to ui_*.h to get them generated correctly)
- Removed a lot of Scenegraph includes in BaseObjectData to reduce gl qt collisions and replaced them with forward declarations. (You have to include the scenegraph headers yourself now!)
- Removed a lot of unnecessary large QT includes from the Interfaces (Mostly QtWidgets). You have to add your own include statements in your plugins now.
- Removed WhatsThisGenerator include from BaseInterface. You have to include it in the plugins now if you use it.
......
......@@ -142,22 +142,13 @@ endforeach ()
# remove template cc files from source file list
acg_drop_templates (sources)
#=======================================================
# Moc/UIC handling
#=======================================================
# genereate uic and moc targets
if (QT5_FOUND)
acg_qt5_autouic (uic_targets ${ui})
endif ()
#=======================================================
# Create library
#=======================================================
RECURSE_GROUPS( ${CMAKE_CURRENT_SOURCE_DIR}/../../ )
if (QT5_FOUND)
acg_add_library (OpenFlipperPluginLib SHARED ${uic_targets} ${sources} ${headers} )
acg_add_library (OpenFlipperPluginLib SHARED ${ui} ${sources} ${headers} )
endif ()
......
......@@ -153,38 +153,6 @@ macro (acg_qt5)
endif ()
endmacro ()
# generate uic targets for sources in list
macro (acg_qt5_autouic uic_SRCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
if ( EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
get_filename_component (_basename ${_current_FILE} NAME_WE)
string (REGEX REPLACE "Ui$" "" _cbasename ${_basename})
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.hh)
set (_header ${_basename}.hh)
set (_source ${_abs_PATH}/${_cbasename}.cc)
add_custom_command (OUTPUT ${_outfile}
COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
MAIN_DEPENDENCY ${_abs_FILE} VERBATIM)
add_file_dependencies (${_source} ${_outfile})
set (${uic_SRCS} ${${uic_SRCS}} ${_outfile})
endif ()
endforeach ()
endmacro ()
# generate qrc targets for sources in list
macro (acg_qt5_autoqrc qrc_SRCS)
......
......@@ -58,8 +58,9 @@ endif()
# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/OpenFlipper/cmake)
# Enable automoc
# Enable automoc and autouic
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
......
......@@ -373,10 +373,7 @@ macro (_plugin_licensemanagement)
acg_append_files (keygen_src "*.cc" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen")
acg_append_files (keygen_ui "*.ui" "${CMAKE_SOURCE_DIR}/OpenFlipper/LicenseManager/keyGen")
# genereate uic targets
acg_qt5_autouic (keygen_uic ${keygen_ui})
add_executable (Plugin-${plugin}-keygen ${keygen_uic} ${keygen_hdr} ${keygen_src})
add_executable (Plugin-${plugin}-keygen ${keygen_ui} ${keygen_hdr} ${keygen_src})
target_link_libraries (
Plugin-${plugin}-keygen
......@@ -642,12 +639,11 @@ function (_build_openflipper_plugin plugin)
add_definitions(${${_PLUGIN}_TYPE_DEFINITIONS})
# genereate uic targets
acg_qt5_autouic (uic_targets ${ui})
# genereate qrc targets
acg_qt5_autoqrc (qrc_targets ${qrc})
add_library (Plugin-${plugin} MODULE ${uic_targets} ${sources} ${headers} ${qrc_targets} ${${_PLUGIN}_ADDSRC})
add_library (Plugin-${plugin} MODULE ${ui} ${sources} ${headers} ${qrc_targets} ${${_PLUGIN}_ADDSRC})
#group projects by parent folder name on MSVC (used for e.g. plugincollection)
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
get_filename_component(PARENT_DIR_NAME "${PARENT_DIR}" NAME)
......@@ -657,7 +653,7 @@ function (_build_openflipper_plugin plugin)
acg_set (OPENFLIPPER_${_PLUGIN}_BUILD "1")
if (STATIC_PLUGIN_${_PLUGIN})
add_library (Plugin-Static-${plugin} STATIC ${uic_targets} ${sources} ${headers} ${qrc_targets} ${${_PLUGIN}_ADDSRC})
add_library (Plugin-Static-${plugin} STATIC ${ui} ${sources} ${headers} ${qrc_targets} ${${_PLUGIN}_ADDSRC})
set_target_properties(Plugin-Static-${plugin} PROPERTIES COMPILE_DEFINITIONS "QT_STATICPLUGIN")
get_target_property(PLUGIN_OUTPUT_FILENAME Plugin-${plugin} LOCATION)
get_filename_component(PLUGIN_OUTPUT_FILENAME "${PLUGIN_OUTPUT_FILENAME}" NAME)
......
......@@ -41,7 +41,6 @@ endif ()
acg_append_files_recursive (headers "*.hh" . )
acg_append_files_recursive (sources "*.cc" . )
acg_append_files_recursive (ui "*.ui" . )
acg_qt5_autouic (uic_targets ${ui})
# Match our current directory name
......@@ -62,9 +61,22 @@ include_directories (
# remove template cc files from source file list
acg_drop_templates (sources)
acg_add_library ( ${TYPENAME} SHARED ${uic_targets} ${sources} ${headers})
acg_add_library ( ${TYPENAME} SHARED ${ui} ${sources} ${headers})
set_target_properties ( ${TYPENAME} PROPERTIES MACOSX_RPATH 0 )
if ( NOT WIN32 )
# Allow targets depending on ACG find the autogenerated header files
target_include_directories( ${TYPENAME} PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include )
else()
# Allow targets depending on the current type find the autogenerated header files from uic
target_include_directories( ${TYPENAME} PUBLIC
$<$<CONFIG:Debug>:${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include_Debug/>
$<$<CONFIG:Release>:${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include_Release/> )
endif()
add_dependencies( ${TYPENAME} OpenMeshCore OpenMeshTools ACG OpenFlipperPluginLib)
......
......@@ -115,13 +115,12 @@ acg_drop_templates (sources)
# genereate uic and moc targets
if (QT5_FOUND)
acg_qt5_autouic (uic_targets ${ui})
acg_qt5_autoqrc (qrc_targets ${qrc})
endif()
if (QT5_FOUND)
acg_add_library (ACG SHARED ${uic_targets} ${sources} ${headers} ${qrc_targets})
acg_add_library (ACG SHARED ${ui} ${sources} ${headers} ${qrc_targets})
endif()
if ( NOT WIN32 )
......@@ -138,6 +137,17 @@ acg_print_configure_header (ACG "ACG")
RECURSE_GROUPS( ${CMAKE_CURRENT_SOURCE_DIR} )
if ( NOT WIN32 )
# Allow targets depending on ACG find the autogenerated header files
target_include_directories( ACG PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include )
else()
# Allow targets depending on ACG find the autogenerated header files
target_include_directories( ACG PUBLIC
$<$<CONFIG:Debug>:${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include_Debug/>
$<$<CONFIG:Release>:${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include_Release/> )
endif()
target_link_libraries ( ACG ${OPENMESH_LIBRARIES}
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
......
......@@ -63,7 +63,7 @@
//== INCLUDES =================================================================
#include "ui_QtClippingDialogUi.hh"
#include "ui_QtClippingDialogUi.h"
#include "../Config/ACGDefines.hh"
#include <QDialog>
......
......@@ -63,7 +63,7 @@
//== INCLUDES =================================================================
#include "ui_QtCoordFrameDialogUi.hh"
#include "ui_QtCoordFrameDialogUi.h"
#include "../Math/VectorT.hh"
#include <vector>
......
......@@ -39,15 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Author$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
......@@ -58,10 +49,13 @@
//== INCLUDES =================================================================
#include "QtMaterialDialog.hh"
#include "../Scenegraph/MaterialNode.hh"
//== NAMESPACES ==============================================================
......
......@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Author$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// CLASS QtMaterialDialog
......@@ -56,14 +46,13 @@
//=============================================================================
#ifndef ACG_QTMATERIALDIALOG_HH
#define ACG_QTMATERIALDIALOG_HH
#pragma once
//== INCLUDES =================================================================
#include "ui_QtMaterialDialogUi.hh"
#include "ui_QtMaterialDialogUi.h"
#include "../Math/VectorT.hh"
#include "../GL/gl.hh"
......@@ -199,6 +188,4 @@ private:
} // namespace QtWidgets
} // namespace ACG
//=============================================================================
#endif // ACG_QTMATERIALDIALOG_HH defined
//=============================================================================
......@@ -54,7 +54,7 @@
// qmake users have to include
#include "ui_QtPrincipalAxisDialogBaseUi.hh"
#include "ui_QtPrincipalAxisDialogBaseUi.h"
// ACGMake users have to include
// #include "QtPrincipalAxisDialogBaseUi.hh"
......
......@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Author$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// CLASS QtSceneGraphWidget - IMPLEMENTATION
......@@ -71,6 +61,8 @@
#include "../Scenegraph/ShaderNode.hh"
#include "../Scenegraph/CoordFrameNode.hh"
#include "ui_QtMaterialDialogUi.h"
#include <stdint.h>
......
......@@ -63,7 +63,7 @@
//== INCLUDES =================================================================
#include "ui_QtShaderDialogUi.hh"
#include "ui_QtShaderDialogUi.h"
#include "../Config/ACGDefines.hh"
#include <QColor>
......
......@@ -63,7 +63,7 @@
//== INCLUDES =================================================================
#include "ui_QtTextureDialogUi.hh"
#include "ui_QtTextureDialogUi.h"
#include "../Math/VectorT.hh"
#include "../GL/gl.hh"
......
......@@ -45,6 +45,9 @@
#include "PluginDialog.hh"
#include <QMessageBox>
#include <QMenu>
const QColor PluginDialog::blockColor_ = QColor(228, 155, 18);
const QColor PluginDialog::unloadColor_ = QColor(172, 172, 172);
const QColor PluginDialog::loadedBuiltInColor_ = QColor(208, 240, 192);
......
......@@ -41,10 +41,8 @@
#include "ui_pluginDialog.hh"
#include "ui_pluginDialog.h"
#include <QtWidgets>
#include <OpenFlipper/Core/PluginInfo.hh>
class PluginDialog : public QDialog, public Ui::PluginDialog
......
......@@ -47,6 +47,8 @@
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QKeyEvent>
AboutWidget::AboutWidget(QWidget *parent )
: QMainWindow(parent)
{
......
......@@ -43,10 +43,7 @@
#pragma once
#include "ui_aboutWidget.hh"
#include <QtWidgets>
#include "ui_aboutWidget.h"
class AboutWidget : public QMainWindow, public Ui::AboutWidget
......
......@@ -39,19 +39,11 @@
* *
\*===========================================================================*/
#ifndef ADDEMPTYWIDGET_HH
#define ADDEMPTYWIDGET_HH
#pragma once
#include <OpenFlipper/common/Types.hh>
#include "ui_addEmpty.hh"
#include <QtWidgets>
#include "ui_addEmpty.h"
class addEmptyWidget : public QDialog, public Ui::addEmpty
{
......@@ -69,4 +61,3 @@ class addEmptyWidget : public QDialog, public Ui::addEmpty
void slotAddEmpty();
};
#endif
......@@ -41,20 +41,10 @@
/*
* helpWidget.hh
*
* Created on: Apr 7, 2009
* Author: kremer
*/
#ifndef HELPWIDGET_HH_
#define HELPWIDGET_HH_
#include "ui_helpWidget.hh"
#include <QtWidgets>
#include "ui_helpWidget.h"
#include <QtHelp>
#include <QTextDocument>
......
......@@ -47,6 +47,7 @@
#include "optionsWidget.hh"
#include <iostream>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QMessageBox>
void OptionsWidget::startDownload( QString _url ) {
QUrl url(_url);
......
......@@ -44,6 +44,7 @@
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include "optionsWidget.hh"
#include <QMessageBox>
/// get the pluginInfo object corresponding to the given pluginName
int OptionsWidget::getPluginInfo(QString pluginName){
......
......@@ -50,6 +50,9 @@
#include <ACG/GL/ShaderCache.hh>
#include "optionsWidget.hh"
#include <QColorDialog>
#include <QOpenGLContext>
#include <QMessageBox>
OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyBinding>& _core, InverseKeyMap& _invKeys, QWidget *parent)
: QWidget(parent),
......
......@@ -50,9 +50,7 @@
#include <OpenFlipper/Core/PluginInfo.hh>
#include <ACG/Scenegraph/DrawModes.hh>
#include "ui_optionsWidget.hh"
#include <QtWidgets>
#include "ui_optionsWidget.h"
#include <QStringList>
#include <QProgressDialog>
......
......@@ -41,13 +41,11 @@
#pragma once
#include "ui_postProcessorWidget.hh"
#include "ui_postProcessorWidget.h"
#include <vector>
#include <QDialog>
#include <QPoint>
#include <QStringList>
class QWidget;
class QFrame;
class PostProcessorInfo;
......
......@@ -45,6 +45,8 @@
#include "processManagerWidget.hh"
#include <QLabel>
class BlockingWidget : public QWidget {
Q_OBJECT
......
......@@ -43,16 +43,10 @@
#pragma once
/*
* processManagerWidget.hh
*
* Created on: Apr 7, 2009
* Author: kremer
*/
#include "ui_processManagerWidget.hh"
#include <QtWidgets>
#include "ui_processManagerWidget.h"
#include <QPushButton>
#include <QProgressBar>
// A button class that additionally stores
// an attached job's id.
......
......@@ -42,13 +42,14 @@
#pragma once
#include "ui_rendererObjectWidget.hh"
#include <QDialog>
#include "ui_rendererObjectWidget.h"
#include <OpenFlipper/common/RendererInfo.hh>
#include "renderObjectHighLighter.hh"
#include "TextBrowserWidget.hh"
#include <QDialog>
class RendererObjectWidget : public QDialog, public Ui::RendererObjectWidget
{
Q_OBJECT
......
......@@ -41,11 +41,11 @@
#pragma once
#include "ui_rendererWidget.hh"
#include <QDialog>
#include "ui_rendererWidget.h"
#include <QVector>
#include <QLabel>
#include <QFrame>
#include <QDialog>
#include <OpenFlipper/common/RendererInfo.hh>
......
......@@ -44,6 +44,9 @@
#include "SnapshotDialog.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QMessageBox>
#include <QFileDialog>
SnapshotDialog::SnapshotDialog(QString _suggest, bool _captureViewers, int _w, int _h, QWidget *parent)
: QDialog(parent),
captureViewers_(_captureViewers),
......
......@@ -41,9 +41,7 @@
#include "ui_SnapshotDialog.hh"
#include <QtWidgets>
#include "ui_SnapshotDialog.h"
class SnapshotDialog : public QDialog, public Ui::SnapshotDialog
{
......
......@@ -43,17 +43,8 @@
#pragma once
/*
* stereoSettingsWidget.hh
*
* Created on: Nov 9, 2009
* Author: kremer
*/
#include "ui_stereoSettingsWidget.hh"
#include <QtWidgets>
#include "ui_stereoSettingsWidget.h"
class StereoSettingsWidget : public QWidget, public Ui::StereoSettingsWidget
......
......@@ -43,6 +43,8 @@
#include "VideoCaptureDialog.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QMessageBox>
#include <QFileDialog>
VideoCaptureDialog::VideoCaptureDialog(QWidget *parent) : QDialog(parent)
{
......
......@@ -41,10 +41,7 @@
#include "ui_VideoCaptureDialog.hh"
#include <QtWidgets>
#include "ui_VideoCaptureDialog.h"
class VideoCaptureDialog : public QDialog, public Ui::VideoCaptureDialog
{
......
......@@ -39,19 +39,12 @@
* *
\*===========================================================================*/
#pragma once
#include "ui_viewModeChange.h"
#ifndef VIEWMODECHANGEWIDGET_HH
#define VIEWMODECHANGEWIDGET_HH
#include "ui_viewModeChange.hh"
#include <QStringList>
#include <QVector>
#include <QWidgetAction>
struct ViewMode;
class viewModeChangeWidget : public QWidget, public Ui::ViewModeChangeDialog
......@@ -85,4 +78,3 @@ class viewModeChangeWidget : public QWidget, public Ui::ViewModeChangeDialog
};
#endif //VIEWMODECHANGEWIDGET_HH
......@@ -39,17 +39,9 @@
* *
\*===========================================================================*/
#pragma once
#ifndef VIEWMODEWIDGET_HH
#define VIEWMODEWIDGET_HH
#include "ui_viewMode.hh"
#include <QStringList>
#include <QVector>
#include "ui_viewMode.h"
struct ViewMode;
......@@ -260,4 +252,3 @@ class viewModeWidget : public QDialog, public Ui::viewMode
};
#endif //VIEWMODEWIDGET_HH
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