Skip to content

Commit

Permalink
Add DLL symbol exports (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyen authored and rhaschke committed Mar 6, 2019
1 parent c9dc024 commit a3c7711
Show file tree
Hide file tree
Showing 29 changed files with 72 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/python_bindings/sip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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} $<TARGET_PROPERTY:rviz,EXPORT_HEADER_DIR>)
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)
Expand All @@ -69,7 +69,7 @@ if(sip_helper_FOUND)
else()
set(rviz_sip_LIBRARY_FILE librviz_sip${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
#catkin_lint: ignore_once missing_file external_file
#catkin_lint: ignore_once external_file
install(FILES ${CATKIN_DEVEL_PREFIX}/${PYTHON_INSTALL_DIR}/rviz/${rviz_sip_LIBRARY_FILE}
DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION})
endif()
8 changes: 8 additions & 0 deletions src/rviz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
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()
Expand Down Expand Up @@ -177,5 +181,9 @@ install(DIRECTORY ./
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h")

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/rviz/${PROJECT_NAME}_export.h
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(TARGETS executable
DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
9 changes: 8 additions & 1 deletion src/rviz/default_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
if(NOT WIN32)
set_target_properties(${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}
PROPERTIES COMPILE_FLAGS "-std=c++11")
Expand All @@ -82,6 +85,10 @@ target_link_libraries(${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}
${QT_LIBRARIES}
)

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}
Expand All @@ -92,7 +99,7 @@ file(GENERATE
OUTPUT "${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/default_plugin_location.cmake"
CONTENT "set(rviz_DEFAULT_PLUGIN_FILE_NAME $<TARGET_LINKER_FILE_NAME:${rviz_DEFAULT_PLUGIN_LIBRARY_TARGET_NAME}>)"
)
#catkin_lint: ignore_once missing_file external_file
#catkin_lint: ignore_once external_file
# Install from the devel space to the install space.
install(FILES "${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/default_plugin_location.cmake"
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,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"

Expand All @@ -64,7 +65,7 @@ namespace rviz
class DisplayContext;
class InteractiveMarkerDisplay;

class InteractiveMarker : public QObject
class RVIZ_DEFAULT_PLUGIN_EXPORT InteractiveMarker : public QObject
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "rviz/properties/status_property.h"
#include "rviz/properties/bool_property.h"
#include "rviz/rviz_export.h"

#include <QIcon>
#include <QSet>
Expand All @@ -60,7 +61,7 @@ class StatusList;
class DisplayContext;
class PanelDockWidget;

class Display: public BoolProperty
class RVIZ_EXPORT Display: public BoolProperty
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/display_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define DISPLAY_GROUP_H

#include "display.h"
#include "rviz/rviz_export.h"

namespace rviz
{
Expand All @@ -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_EXPORT DisplayGroup: public Display
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/frame_position_tracking_view_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <OgreVector3.h>

#include "rviz/view_controller.h"
#include "rviz/rviz_export.h"

namespace rviz
{
Expand All @@ -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_EXPORT FramePositionTrackingViewController: public ViewController
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/image/image_display_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
# include "rviz/properties/int_property.h"

# include "rviz/display.h"
# include "rviz/rviz_export.h"
#endif

namespace rviz
Expand All @@ -57,7 +58,7 @@ namespace rviz
* it handles subscribing and unsubscribing when the display is
* enabled or disabled. */

class ImageDisplayBase : public Display
class RVIZ_EXPORT ImageDisplayBase : public Display
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/message_filter_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@
#include "rviz/properties/ros_topic_property.h"

#include "rviz/display.h"
#include "rviz/rviz_export.h"

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_EXPORT _RosTopicDisplay: public Display
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/ogre_helpers/axes.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define OGRE_TOOLS_AXES_H

#include "object.h"
#include "rviz/rviz_export.h"

#include <stddef.h>
#include <stdint.h>
Expand All @@ -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_EXPORT Axes : public Object
{
public:
/**
Expand Down
4 changes: 3 additions & 1 deletion src/rviz/ogre_helpers/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#ifndef OGRE_TOOLS_OBJECT_H
#define OGRE_TOOLS_OBJECT_H

#include "rviz/rviz_export.h"

namespace Ogre
{
class SceneManager;
Expand All @@ -46,7 +48,7 @@ namespace rviz
* \class Object
* \brief Base class for visible objects, providing a minimal generic interface.
*/
class Object
class RVIZ_EXPORT Object
{
public:
/**
Expand Down
4 changes: 3 additions & 1 deletion src/rviz/ogre_helpers/render_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include <OgreRoot.h>
#include <stdint.h>

#include "rviz/rviz_export.h"

#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
Expand All @@ -52,7 +54,7 @@ namespace Ogre
namespace rviz
{

class RenderSystem
class RVIZ_EXPORT RenderSystem
{
public:

Expand Down
3 changes: 2 additions & 1 deletion src/rviz/panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
#include <QWidget>

#include "rviz/config.h"
#include "rviz/rviz_export.h"

namespace rviz
{

class VisualizationManager;

class Panel: public QWidget
class RVIZ_EXPORT Panel: public QWidget
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/panel_dock_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define RVIZ_PANEL_DOCK_WIDGET_H

#include "rviz/config.h"
#include "rviz/rviz_export.h"

#include <QDockWidget>
#include <QLabel>
Expand All @@ -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_EXPORT PanelDockWidget: public QDockWidget
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/properties/bool_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
#define BOOL_PROPERTY_H

#include "rviz/properties/property.h"
#include "rviz/rviz_export.h"

namespace rviz
{

/** @brief Property specialized to provide getter for booleans. */
class BoolProperty: public Property
class RVIZ_EXPORT BoolProperty: public Property
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/properties/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <QVariant>

#include "rviz/config.h"
#include "rviz/rviz_export.h"

class QModelIndex;
class QPainter;
Expand Down Expand Up @@ -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_EXPORT Property: public QObject
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/properties/property_tree_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@

#include "rviz/config.h"
#include "rviz/properties/property_tree_model.h"
#include "rviz/rviz_export.h"

namespace rviz
{

class Property;
class SplitterHandle;

class PropertyTreeWidget: public QTreeView
class RVIZ_EXPORT PropertyTreeWidget: public QTreeView
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/properties/ros_topic_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
#include <string>

#include "rviz/properties/editable_enum_property.h"
#include "rviz/rviz_export.h"

namespace rviz
{

class RosTopicProperty: public EditableEnumProperty
class RVIZ_EXPORT RosTopicProperty: public EditableEnumProperty
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/properties/tf_frame_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
#include <string>

#include "rviz/properties/editable_enum_property.h"
#include "rviz/rviz_export.h"

namespace rviz
{

class FrameManager;

class TfFrameProperty: public EditableEnumProperty
class RVIZ_EXPORT TfFrameProperty: public EditableEnumProperty
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/properties/vector_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
#include <OgreVector3.h>

#include "rviz/properties/property.h"
#include "rviz/rviz_export.h"

namespace rviz
{

class VectorProperty: public Property
class RVIZ_EXPORT VectorProperty: public Property
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/selection/selection_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "rviz/selection/selection_handler.h"
#include "rviz/viewport_mouse_event.h"
#include "rviz/interactive_object.h"
#include "rviz/rviz_export.h"

namespace Ogre
{
Expand All @@ -61,7 +62,7 @@ class ViewportMouseEvent;

typedef std::vector<Ogre::AxisAlignedBox> V_AABB;

class SelectionHandler
class RVIZ_EXPORT SelectionHandler
{
public:
SelectionHandler( DisplayContext* context );
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/selection/selection_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include "forwards.h"
#include "selection_handler.h"
#include "rviz/rviz_export.h"

#ifndef Q_MOC_RUN
#include <boost/shared_ptr.hpp>
Expand Down Expand Up @@ -77,7 +78,7 @@ class PropertyTreeModel;
class ViewportMouseEvent;
class VisualizationManager;

class 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:
Expand Down
Loading

0 comments on commit a3c7711

Please sign in to comment.