Skip to content

Commit 3ea03e7

Browse files
seanyendavetcoleman
authored andcommitted
Windows bring up. (#116)
1 parent c586d43 commit 3ea03e7

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
cmake_minimum_required(VERSION 2.8.6)
22
project(rviz_visual_tools)
33

4-
add_definitions(-std=c++11)
4+
if(NOT MSVC)
5+
add_compile_options(-std=c++11)
6+
# Warnings
7+
add_definitions(-W -Wall -Wextra
8+
#-Wcast-qual
9+
-Wwrite-strings -Wunreachable-code -Wpointer-arith
10+
-Winit-self -Wredundant-decls
11+
-Wno-unused-parameter -Wno-unused-function)
12+
endif()
513

614
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
715

8-
# Warnings
9-
add_definitions(-W -Wall -Wextra
10-
#-Wcast-qual
11-
-Wwrite-strings -Wunreachable-code -Wpointer-arith
12-
-Winit-self -Wredundant-decls
13-
-Wno-unused-parameter -Wno-unused-function)
14-
1516
find_package(catkin REQUIRED COMPONENTS
1617
eigen_conversions
1718
eigen_stl_containers
@@ -170,6 +171,10 @@ install(
170171
${PROJECT_NAME}_remote_control
171172
LIBRARY DESTINATION
172173
${CATKIN_PACKAGE_LIB_DESTINATION}
174+
ARCHIVE DESTINATION
175+
${CATKIN_PACKAGE_LIB_DESTINATION}
176+
RUNTIME DESTINATION
177+
${CATKIN_GLOBAL_BIN_DESTINATION}
173178
)
174179

175180
# Install header files
@@ -188,5 +193,6 @@ install(FILES
188193
# Install executables
189194
install(TARGETS ${PROJECT_NAME}_demo ${PROJECT_NAME}_imarker_simple_demo
190195
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
196+
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
191197
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
192198
)

include/rviz_visual_tools/rviz_visual_tools.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@
6969
#include <rviz_visual_tools/deprecation.h>
7070
#include <rviz_visual_tools/remote_control.h>
7171

72+
// Import/export for windows dll's and visibility for gcc shared libraries.
73+
74+
#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries
75+
#ifdef rviz_visual_tools_EXPORTS // we are building a shared lib/dll
76+
#define RVIZ_VISUAL_TOOLS_DECL ROS_HELPER_EXPORT
77+
#else // we are using shared lib/dll
78+
#define RVIZ_VISUAL_TOOLS_DECL ROS_HELPER_IMPORT
79+
#endif
80+
#else // ros is being built around static libraries
81+
#define RVIZ_VISUAL_TOOLS_DECL
82+
#endif
83+
7284
namespace rviz_visual_tools
7385
{
7486
// Default constants
@@ -1079,7 +1091,7 @@ class RvizVisualTools
10791091
ros::NodeHandle nh_;
10801092

10811093
// Short name for this class
1082-
static const std::string name_;
1094+
static RVIZ_VISUAL_TOOLS_DECL const std::string name_;
10831095

10841096
// Optional remote control
10851097
RemoteControlPtr remote_control_;

0 commit comments

Comments
 (0)