From 7ff8de34f73c73592017ef0f0093198dd84b7e0f Mon Sep 17 00:00:00 2001 From: Sean Yen Date: Thu, 7 Feb 2019 23:00:39 -0800 Subject: [PATCH 1/3] add missing DLL exports. --- .../interactive_markers/interactive_marker.h | 14 +++++- src/rviz/display.h | 3 +- src/rviz/display_group.h | 3 +- .../frame_position_tracking_view_controller.h | 3 +- src/rviz/image/image_display_base.h | 3 +- src/rviz/message_filter_display.h | 3 +- src/rviz/ogre_helpers/axes.h | 3 +- src/rviz/ogre_helpers/object.h | 4 +- src/rviz/ogre_helpers/render_system.h | 4 +- src/rviz/panel.h | 3 +- src/rviz/panel_dock_widget.h | 3 +- src/rviz/properties/bool_property.h | 3 +- src/rviz/properties/property.h | 3 +- src/rviz/properties/property_tree_widget.h | 3 +- src/rviz/properties/ros_topic_property.h | 3 +- src/rviz/properties/tf_frame_property.h | 3 +- src/rviz/properties/vector_property.h | 3 +- src/rviz/rviz_macros.h | 45 +++++++++++++++++++ src/rviz/selection/selection_handler.h | 3 +- src/rviz/selection/selection_manager.h | 3 +- src/rviz/tool.h | 3 +- src/rviz/tool_manager.h | 3 +- src/rviz/view_controller.h | 3 +- src/rviz/view_manager.h | 3 +- src/rviz/visualization_frame.h | 3 +- src/rviz/visualization_manager.h | 3 +- src/rviz/visualizer_app.h | 3 +- 27 files changed, 110 insertions(+), 26 deletions(-) create mode 100644 src/rviz/rviz_macros.h diff --git a/src/rviz/default_plugin/interactive_markers/interactive_marker.h b/src/rviz/default_plugin/interactive_markers/interactive_marker.h index fc0e858b1a..8e1fd34677 100644 --- a/src/rviz/default_plugin/interactive_markers/interactive_marker.h +++ b/src/rviz/default_plugin/interactive_markers/interactive_marker.h @@ -30,6 +30,18 @@ #ifndef RVIZ_INTERACTIVE_MARKER_H_ #define RVIZ_INTERACTIVE_MARKER_H_ +// Import/export for windows dll's and visibility for gcc shared libraries. + +#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries + #ifdef rviz_default_plugin_EXPORTS // we are building a shared lib/dll + #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_EXPORT + #else // we are using shared lib/dll + #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_IMPORT + #endif +#else // ros is being built around static libraries + #define RVIZ_DEFAULT_PLUGIN_DECL +#endif + #ifndef Q_MOC_RUN #include #include @@ -64,7 +76,7 @@ namespace rviz class DisplayContext; class InteractiveMarkerDisplay; -class InteractiveMarker : public QObject +class RVIZ_DEFAULT_PLUGIN_DECL InteractiveMarker : public QObject { Q_OBJECT public: diff --git a/src/rviz/display.h b/src/rviz/display.h index c17ae5cca0..4265bef807 100644 --- a/src/rviz/display.h +++ b/src/rviz/display.h @@ -37,6 +37,7 @@ #include "rviz/properties/status_property.h" #include "rviz/properties/bool_property.h" +#include "rviz/rviz_macros.h" #include #include @@ -60,7 +61,7 @@ class StatusList; class DisplayContext; class PanelDockWidget; -class Display: public BoolProperty +class RVIZ_DECL Display: public BoolProperty { Q_OBJECT public: diff --git a/src/rviz/display_group.h b/src/rviz/display_group.h index 2edb336b4c..40aa3bcc5a 100644 --- a/src/rviz/display_group.h +++ b/src/rviz/display_group.h @@ -30,6 +30,7 @@ #define DISPLAY_GROUP_H #include "display.h" +#include "rviz/rviz_macros.h" namespace rviz { @@ -44,7 +45,7 @@ class DisplayFactory; * Property superclass stores the non-Display properties and this * class stores the Display objects in a separate list. The * separation is enforced in addChild(). */ -class DisplayGroup: public Display +class RVIZ_DECL DisplayGroup: public Display { Q_OBJECT public: diff --git a/src/rviz/frame_position_tracking_view_controller.h b/src/rviz/frame_position_tracking_view_controller.h index 5fdfc9433a..2b1d74b5f5 100644 --- a/src/rviz/frame_position_tracking_view_controller.h +++ b/src/rviz/frame_position_tracking_view_controller.h @@ -34,6 +34,7 @@ #include #include "rviz/view_controller.h" +#include "rviz/rviz_macros.h" namespace rviz { @@ -42,7 +43,7 @@ class TfFrameProperty; /** @brief Base class of ViewControllers which have a "Target Frame" * which is a TF frame whose position they track. */ -class FramePositionTrackingViewController: public ViewController +class RVIZ_DECL FramePositionTrackingViewController: public ViewController { Q_OBJECT public: diff --git a/src/rviz/image/image_display_base.h b/src/rviz/image/image_display_base.h index 005888d853..45d8628f66 100644 --- a/src/rviz/image/image_display_base.h +++ b/src/rviz/image/image_display_base.h @@ -46,6 +46,7 @@ # include "rviz/properties/int_property.h" # include "rviz/display.h" +# include "rviz/rviz_macros.h" #endif namespace rviz @@ -57,7 +58,7 @@ namespace rviz * it handles subscribing and unsubscribing when the display is * enabled or disabled. */ -class ImageDisplayBase : public Display +class RVIZ_DECL ImageDisplayBase : public Display { Q_OBJECT public: diff --git a/src/rviz/message_filter_display.h b/src/rviz/message_filter_display.h index 39745a69a9..c08be95a80 100644 --- a/src/rviz/message_filter_display.h +++ b/src/rviz/message_filter_display.h @@ -42,6 +42,7 @@ #include "rviz/properties/ros_topic_property.h" #include "rviz/display.h" +#include "rviz/rviz_macros.h" namespace rviz { @@ -49,7 +50,7 @@ namespace rviz /** @brief Helper superclass for MessageFilterDisplay, needed because * Qt's moc and c++ templates don't work nicely together. Not * intended to be used directly. */ -class _RosTopicDisplay: public Display +class RVIZ_DECL _RosTopicDisplay: public Display { Q_OBJECT public: diff --git a/src/rviz/ogre_helpers/axes.h b/src/rviz/ogre_helpers/axes.h index 69e9dc8bbc..92e39173c9 100644 --- a/src/rviz/ogre_helpers/axes.h +++ b/src/rviz/ogre_helpers/axes.h @@ -31,6 +31,7 @@ #define OGRE_TOOLS_AXES_H #include "object.h" +#include "rviz/rviz_macros.h" #include #include @@ -55,7 +56,7 @@ class Shape; * \class Axes * \brief An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue */ -class Axes : public Object +class RVIZ_DECL Axes : public Object { public: /** diff --git a/src/rviz/ogre_helpers/object.h b/src/rviz/ogre_helpers/object.h index 0391ac0dd4..a780ae540e 100644 --- a/src/rviz/ogre_helpers/object.h +++ b/src/rviz/ogre_helpers/object.h @@ -30,6 +30,8 @@ #ifndef OGRE_TOOLS_OBJECT_H #define OGRE_TOOLS_OBJECT_H +#include "rviz/rviz_macros.h" + namespace Ogre { class SceneManager; @@ -46,7 +48,7 @@ namespace rviz * \class Object * \brief Base class for visible objects, providing a minimal generic interface. */ -class Object +class RVIZ_DECL Object { public: /** diff --git a/src/rviz/ogre_helpers/render_system.h b/src/rviz/ogre_helpers/render_system.h index c9432379cd..db0989b921 100644 --- a/src/rviz/ogre_helpers/render_system.h +++ b/src/rviz/ogre_helpers/render_system.h @@ -39,6 +39,8 @@ #include #include +#include "rviz/rviz_macros.h" + #ifndef _WIN32 # pragma GCC diagnostic pop #endif @@ -52,7 +54,7 @@ namespace Ogre namespace rviz { -class RenderSystem +class RVIZ_DECL RenderSystem { public: diff --git a/src/rviz/panel.h b/src/rviz/panel.h index 15210d8356..6242f9c0fc 100644 --- a/src/rviz/panel.h +++ b/src/rviz/panel.h @@ -32,13 +32,14 @@ #include #include "rviz/config.h" +#include "rviz/rviz_macros.h" namespace rviz { class VisualizationManager; -class Panel: public QWidget +class RVIZ_DECL Panel: public QWidget { Q_OBJECT public: diff --git a/src/rviz/panel_dock_widget.h b/src/rviz/panel_dock_widget.h index 5888f6d4e3..68e75ba13b 100644 --- a/src/rviz/panel_dock_widget.h +++ b/src/rviz/panel_dock_widget.h @@ -31,6 +31,7 @@ #define RVIZ_PANEL_DOCK_WIDGET_H #include "rviz/config.h" +#include "rviz/rviz_macros.h" #include #include @@ -43,7 +44,7 @@ namespace rviz * Use setContentWidget() instead of QDockWidget::setWidget() if you * want the PanelDockWidget to be destroyed when the content widget is * destroyed. */ -class PanelDockWidget: public QDockWidget +class RVIZ_DECL PanelDockWidget: public QDockWidget { Q_OBJECT public: diff --git a/src/rviz/properties/bool_property.h b/src/rviz/properties/bool_property.h index 045f5fa416..9a55bf259f 100644 --- a/src/rviz/properties/bool_property.h +++ b/src/rviz/properties/bool_property.h @@ -30,12 +30,13 @@ #define BOOL_PROPERTY_H #include "rviz/properties/property.h" +#include "rviz/rviz_macros.h" namespace rviz { /** @brief Property specialized to provide getter for booleans. */ -class BoolProperty: public Property +class RVIZ_DECL BoolProperty: public Property { Q_OBJECT public: diff --git a/src/rviz/properties/property.h b/src/rviz/properties/property.h index 5643031f62..3efac53dd6 100644 --- a/src/rviz/properties/property.h +++ b/src/rviz/properties/property.h @@ -36,6 +36,7 @@ #include #include "rviz/config.h" +#include "rviz/rviz_macros.h" class QModelIndex; class QPainter; @@ -97,7 +98,7 @@ class PropertyTreeModel; * To show a Property tree in a PropertyTreeWidget, wrap the root * Property in a PropertyTreeModel and call * PropertyTreeWidget::setModel() with it. */ -class Property: public QObject +class RVIZ_DECL Property: public QObject { Q_OBJECT public: diff --git a/src/rviz/properties/property_tree_widget.h b/src/rviz/properties/property_tree_widget.h index 8d0a06c97c..b74166fcc7 100644 --- a/src/rviz/properties/property_tree_widget.h +++ b/src/rviz/properties/property_tree_widget.h @@ -33,6 +33,7 @@ #include "rviz/config.h" #include "rviz/properties/property_tree_model.h" +#include "rviz/rviz_macros.h" namespace rviz { @@ -40,7 +41,7 @@ namespace rviz class Property; class SplitterHandle; -class PropertyTreeWidget: public QTreeView +class RVIZ_DECL PropertyTreeWidget: public QTreeView { Q_OBJECT public: diff --git a/src/rviz/properties/ros_topic_property.h b/src/rviz/properties/ros_topic_property.h index 0a5a485b5c..971a8e05a9 100644 --- a/src/rviz/properties/ros_topic_property.h +++ b/src/rviz/properties/ros_topic_property.h @@ -32,11 +32,12 @@ #include #include "rviz/properties/editable_enum_property.h" +#include "rviz/rviz_macros.h" namespace rviz { -class RosTopicProperty: public EditableEnumProperty +class RVIZ_DECL RosTopicProperty: public EditableEnumProperty { Q_OBJECT public: diff --git a/src/rviz/properties/tf_frame_property.h b/src/rviz/properties/tf_frame_property.h index f9dde17399..8fa9b22be9 100644 --- a/src/rviz/properties/tf_frame_property.h +++ b/src/rviz/properties/tf_frame_property.h @@ -32,13 +32,14 @@ #include #include "rviz/properties/editable_enum_property.h" +#include "rviz/rviz_macros.h" namespace rviz { class FrameManager; -class TfFrameProperty: public EditableEnumProperty +class RVIZ_DECL TfFrameProperty: public EditableEnumProperty { Q_OBJECT public: diff --git a/src/rviz/properties/vector_property.h b/src/rviz/properties/vector_property.h index e7eb00d1f2..dfc89dc206 100644 --- a/src/rviz/properties/vector_property.h +++ b/src/rviz/properties/vector_property.h @@ -32,11 +32,12 @@ #include #include "rviz/properties/property.h" +#include "rviz/rviz_macros.h" namespace rviz { -class VectorProperty: public Property +class RVIZ_DECL VectorProperty: public Property { Q_OBJECT public: diff --git a/src/rviz/rviz_macros.h b/src/rviz/rviz_macros.h new file mode 100644 index 0000000000..379e67c685 --- /dev/null +++ b/src/rviz/rviz_macros.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2019, Open Source Robotics Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RVIZ_MACROS_H_ +#define RVIZ_MACROS_H_ + +#include + +#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries + #ifdef rviz_EXPORTS // we are building a shared lib/dll + #define RVIZ_DECL ROS_HELPER_EXPORT + #else // we are using shared lib/dll + #define RVIZ_DECL ROS_HELPER_IMPORT + #endif +#else // ros is being built around static libraries + #define RVIZ_DECL +#endif + +#endif \ No newline at end of file diff --git a/src/rviz/selection/selection_handler.h b/src/rviz/selection/selection_handler.h index 32b30535ec..c7ea4ee46c 100644 --- a/src/rviz/selection/selection_handler.h +++ b/src/rviz/selection/selection_handler.h @@ -44,6 +44,7 @@ #include "rviz/selection/selection_handler.h" #include "rviz/viewport_mouse_event.h" #include "rviz/interactive_object.h" +#include "rviz/rviz_macros.h" namespace Ogre { @@ -61,7 +62,7 @@ class ViewportMouseEvent; typedef std::vector V_AABB; -class SelectionHandler +class RVIZ_DECL SelectionHandler { public: SelectionHandler( DisplayContext* context ); diff --git a/src/rviz/selection/selection_manager.h b/src/rviz/selection/selection_manager.h index 6f653786fd..31a4199c47 100644 --- a/src/rviz/selection/selection_manager.h +++ b/src/rviz/selection/selection_manager.h @@ -36,6 +36,7 @@ #include "forwards.h" #include "selection_handler.h" +#include "rviz/rviz_macros.h" #ifndef Q_MOC_RUN #include @@ -77,7 +78,7 @@ class PropertyTreeModel; class ViewportMouseEvent; class VisualizationManager; -class SelectionManager: public QObject, public Ogre::MaterialManager::Listener, public Ogre::RenderQueueListener +class RVIZ_DECL SelectionManager: public QObject, public Ogre::MaterialManager::Listener, public Ogre::RenderQueueListener { Q_OBJECT public: diff --git a/src/rviz/tool.h b/src/rviz/tool.h index 66db59a434..dec39b9243 100644 --- a/src/rviz/tool.h +++ b/src/rviz/tool.h @@ -36,6 +36,7 @@ #include #include "rviz/config.h" +#include "rviz/rviz_macros.h" class QMouseEvent; class QKeyEvent; @@ -52,7 +53,7 @@ class Property; class RenderPanel; class ViewportMouseEvent; -class Tool : public QObject +class RVIZ_DECL Tool : public QObject { Q_OBJECT public: diff --git a/src/rviz/tool_manager.h b/src/rviz/tool_manager.h index 60b2cf72a6..a631693a1e 100644 --- a/src/rviz/tool_manager.h +++ b/src/rviz/tool_manager.h @@ -35,6 +35,7 @@ #include "rviz/pluginlib_factory.h" #include "rviz/tool.h" +#include "rviz/rviz_macros.h" class QKeyEvent; @@ -44,7 +45,7 @@ class DisplayContext; class PropertyTreeModel; class RenderPanel; -class ToolManager: public QObject +class RVIZ_DECL ToolManager: public QObject { Q_OBJECT public: diff --git a/src/rviz/view_controller.h b/src/rviz/view_controller.h index 8b1d986bc0..537aec7d18 100644 --- a/src/rviz/view_controller.h +++ b/src/rviz/view_controller.h @@ -35,6 +35,7 @@ #include #include "rviz/properties/property.h" +#include "rviz/rviz_macros.h" class QKeyEvent; @@ -55,7 +56,7 @@ class ViewportMouseEvent; class FloatProperty; class BoolProperty; -class ViewController: public Property +class RVIZ_DECL ViewController: public Property { Q_OBJECT public: diff --git a/src/rviz/view_manager.h b/src/rviz/view_manager.h index 6cdd242b5d..8d7b68c5a5 100644 --- a/src/rviz/view_manager.h +++ b/src/rviz/view_manager.h @@ -35,6 +35,7 @@ #include "rviz/pluginlib_factory.h" #include "rviz/view_controller.h" +#include "rviz/rviz_macros.h" namespace Ogre { @@ -49,7 +50,7 @@ class PropertyTreeModel; class ViewController; class ViewControllerContainer; -class ViewManager: public QObject +class RVIZ_DECL ViewManager: public QObject { Q_OBJECT public: diff --git a/src/rviz/visualization_frame.h b/src/rviz/visualization_frame.h index 2d9d777f05..5b81c824dd 100644 --- a/src/rviz/visualization_frame.h +++ b/src/rviz/visualization_frame.h @@ -41,6 +41,7 @@ #include "rviz/config.h" #include "rviz/window_manager_interface.h" #include "rviz/panel.h" +#include "rviz/rviz_macros.h" #include @@ -71,7 +72,7 @@ class WidgetGeometryChangeDetector; * the top is a toolbar with "Move Camera", "Select", etc. There is * also a menu bar with file/open, etc. */ -class VisualizationFrame : public QMainWindow, public WindowManagerInterface +class RVIZ_DECL VisualizationFrame : public QMainWindow, public WindowManagerInterface { Q_OBJECT public: diff --git a/src/rviz/visualization_manager.h b/src/rviz/visualization_manager.h index 4b983d490c..1126cae6ef 100644 --- a/src/rviz/visualization_manager.h +++ b/src/rviz/visualization_manager.h @@ -38,6 +38,7 @@ #include "rviz/bit_allocator.h" #include "rviz/config.h" #include "rviz/display_context.h" +#include "rviz/rviz_macros.h" class QKeyEvent; class QTimer; @@ -97,7 +98,7 @@ class VisualizationManagerPrivate; * The "protected" members should probably all be "private", as * VisualizationManager is not intended to be subclassed. */ -class VisualizationManager: public DisplayContext +class RVIZ_DECL VisualizationManager: public DisplayContext { Q_OBJECT public: diff --git a/src/rviz/visualizer_app.h b/src/rviz/visualizer_app.h index 50b54624e5..c7ee82f534 100644 --- a/src/rviz/visualizer_app.h +++ b/src/rviz/visualizer_app.h @@ -34,6 +34,7 @@ #ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829 # include +# include #endif class QTimer; @@ -43,7 +44,7 @@ namespace rviz class VisualizationFrame; -class VisualizerApp: public QObject +class RVIZ_DECL VisualizerApp: public QObject { Q_OBJECT public: From d190da8b3eaca53b3836ede51b4e5cad6bf031ee Mon Sep 17 00:00:00 2001 From: Sean Yen Date: Sun, 17 Feb 2019 10:17:08 -0800 Subject: [PATCH 2/3] address feedbacks. --- .../interactive_markers/interactive_marker.h | 13 +----- .../rviz_default_plugin_export.h | 45 +++++++++++++++++++ src/rviz/display.h | 2 +- src/rviz/display_group.h | 2 +- .../frame_position_tracking_view_controller.h | 2 +- src/rviz/image/image_display_base.h | 2 +- src/rviz/message_filter_display.h | 2 +- src/rviz/ogre_helpers/axes.h | 2 +- src/rviz/ogre_helpers/object.h | 2 +- src/rviz/ogre_helpers/render_system.h | 2 +- src/rviz/panel.h | 2 +- src/rviz/panel_dock_widget.h | 2 +- src/rviz/properties/bool_property.h | 2 +- src/rviz/properties/property.h | 2 +- src/rviz/properties/property_tree_widget.h | 2 +- src/rviz/properties/ros_topic_property.h | 2 +- src/rviz/properties/tf_frame_property.h | 2 +- src/rviz/properties/vector_property.h | 2 +- src/rviz/{rviz_macros.h => rviz_export.h} | 4 +- src/rviz/selection/selection_handler.h | 2 +- src/rviz/selection/selection_manager.h | 2 +- src/rviz/tool.h | 2 +- src/rviz/tool_manager.h | 2 +- src/rviz/view_controller.h | 2 +- src/rviz/view_manager.h | 2 +- src/rviz/visualization_frame.h | 2 +- src/rviz/visualization_manager.h | 2 +- src/rviz/visualizer_app.h | 2 +- 28 files changed, 73 insertions(+), 39 deletions(-) create mode 100644 src/rviz/default_plugin/rviz_default_plugin_export.h rename src/rviz/{rviz_macros.h => rviz_export.h} (95%) diff --git a/src/rviz/default_plugin/interactive_markers/interactive_marker.h b/src/rviz/default_plugin/interactive_markers/interactive_marker.h index 8e1fd34677..a26792f102 100644 --- a/src/rviz/default_plugin/interactive_markers/interactive_marker.h +++ b/src/rviz/default_plugin/interactive_markers/interactive_marker.h @@ -30,18 +30,6 @@ #ifndef RVIZ_INTERACTIVE_MARKER_H_ #define RVIZ_INTERACTIVE_MARKER_H_ -// Import/export for windows dll's and visibility for gcc shared libraries. - -#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries - #ifdef rviz_default_plugin_EXPORTS // we are building a shared lib/dll - #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_EXPORT - #else // we are using shared lib/dll - #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_IMPORT - #endif -#else // ros is being built around static libraries - #define RVIZ_DEFAULT_PLUGIN_DECL -#endif - #ifndef Q_MOC_RUN #include #include @@ -62,6 +50,7 @@ #include "rviz/selection/forwards.h" #include "rviz/ogre_helpers/axes.h" +#include "rviz/default_plugin/rviz_default_plugin_export.h" #include "rviz/default_plugin/interactive_markers/interactive_marker_control.h" #include "rviz/properties/status_property.h" diff --git a/src/rviz/default_plugin/rviz_default_plugin_export.h b/src/rviz/default_plugin/rviz_default_plugin_export.h new file mode 100644 index 0000000000..fb510b260e --- /dev/null +++ b/src/rviz/default_plugin/rviz_default_plugin_export.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2019, Open Source Robotics Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RVIZ_DEFAULT_PLUGIN_EXPORT_H_ +#define RVIZ_DEFAULT_PLUGIN_EXPORT_H_ + +#include + +#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries + #ifdef rviz_default_plugin_EXPORTS // we are building a shared lib/dll + #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_EXPORT + #else // we are using shared lib/dll + #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_IMPORT + #endif +#else // ros is being built around static libraries + #define RVIZ_DEFAULT_PLUGIN_DECL +#endif + +#endif \ No newline at end of file diff --git a/src/rviz/display.h b/src/rviz/display.h index 4265bef807..9b4daeeda1 100644 --- a/src/rviz/display.h +++ b/src/rviz/display.h @@ -37,7 +37,7 @@ #include "rviz/properties/status_property.h" #include "rviz/properties/bool_property.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" #include #include diff --git a/src/rviz/display_group.h b/src/rviz/display_group.h index 40aa3bcc5a..f81d7dc696 100644 --- a/src/rviz/display_group.h +++ b/src/rviz/display_group.h @@ -30,7 +30,7 @@ #define DISPLAY_GROUP_H #include "display.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/frame_position_tracking_view_controller.h b/src/rviz/frame_position_tracking_view_controller.h index 2b1d74b5f5..bd1c67266a 100644 --- a/src/rviz/frame_position_tracking_view_controller.h +++ b/src/rviz/frame_position_tracking_view_controller.h @@ -34,7 +34,7 @@ #include #include "rviz/view_controller.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/image/image_display_base.h b/src/rviz/image/image_display_base.h index 45d8628f66..f86932a08f 100644 --- a/src/rviz/image/image_display_base.h +++ b/src/rviz/image/image_display_base.h @@ -46,7 +46,7 @@ # include "rviz/properties/int_property.h" # include "rviz/display.h" -# include "rviz/rviz_macros.h" +# include "rviz/rviz_export.h" #endif namespace rviz diff --git a/src/rviz/message_filter_display.h b/src/rviz/message_filter_display.h index c08be95a80..3d0f32ac31 100644 --- a/src/rviz/message_filter_display.h +++ b/src/rviz/message_filter_display.h @@ -42,7 +42,7 @@ #include "rviz/properties/ros_topic_property.h" #include "rviz/display.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/ogre_helpers/axes.h b/src/rviz/ogre_helpers/axes.h index 92e39173c9..66edc4dd80 100644 --- a/src/rviz/ogre_helpers/axes.h +++ b/src/rviz/ogre_helpers/axes.h @@ -31,7 +31,7 @@ #define OGRE_TOOLS_AXES_H #include "object.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" #include #include diff --git a/src/rviz/ogre_helpers/object.h b/src/rviz/ogre_helpers/object.h index a780ae540e..06f63ba996 100644 --- a/src/rviz/ogre_helpers/object.h +++ b/src/rviz/ogre_helpers/object.h @@ -30,7 +30,7 @@ #ifndef OGRE_TOOLS_OBJECT_H #define OGRE_TOOLS_OBJECT_H -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace Ogre { diff --git a/src/rviz/ogre_helpers/render_system.h b/src/rviz/ogre_helpers/render_system.h index db0989b921..662157a500 100644 --- a/src/rviz/ogre_helpers/render_system.h +++ b/src/rviz/ogre_helpers/render_system.h @@ -39,7 +39,7 @@ #include #include -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" #ifndef _WIN32 # pragma GCC diagnostic pop diff --git a/src/rviz/panel.h b/src/rviz/panel.h index 6242f9c0fc..e226dbe627 100644 --- a/src/rviz/panel.h +++ b/src/rviz/panel.h @@ -32,7 +32,7 @@ #include #include "rviz/config.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/panel_dock_widget.h b/src/rviz/panel_dock_widget.h index 68e75ba13b..8f53bf930a 100644 --- a/src/rviz/panel_dock_widget.h +++ b/src/rviz/panel_dock_widget.h @@ -31,7 +31,7 @@ #define RVIZ_PANEL_DOCK_WIDGET_H #include "rviz/config.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" #include #include diff --git a/src/rviz/properties/bool_property.h b/src/rviz/properties/bool_property.h index 9a55bf259f..325399d3cf 100644 --- a/src/rviz/properties/bool_property.h +++ b/src/rviz/properties/bool_property.h @@ -30,7 +30,7 @@ #define BOOL_PROPERTY_H #include "rviz/properties/property.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/properties/property.h b/src/rviz/properties/property.h index 3efac53dd6..1263a794bd 100644 --- a/src/rviz/properties/property.h +++ b/src/rviz/properties/property.h @@ -36,7 +36,7 @@ #include #include "rviz/config.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" class QModelIndex; class QPainter; diff --git a/src/rviz/properties/property_tree_widget.h b/src/rviz/properties/property_tree_widget.h index b74166fcc7..7f5b2a0a66 100644 --- a/src/rviz/properties/property_tree_widget.h +++ b/src/rviz/properties/property_tree_widget.h @@ -33,7 +33,7 @@ #include "rviz/config.h" #include "rviz/properties/property_tree_model.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/properties/ros_topic_property.h b/src/rviz/properties/ros_topic_property.h index 971a8e05a9..c7cf26fe23 100644 --- a/src/rviz/properties/ros_topic_property.h +++ b/src/rviz/properties/ros_topic_property.h @@ -32,7 +32,7 @@ #include #include "rviz/properties/editable_enum_property.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/properties/tf_frame_property.h b/src/rviz/properties/tf_frame_property.h index 8fa9b22be9..d43352e9cc 100644 --- a/src/rviz/properties/tf_frame_property.h +++ b/src/rviz/properties/tf_frame_property.h @@ -32,7 +32,7 @@ #include #include "rviz/properties/editable_enum_property.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/properties/vector_property.h b/src/rviz/properties/vector_property.h index dfc89dc206..c2a5e4e15d 100644 --- a/src/rviz/properties/vector_property.h +++ b/src/rviz/properties/vector_property.h @@ -32,7 +32,7 @@ #include #include "rviz/properties/property.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace rviz { diff --git a/src/rviz/rviz_macros.h b/src/rviz/rviz_export.h similarity index 95% rename from src/rviz/rviz_macros.h rename to src/rviz/rviz_export.h index 379e67c685..87388c9902 100644 --- a/src/rviz/rviz_macros.h +++ b/src/rviz/rviz_export.h @@ -27,8 +27,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef RVIZ_MACROS_H_ -#define RVIZ_MACROS_H_ +#ifndef RVIZ_EXPORT_H_ +#define RVIZ_EXPORT_H_ #include diff --git a/src/rviz/selection/selection_handler.h b/src/rviz/selection/selection_handler.h index c7ea4ee46c..72a1812c20 100644 --- a/src/rviz/selection/selection_handler.h +++ b/src/rviz/selection/selection_handler.h @@ -44,7 +44,7 @@ #include "rviz/selection/selection_handler.h" #include "rviz/viewport_mouse_event.h" #include "rviz/interactive_object.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace Ogre { diff --git a/src/rviz/selection/selection_manager.h b/src/rviz/selection/selection_manager.h index 31a4199c47..ef10600ea7 100644 --- a/src/rviz/selection/selection_manager.h +++ b/src/rviz/selection/selection_manager.h @@ -36,7 +36,7 @@ #include "forwards.h" #include "selection_handler.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" #ifndef Q_MOC_RUN #include diff --git a/src/rviz/tool.h b/src/rviz/tool.h index dec39b9243..6d82313880 100644 --- a/src/rviz/tool.h +++ b/src/rviz/tool.h @@ -36,7 +36,7 @@ #include #include "rviz/config.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" class QMouseEvent; class QKeyEvent; diff --git a/src/rviz/tool_manager.h b/src/rviz/tool_manager.h index a631693a1e..368225a5de 100644 --- a/src/rviz/tool_manager.h +++ b/src/rviz/tool_manager.h @@ -35,7 +35,7 @@ #include "rviz/pluginlib_factory.h" #include "rviz/tool.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" class QKeyEvent; diff --git a/src/rviz/view_controller.h b/src/rviz/view_controller.h index 537aec7d18..3ea9c788e7 100644 --- a/src/rviz/view_controller.h +++ b/src/rviz/view_controller.h @@ -35,7 +35,7 @@ #include #include "rviz/properties/property.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" class QKeyEvent; diff --git a/src/rviz/view_manager.h b/src/rviz/view_manager.h index 8d7b68c5a5..ee2dac2be9 100644 --- a/src/rviz/view_manager.h +++ b/src/rviz/view_manager.h @@ -35,7 +35,7 @@ #include "rviz/pluginlib_factory.h" #include "rviz/view_controller.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" namespace Ogre { diff --git a/src/rviz/visualization_frame.h b/src/rviz/visualization_frame.h index 5b81c824dd..84efe4ebaa 100644 --- a/src/rviz/visualization_frame.h +++ b/src/rviz/visualization_frame.h @@ -41,7 +41,7 @@ #include "rviz/config.h" #include "rviz/window_manager_interface.h" #include "rviz/panel.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" #include diff --git a/src/rviz/visualization_manager.h b/src/rviz/visualization_manager.h index 1126cae6ef..10813a5690 100644 --- a/src/rviz/visualization_manager.h +++ b/src/rviz/visualization_manager.h @@ -38,7 +38,7 @@ #include "rviz/bit_allocator.h" #include "rviz/config.h" #include "rviz/display_context.h" -#include "rviz/rviz_macros.h" +#include "rviz/rviz_export.h" class QKeyEvent; class QTimer; diff --git a/src/rviz/visualizer_app.h b/src/rviz/visualizer_app.h index c7ee82f534..b68439fb6f 100644 --- a/src/rviz/visualizer_app.h +++ b/src/rviz/visualizer_app.h @@ -34,7 +34,7 @@ #ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829 # include -# include +# include #endif class QTimer; From 078d844cb6c465e2c35cb8265716579e170eab8d Mon Sep 17 00:00:00 2001 From: Sean Yen Date: Mon, 18 Feb 2019 10:39:24 -0800 Subject: [PATCH 3/3] rework to use generate_export_header. --- src/python_bindings/sip/CMakeLists.txt | 2 +- src/rviz/CMakeLists.txt | 9 ++++ src/rviz/default_plugin/CMakeLists.txt | 8 ++++ .../interactive_markers/interactive_marker.h | 2 +- .../rviz_default_plugin_export.h | 45 ------------------- src/rviz/display.h | 2 +- src/rviz/display_group.h | 2 +- .../frame_position_tracking_view_controller.h | 2 +- src/rviz/image/image_display_base.h | 2 +- src/rviz/message_filter_display.h | 2 +- src/rviz/ogre_helpers/axes.h | 2 +- src/rviz/ogre_helpers/object.h | 2 +- src/rviz/ogre_helpers/render_system.h | 2 +- src/rviz/panel.h | 2 +- src/rviz/panel_dock_widget.h | 2 +- src/rviz/properties/bool_property.h | 2 +- src/rviz/properties/property.h | 2 +- src/rviz/properties/property_tree_widget.h | 2 +- src/rviz/properties/ros_topic_property.h | 2 +- src/rviz/properties/tf_frame_property.h | 2 +- src/rviz/properties/vector_property.h | 2 +- src/rviz/rviz_export.h | 45 ------------------- src/rviz/selection/selection_handler.h | 2 +- src/rviz/selection/selection_manager.h | 2 +- src/rviz/tool.h | 2 +- src/rviz/tool_manager.h | 2 +- src/rviz/view_controller.h | 2 +- src/rviz/view_manager.h | 2 +- src/rviz/visualization_frame.h | 2 +- src/rviz/visualization_manager.h | 2 +- src/rviz/visualizer_app.h | 2 +- 31 files changed, 44 insertions(+), 117 deletions(-) delete mode 100644 src/rviz/default_plugin/rviz_default_plugin_export.h delete mode 100644 src/rviz/rviz_export.h diff --git a/src/python_bindings/sip/CMakeLists.txt b/src/python_bindings/sip/CMakeLists.txt index 0921754bcb..4dabd5df79 100644 --- a/src/python_bindings/sip/CMakeLists.txt +++ b/src/python_bindings/sip/CMakeLists.txt @@ -42,7 +42,7 @@ find_package(python_qt_binding REQUIRED) include(${python_qt_binding_EXTRAS_DIR}/sip_helper.cmake) # maintain context for different named target -set(rviz_sip_INCLUDE_DIRS ${rviz_INCLUDE_DIRS} "${PROJECT_SOURCE_DIR}/src" ${catkin_INCLUDE_DIRS}) +set(rviz_sip_INCLUDE_DIRS ${rviz_INCLUDE_DIRS} "${PROJECT_SOURCE_DIR}/src" ${catkin_INCLUDE_DIRS} $) set(rviz_sip_LIBRARIES ${rviz_LIBRARIES} ${PROJECT_NAME}) set(rviz_sip_LIBRARY_DIRS ${rviz_LIBRARY_DIRS} ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}) if (MSVC) diff --git a/src/rviz/CMakeLists.txt b/src/rviz/CMakeLists.txt index 5304d14fa8..4a2142e601 100644 --- a/src/rviz/CMakeLists.txt +++ b/src/rviz/CMakeLists.txt @@ -129,6 +129,10 @@ add_library(${PROJECT_NAME} ${ENV_CONFIG_FILE} ) +include(GenerateExportHeader) +generate_export_header(${PROJECT_NAME} EXPORT_FILE_NAME rviz/${PROJECT_NAME}_export.h) +target_include_directories(${PROJECT_NAME} INTERFACE "$") +set_target_properties(${PROJECT_NAME} PROPERTIES EXPORT_HEADER_DIR "${CMAKE_CURRENT_BINARY_DIR}") if(NOT WIN32) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-std=c++11") endif() @@ -177,5 +181,10 @@ install(DIRECTORY ./ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} FILES_MATCHING PATTERN "*.h") +#catkin_lint: ignore_once missing_file +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/rviz/${PROJECT_NAME}_export.h + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) + install(TARGETS executable DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}) diff --git a/src/rviz/default_plugin/CMakeLists.txt b/src/rviz/default_plugin/CMakeLists.txt index 4445d0df35..08e945080e 100644 --- a/src/rviz/default_plugin/CMakeLists.txt +++ b/src/rviz/default_plugin/CMakeLists.txt @@ -70,6 +70,9 @@ set(SOURCE_FILES ) add_library(${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME} ${SOURCE_FILES}) +include(GenerateExportHeader) +generate_export_header(${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME} EXPORT_FILE_NAME rviz/default_plugin/${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}_export.h) +target_include_directories(${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME} INTERFACE "$") if(NOT WIN32) set_target_properties(${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME} PROPERTIES COMPILE_FLAGS "-std=c++11") @@ -82,6 +85,11 @@ target_link_libraries(${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME} ${QT_LIBRARIES} ) +#catkin_lint: ignore_once missing_file +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/rviz/default_plugin/${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}_export.h + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}/default_plugin/) + install(TARGETS ${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME} ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} diff --git a/src/rviz/default_plugin/interactive_markers/interactive_marker.h b/src/rviz/default_plugin/interactive_markers/interactive_marker.h index a26792f102..0a8c225c12 100644 --- a/src/rviz/default_plugin/interactive_markers/interactive_marker.h +++ b/src/rviz/default_plugin/interactive_markers/interactive_marker.h @@ -65,7 +65,7 @@ namespace rviz class DisplayContext; class InteractiveMarkerDisplay; -class RVIZ_DEFAULT_PLUGIN_DECL InteractiveMarker : public QObject +class RVIZ_DEFAULT_PLUGIN_EXPORT InteractiveMarker : public QObject { Q_OBJECT public: diff --git a/src/rviz/default_plugin/rviz_default_plugin_export.h b/src/rviz/default_plugin/rviz_default_plugin_export.h deleted file mode 100644 index fb510b260e..0000000000 --- a/src/rviz/default_plugin/rviz_default_plugin_export.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2019, Open Source Robotics Foundation, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Willow Garage, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef RVIZ_DEFAULT_PLUGIN_EXPORT_H_ -#define RVIZ_DEFAULT_PLUGIN_EXPORT_H_ - -#include - -#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries - #ifdef rviz_default_plugin_EXPORTS // we are building a shared lib/dll - #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_EXPORT - #else // we are using shared lib/dll - #define RVIZ_DEFAULT_PLUGIN_DECL ROS_HELPER_IMPORT - #endif -#else // ros is being built around static libraries - #define RVIZ_DEFAULT_PLUGIN_DECL -#endif - -#endif \ No newline at end of file diff --git a/src/rviz/display.h b/src/rviz/display.h index 9b4daeeda1..e3765c1f60 100644 --- a/src/rviz/display.h +++ b/src/rviz/display.h @@ -61,7 +61,7 @@ class StatusList; class DisplayContext; class PanelDockWidget; -class RVIZ_DECL Display: public BoolProperty +class RVIZ_EXPORT Display: public BoolProperty { Q_OBJECT public: diff --git a/src/rviz/display_group.h b/src/rviz/display_group.h index f81d7dc696..8251f899e2 100644 --- a/src/rviz/display_group.h +++ b/src/rviz/display_group.h @@ -45,7 +45,7 @@ class DisplayFactory; * Property superclass stores the non-Display properties and this * class stores the Display objects in a separate list. The * separation is enforced in addChild(). */ -class RVIZ_DECL DisplayGroup: public Display +class RVIZ_EXPORT DisplayGroup: public Display { Q_OBJECT public: diff --git a/src/rviz/frame_position_tracking_view_controller.h b/src/rviz/frame_position_tracking_view_controller.h index bd1c67266a..993db9a896 100644 --- a/src/rviz/frame_position_tracking_view_controller.h +++ b/src/rviz/frame_position_tracking_view_controller.h @@ -43,7 +43,7 @@ class TfFrameProperty; /** @brief Base class of ViewControllers which have a "Target Frame" * which is a TF frame whose position they track. */ -class RVIZ_DECL FramePositionTrackingViewController: public ViewController +class RVIZ_EXPORT FramePositionTrackingViewController: public ViewController { Q_OBJECT public: diff --git a/src/rviz/image/image_display_base.h b/src/rviz/image/image_display_base.h index f86932a08f..06b4c5ae51 100644 --- a/src/rviz/image/image_display_base.h +++ b/src/rviz/image/image_display_base.h @@ -58,7 +58,7 @@ namespace rviz * it handles subscribing and unsubscribing when the display is * enabled or disabled. */ -class RVIZ_DECL ImageDisplayBase : public Display +class RVIZ_EXPORT ImageDisplayBase : public Display { Q_OBJECT public: diff --git a/src/rviz/message_filter_display.h b/src/rviz/message_filter_display.h index 3d0f32ac31..9d6bbde9cc 100644 --- a/src/rviz/message_filter_display.h +++ b/src/rviz/message_filter_display.h @@ -50,7 +50,7 @@ namespace rviz /** @brief Helper superclass for MessageFilterDisplay, needed because * Qt's moc and c++ templates don't work nicely together. Not * intended to be used directly. */ -class RVIZ_DECL _RosTopicDisplay: public Display +class RVIZ_EXPORT _RosTopicDisplay: public Display { Q_OBJECT public: diff --git a/src/rviz/ogre_helpers/axes.h b/src/rviz/ogre_helpers/axes.h index 66edc4dd80..3a67ed2bfe 100644 --- a/src/rviz/ogre_helpers/axes.h +++ b/src/rviz/ogre_helpers/axes.h @@ -56,7 +56,7 @@ class Shape; * \class Axes * \brief An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue */ -class RVIZ_DECL Axes : public Object +class RVIZ_EXPORT Axes : public Object { public: /** diff --git a/src/rviz/ogre_helpers/object.h b/src/rviz/ogre_helpers/object.h index 06f63ba996..9809677922 100644 --- a/src/rviz/ogre_helpers/object.h +++ b/src/rviz/ogre_helpers/object.h @@ -48,7 +48,7 @@ namespace rviz * \class Object * \brief Base class for visible objects, providing a minimal generic interface. */ -class RVIZ_DECL Object +class RVIZ_EXPORT Object { public: /** diff --git a/src/rviz/ogre_helpers/render_system.h b/src/rviz/ogre_helpers/render_system.h index 662157a500..88d348371f 100644 --- a/src/rviz/ogre_helpers/render_system.h +++ b/src/rviz/ogre_helpers/render_system.h @@ -54,7 +54,7 @@ namespace Ogre namespace rviz { -class RVIZ_DECL RenderSystem +class RVIZ_EXPORT RenderSystem { public: diff --git a/src/rviz/panel.h b/src/rviz/panel.h index e226dbe627..9686afe48f 100644 --- a/src/rviz/panel.h +++ b/src/rviz/panel.h @@ -39,7 +39,7 @@ namespace rviz class VisualizationManager; -class RVIZ_DECL Panel: public QWidget +class RVIZ_EXPORT Panel: public QWidget { Q_OBJECT public: diff --git a/src/rviz/panel_dock_widget.h b/src/rviz/panel_dock_widget.h index 8f53bf930a..f395d62515 100644 --- a/src/rviz/panel_dock_widget.h +++ b/src/rviz/panel_dock_widget.h @@ -44,7 +44,7 @@ namespace rviz * Use setContentWidget() instead of QDockWidget::setWidget() if you * want the PanelDockWidget to be destroyed when the content widget is * destroyed. */ -class RVIZ_DECL PanelDockWidget: public QDockWidget +class RVIZ_EXPORT PanelDockWidget: public QDockWidget { Q_OBJECT public: diff --git a/src/rviz/properties/bool_property.h b/src/rviz/properties/bool_property.h index 325399d3cf..d4194c69f5 100644 --- a/src/rviz/properties/bool_property.h +++ b/src/rviz/properties/bool_property.h @@ -36,7 +36,7 @@ namespace rviz { /** @brief Property specialized to provide getter for booleans. */ -class RVIZ_DECL BoolProperty: public Property +class RVIZ_EXPORT BoolProperty: public Property { Q_OBJECT public: diff --git a/src/rviz/properties/property.h b/src/rviz/properties/property.h index 1263a794bd..2b372325b4 100644 --- a/src/rviz/properties/property.h +++ b/src/rviz/properties/property.h @@ -98,7 +98,7 @@ class PropertyTreeModel; * To show a Property tree in a PropertyTreeWidget, wrap the root * Property in a PropertyTreeModel and call * PropertyTreeWidget::setModel() with it. */ -class RVIZ_DECL Property: public QObject +class RVIZ_EXPORT Property: public QObject { Q_OBJECT public: diff --git a/src/rviz/properties/property_tree_widget.h b/src/rviz/properties/property_tree_widget.h index 7f5b2a0a66..437857a5ee 100644 --- a/src/rviz/properties/property_tree_widget.h +++ b/src/rviz/properties/property_tree_widget.h @@ -41,7 +41,7 @@ namespace rviz class Property; class SplitterHandle; -class RVIZ_DECL PropertyTreeWidget: public QTreeView +class RVIZ_EXPORT PropertyTreeWidget: public QTreeView { Q_OBJECT public: diff --git a/src/rviz/properties/ros_topic_property.h b/src/rviz/properties/ros_topic_property.h index c7cf26fe23..7729e9b213 100644 --- a/src/rviz/properties/ros_topic_property.h +++ b/src/rviz/properties/ros_topic_property.h @@ -37,7 +37,7 @@ namespace rviz { -class RVIZ_DECL RosTopicProperty: public EditableEnumProperty +class RVIZ_EXPORT RosTopicProperty: public EditableEnumProperty { Q_OBJECT public: diff --git a/src/rviz/properties/tf_frame_property.h b/src/rviz/properties/tf_frame_property.h index d43352e9cc..db1519f959 100644 --- a/src/rviz/properties/tf_frame_property.h +++ b/src/rviz/properties/tf_frame_property.h @@ -39,7 +39,7 @@ namespace rviz class FrameManager; -class RVIZ_DECL TfFrameProperty: public EditableEnumProperty +class RVIZ_EXPORT TfFrameProperty: public EditableEnumProperty { Q_OBJECT public: diff --git a/src/rviz/properties/vector_property.h b/src/rviz/properties/vector_property.h index c2a5e4e15d..6934de615b 100644 --- a/src/rviz/properties/vector_property.h +++ b/src/rviz/properties/vector_property.h @@ -37,7 +37,7 @@ namespace rviz { -class RVIZ_DECL VectorProperty: public Property +class RVIZ_EXPORT VectorProperty: public Property { Q_OBJECT public: diff --git a/src/rviz/rviz_export.h b/src/rviz/rviz_export.h deleted file mode 100644 index 87388c9902..0000000000 --- a/src/rviz/rviz_export.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2019, Open Source Robotics Foundation, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Willow Garage, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef RVIZ_EXPORT_H_ -#define RVIZ_EXPORT_H_ - -#include - -#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries - #ifdef rviz_EXPORTS // we are building a shared lib/dll - #define RVIZ_DECL ROS_HELPER_EXPORT - #else // we are using shared lib/dll - #define RVIZ_DECL ROS_HELPER_IMPORT - #endif -#else // ros is being built around static libraries - #define RVIZ_DECL -#endif - -#endif \ No newline at end of file diff --git a/src/rviz/selection/selection_handler.h b/src/rviz/selection/selection_handler.h index 72a1812c20..ea5c43a285 100644 --- a/src/rviz/selection/selection_handler.h +++ b/src/rviz/selection/selection_handler.h @@ -62,7 +62,7 @@ class ViewportMouseEvent; typedef std::vector V_AABB; -class RVIZ_DECL SelectionHandler +class RVIZ_EXPORT SelectionHandler { public: SelectionHandler( DisplayContext* context ); diff --git a/src/rviz/selection/selection_manager.h b/src/rviz/selection/selection_manager.h index ef10600ea7..0cd8713430 100644 --- a/src/rviz/selection/selection_manager.h +++ b/src/rviz/selection/selection_manager.h @@ -78,7 +78,7 @@ class PropertyTreeModel; class ViewportMouseEvent; class VisualizationManager; -class RVIZ_DECL SelectionManager: public QObject, public Ogre::MaterialManager::Listener, public Ogre::RenderQueueListener +class RVIZ_EXPORT SelectionManager: public QObject, public Ogre::MaterialManager::Listener, public Ogre::RenderQueueListener { Q_OBJECT public: diff --git a/src/rviz/tool.h b/src/rviz/tool.h index 6d82313880..fdb2ca8f38 100644 --- a/src/rviz/tool.h +++ b/src/rviz/tool.h @@ -53,7 +53,7 @@ class Property; class RenderPanel; class ViewportMouseEvent; -class RVIZ_DECL Tool : public QObject +class RVIZ_EXPORT Tool : public QObject { Q_OBJECT public: diff --git a/src/rviz/tool_manager.h b/src/rviz/tool_manager.h index 368225a5de..ba6f4d12ed 100644 --- a/src/rviz/tool_manager.h +++ b/src/rviz/tool_manager.h @@ -45,7 +45,7 @@ class DisplayContext; class PropertyTreeModel; class RenderPanel; -class RVIZ_DECL ToolManager: public QObject +class RVIZ_EXPORT ToolManager: public QObject { Q_OBJECT public: diff --git a/src/rviz/view_controller.h b/src/rviz/view_controller.h index 3ea9c788e7..5bc7823018 100644 --- a/src/rviz/view_controller.h +++ b/src/rviz/view_controller.h @@ -56,7 +56,7 @@ class ViewportMouseEvent; class FloatProperty; class BoolProperty; -class RVIZ_DECL ViewController: public Property +class RVIZ_EXPORT ViewController: public Property { Q_OBJECT public: diff --git a/src/rviz/view_manager.h b/src/rviz/view_manager.h index ee2dac2be9..a4c7250473 100644 --- a/src/rviz/view_manager.h +++ b/src/rviz/view_manager.h @@ -50,7 +50,7 @@ class PropertyTreeModel; class ViewController; class ViewControllerContainer; -class RVIZ_DECL ViewManager: public QObject +class RVIZ_EXPORT ViewManager: public QObject { Q_OBJECT public: diff --git a/src/rviz/visualization_frame.h b/src/rviz/visualization_frame.h index 84efe4ebaa..1f6d69d820 100644 --- a/src/rviz/visualization_frame.h +++ b/src/rviz/visualization_frame.h @@ -72,7 +72,7 @@ class WidgetGeometryChangeDetector; * the top is a toolbar with "Move Camera", "Select", etc. There is * also a menu bar with file/open, etc. */ -class RVIZ_DECL VisualizationFrame : public QMainWindow, public WindowManagerInterface +class RVIZ_EXPORT VisualizationFrame : public QMainWindow, public WindowManagerInterface { Q_OBJECT public: diff --git a/src/rviz/visualization_manager.h b/src/rviz/visualization_manager.h index 10813a5690..6e2f557c9e 100644 --- a/src/rviz/visualization_manager.h +++ b/src/rviz/visualization_manager.h @@ -98,7 +98,7 @@ class VisualizationManagerPrivate; * The "protected" members should probably all be "private", as * VisualizationManager is not intended to be subclassed. */ -class RVIZ_DECL VisualizationManager: public DisplayContext +class RVIZ_EXPORT VisualizationManager: public DisplayContext { Q_OBJECT public: diff --git a/src/rviz/visualizer_app.h b/src/rviz/visualizer_app.h index b68439fb6f..4ee1341118 100644 --- a/src/rviz/visualizer_app.h +++ b/src/rviz/visualizer_app.h @@ -44,7 +44,7 @@ namespace rviz class VisualizationFrame; -class RVIZ_DECL VisualizerApp: public QObject +class RVIZ_EXPORT VisualizerApp: public QObject { Q_OBJECT public: