From 41727220e0b446d04aac2005f1a1a43a6f7948de Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 15 Jun 2014 22:22:01 +0200 Subject: [PATCH] Moved the Nel 3d widget into it's own library. --- code/studio/src/CMakeLists.txt | 1 + code/studio/src/Nel3DWidget/CMakeLists.txt | 36 +++++++++++++++++++ .../nel3d_widget.cpp | 0 .../gui_editor => Nel3DWidget}/nel3d_widget.h | 8 ++++- .../src/plugins/gui_editor/CMakeLists.txt | 2 +- .../src/plugins/gui_editor/nelgui_ctrl.cpp | 2 +- 6 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 code/studio/src/Nel3DWidget/CMakeLists.txt rename code/studio/src/{plugins/gui_editor => Nel3DWidget}/nel3d_widget.cpp (100%) rename code/studio/src/{plugins/gui_editor => Nel3DWidget}/nel3d_widget.h (92%) diff --git a/code/studio/src/CMakeLists.txt b/code/studio/src/CMakeLists.txt index 9bc071bf2..8670f516f 100644 --- a/code/studio/src/CMakeLists.txt +++ b/code/studio/src/CMakeLists.txt @@ -1,4 +1,5 @@ ADD_SUBDIRECTORY(3rdparty) +ADD_SUBDIRECTORY(Nel3DWidget) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${QT_INCLUDES}) INCLUDE( ${QT_USE_FILE} ) diff --git a/code/studio/src/Nel3DWidget/CMakeLists.txt b/code/studio/src/Nel3DWidget/CMakeLists.txt new file mode 100644 index 000000000..55b4b2a80 --- /dev/null +++ b/code/studio/src/Nel3DWidget/CMakeLists.txt @@ -0,0 +1,36 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${QT_INCLUDES} + ) + +INCLUDE( ${QT_USE_FILE} ) + +FILE(GLOB SRC *.cpp *.h) + +SET(NEL3DWIDGET_HDR + nel3d_widget.h + ) + +SET(QT_USE_QTGUI TRUE) + +QT4_WRAP_CPP( NEL3DWIDGET_MOC_SRC ${NEL3DWIDGET_HDR} ) + +SOURCE_GROUP(QtGeneratedMocSrc FILES ${NEL3DWIDGET_MOC_SRC} ) +SOURCE_GROUP("Nel 3D Widget files" FILES ${SRC}) + +ADD_LIBRARY(nel3dwidget SHARED + ${SRC} + ${NEL3DWIDGET_MOC_SRC} + ) + +TARGET_LINK_LIBRARIES( nel3dwidget + nelmisc + nel3d + ${QT_LIBRARIES} + ) + +NL_DEFAULT_PROPS(nel3dwidget "Nel3D Qt Widget") +NL_ADD_RUNTIME_FLAGS(nel3dwidget) +NL_ADD_LIB_SUFFIX(nel3dwidget) + +ADD_DEFINITIONS( -DN3DW_LIB -DQT_DLL -DQT_SHARED ${QT_DEFINITIONS} ) diff --git a/code/studio/src/plugins/gui_editor/nel3d_widget.cpp b/code/studio/src/Nel3DWidget/nel3d_widget.cpp similarity index 100% rename from code/studio/src/plugins/gui_editor/nel3d_widget.cpp rename to code/studio/src/Nel3DWidget/nel3d_widget.cpp diff --git a/code/studio/src/plugins/gui_editor/nel3d_widget.h b/code/studio/src/Nel3DWidget/nel3d_widget.h similarity index 92% rename from code/studio/src/plugins/gui_editor/nel3d_widget.h rename to code/studio/src/Nel3DWidget/nel3d_widget.h index 672fc3fde..d3e6c3ae1 100644 --- a/code/studio/src/plugins/gui_editor/nel3d_widget.h +++ b/code/studio/src/Nel3DWidget/nel3d_widget.h @@ -22,6 +22,12 @@ #include "nel/misc/types_nl.h" #include +#if defined( N3DW_LIB ) +#define N3DW_EXPORT Q_DECL_EXPORT +#else +#define N3DW_EXPORT Q_DECL_IMPORT +#endif + namespace NL3D { class UDriver; @@ -29,7 +35,7 @@ namespace NL3D } /// Nel 3D interface to Qt -class Nel3DWidget : public QWidget +class N3DW_EXPORT Nel3DWidget : public QWidget { Q_OBJECT public: diff --git a/code/studio/src/plugins/gui_editor/CMakeLists.txt b/code/studio/src/plugins/gui_editor/CMakeLists.txt index 2ea82a6e4..5adf618d0 100644 --- a/code/studio/src/plugins/gui_editor/CMakeLists.txt +++ b/code/studio/src/plugins/gui_editor/CMakeLists.txt @@ -24,7 +24,6 @@ SET(OVQT_PLUGIN_GUI_EDITOR_HDR action_editor.h property_browser_ctrl.h project_window.h - nel3d_widget.h nelgui_ctrl.h new_property_widget.h new_widget_widget.h @@ -78,6 +77,7 @@ TARGET_LINK_LIBRARIES( ${QT_QTOPENGL_LIBRARY} ${LIBXML2_LIBRARIES} qt_property_browser + nel3dwidget ) NL_DEFAULT_PROPS(studio_plugin_gui_editor "Tools: Studio Plugin: GUI Editor") diff --git a/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp index 72bb9524f..b2cf67ea2 100644 --- a/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp +++ b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp @@ -30,7 +30,7 @@ #include #include "editor_selection_watcher.h" -#include "nel3d_widget.h" +#include "../../Nel3DWidget/nel3d_widget.h" namespace GUIEditor {