From b644e70e49761c20c011e0c7f78cdb52940b72ba Mon Sep 17 00:00:00 2001 From: James Xu Date: Fri, 3 Apr 2020 10:33:59 -0700 Subject: [PATCH 1/5] add DLL import/export macro (#118) * windows bringup * rename dll visibility macros (#5) * remove extra empty line (#6) --- .../camera_info_manager/camera_info_manager.h | 16 +++++++++++++++- .../include/image_transport/camera_common.h | 3 ++- .../include/image_transport/camera_publisher.h | 3 ++- .../image_transport/camera_subscriber.h | 3 ++- .../include/image_transport/exports.h | 18 ++++++++++++++++++ .../include/image_transport/image_transport.h | 3 ++- .../include/image_transport/publisher.h | 3 ++- .../single_subscriber_publisher.h | 3 ++- .../include/image_transport/subscriber.h | 3 ++- .../include/polled_camera/publication_server.h | 16 +++++++++++++++- 10 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 image_transport/include/image_transport/exports.h diff --git a/camera_info_manager/include/camera_info_manager/camera_info_manager.h b/camera_info_manager/include/camera_info_manager/camera_info_manager.h index 56bb5d9c..530c485a 100644 --- a/camera_info_manager/include/camera_info_manager/camera_info_manager.h +++ b/camera_info_manager/include/camera_info_manager/camera_info_manager.h @@ -43,6 +43,20 @@ #include #include +#include + +// 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 camera_info_manager_EXPORTS // we are building a shared lib/dll + #define CAMERA_INFO_MANAGER_DECL ROS_HELPER_EXPORT + #else // we are using shared lib/dll + #define CAMERA_INFO_MANAGER_DECL ROS_HELPER_IMPORT + #endif +#else // ros is being built around static libraries + #define CAMERA_INFO_MANAGER_DECL +#endif + /** @file @brief CameraInfo Manager interface @@ -171,7 +185,7 @@ namespace camera_info_manager */ -class CameraInfoManager +class CAMERA_INFO_MANAGER_DECL CameraInfoManager { public: diff --git a/image_transport/include/image_transport/camera_common.h b/image_transport/include/image_transport/camera_common.h index 6b205fd3..b82692c6 100644 --- a/image_transport/include/image_transport/camera_common.h +++ b/image_transport/include/image_transport/camera_common.h @@ -36,6 +36,7 @@ #define IMAGE_TRANSPORT_CAMERA_COMMON_H #include +#include "exports.h" namespace image_transport { @@ -45,7 +46,7 @@ namespace image_transport { * \note This function assumes that the name is completely resolved. If the \c * base_topic is remapped the resulting camera info topic will be incorrect. */ -std::string getCameraInfoTopic(const std::string& base_topic); +IMAGE_TRANSPORT_DECL std::string getCameraInfoTopic(const std::string& base_topic); } //namespace image_transport diff --git a/image_transport/include/image_transport/camera_publisher.h b/image_transport/include/image_transport/camera_publisher.h index 222e68ae..d71809d9 100644 --- a/image_transport/include/image_transport/camera_publisher.h +++ b/image_transport/include/image_transport/camera_publisher.h @@ -39,6 +39,7 @@ #include #include #include "image_transport/single_subscriber_publisher.h" +#include "exports.h" namespace image_transport { @@ -59,7 +60,7 @@ class ImageTransport; * associated with that handle will stop being called. Once all CameraPublisher for a * given base topic go out of scope the topic (and all subtopics) will be unadvertised. */ -class CameraPublisher +class IMAGE_TRANSPORT_DECL CameraPublisher { public: CameraPublisher() {} diff --git a/image_transport/include/image_transport/camera_subscriber.h b/image_transport/include/image_transport/camera_subscriber.h index aef447d9..e769ab69 100644 --- a/image_transport/include/image_transport/camera_subscriber.h +++ b/image_transport/include/image_transport/camera_subscriber.h @@ -39,6 +39,7 @@ #include #include #include "image_transport/transport_hints.h" +#include "exports.h" namespace image_transport { @@ -59,7 +60,7 @@ void callback(const sensor_msgs::ImageConstPtr&, const sensor_msgs::CameraInfoCo * associated with that handle will stop being called. Once all CameraSubscriber for a given * topic go out of scope the topic will be unsubscribed. */ -class CameraSubscriber +class IMAGE_TRANSPORT_DECL CameraSubscriber { public: typedef boost::function + +// 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 image_transport_EXPORTS // we are building a shared lib/dll + #define IMAGE_TRANSPORT_DECL ROS_HELPER_EXPORT + #else // we are using shared lib/dll + #define IMAGE_TRANSPORT_DECL ROS_HELPER_IMPORT + #endif +#else // ros is being built around static libraries + #define IMAGE_TRANSPORT_DECL +#endif + +#endif // IMAGE_TRANSPORT_EXPORTS_H diff --git a/image_transport/include/image_transport/image_transport.h b/image_transport/include/image_transport/image_transport.h index 19579998..9a542e62 100644 --- a/image_transport/include/image_transport/image_transport.h +++ b/image_transport/include/image_transport/image_transport.h @@ -39,6 +39,7 @@ #include "image_transport/subscriber.h" #include "image_transport/camera_publisher.h" #include "image_transport/camera_subscriber.h" +#include "exports.h" namespace image_transport { @@ -48,7 +49,7 @@ namespace image_transport { * ImageTransport is analogous to ros::NodeHandle in that it contains advertise() and * subscribe() functions for creating advertisements and subscriptions of image topics. */ -class ImageTransport +class IMAGE_TRANSPORT_DECL ImageTransport { public: explicit ImageTransport(const ros::NodeHandle& nh); diff --git a/image_transport/include/image_transport/publisher.h b/image_transport/include/image_transport/publisher.h index ec4284d6..6a6c1153 100644 --- a/image_transport/include/image_transport/publisher.h +++ b/image_transport/include/image_transport/publisher.h @@ -40,6 +40,7 @@ #include "image_transport/single_subscriber_publisher.h" #include "image_transport/exception.h" #include "image_transport/loader_fwds.h" +#include "exports.h" namespace image_transport { @@ -60,7 +61,7 @@ namespace image_transport { * associated with that handle will stop being called. Once all Publisher for a * given base topic go out of scope the topic (and all subtopics) will be unadvertised. */ -class Publisher +class IMAGE_TRANSPORT_DECL Publisher { public: Publisher() {} diff --git a/image_transport/include/image_transport/single_subscriber_publisher.h b/image_transport/include/image_transport/single_subscriber_publisher.h index 025a99e3..4168cd78 100644 --- a/image_transport/include/image_transport/single_subscriber_publisher.h +++ b/image_transport/include/image_transport/single_subscriber_publisher.h @@ -38,6 +38,7 @@ #include #include #include +#include "exports.h" namespace image_transport { @@ -45,7 +46,7 @@ namespace image_transport { * \brief Allows publication of an image to a single subscriber. Only available inside * subscriber connection callbacks. */ -class SingleSubscriberPublisher : boost::noncopyable +class IMAGE_TRANSPORT_DECL SingleSubscriberPublisher : boost::noncopyable { public: typedef boost::function GetNumSubscribersFn; diff --git a/image_transport/include/image_transport/subscriber.h b/image_transport/include/image_transport/subscriber.h index f887d59d..22f27223 100644 --- a/image_transport/include/image_transport/subscriber.h +++ b/image_transport/include/image_transport/subscriber.h @@ -40,6 +40,7 @@ #include "image_transport/transport_hints.h" #include "image_transport/exception.h" #include "image_transport/loader_fwds.h" +#include "exports.h" namespace image_transport { @@ -58,7 +59,7 @@ namespace image_transport { * associated with that handle will stop being called. Once all Subscriber for a given * topic go out of scope the topic will be unsubscribed. */ -class Subscriber +class IMAGE_TRANSPORT_DECL Subscriber { public: Subscriber() {} diff --git a/polled_camera/include/polled_camera/publication_server.h b/polled_camera/include/polled_camera/publication_server.h index d270e2a4..4bc3619e 100644 --- a/polled_camera/include/polled_camera/publication_server.h +++ b/polled_camera/include/polled_camera/publication_server.h @@ -40,6 +40,20 @@ #include #include "polled_camera/GetPolledImage.h" +#include + +// 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 polled_camera_EXPORTS // we are building a shared lib/dll + #define POLLED_CAMERA_DECL ROS_HELPER_EXPORT + #else // we are using shared lib/dll + #define POLLED_CAMERA_DECL ROS_HELPER_IMPORT + #endif +#else // ros is being built around static libraries + #define POLLED_CAMERA_DECL +#endif + namespace polled_camera { /** @@ -63,7 +77,7 @@ void callback(polled_camera::GetPolledImage::Request& req, } \endcode */ -class PublicationServer +class POLLED_CAMERA_DECL PublicationServer { public: typedef boost::function Date: Fri, 3 Apr 2020 10:34:17 -0700 Subject: [PATCH 2/5] add indentation, and use _WIN32 instead of WIN32 (#117) --- camera_info_manager/src/camera_info_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/camera_info_manager/src/camera_info_manager.cpp b/camera_info_manager/src/camera_info_manager.cpp index 71d6ef1d..3395453c 100644 --- a/camera_info_manager/src/camera_info_manager.cpp +++ b/camera_info_manager/src/camera_info_manager.cpp @@ -39,7 +39,14 @@ #include #include #include -#include +#ifdef _WIN32 + #ifndef S_ISDIR + #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) + #endif +#else + #include +#endif + #include #include #include From 034c1bad513a3173d1df14aca1ed5ec2e774e2f7 Mon Sep 17 00:00:00 2001 From: James Xu Date: Fri, 3 Apr 2020 10:34:37 -0700 Subject: [PATCH 3/5] export runtime binaries correctly on Windows (#116) * Correct binary locations for shared libraries. * Install plugin DLL to ${CATKIN_PACKAGE_LIB_DESTINATION} Install plugin DLL to ${CATKIN_PACKAGE_LIB_DESTINATION} since it is what the default_plugins.xml defines. * Correct binary locations for shared libraries. * add comment about plugin dll install location Co-authored-by: shschaefer Co-authored-by: Sean Yen [MSFT] --- camera_info_manager/CMakeLists.txt | 4 +++- image_transport/CMakeLists.txt | 7 +++++-- polled_camera/CMakeLists.txt | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/camera_info_manager/CMakeLists.txt b/camera_info_manager/CMakeLists.txt index bcc873f3..7ba1486e 100644 --- a/camera_info_manager/CMakeLists.txt +++ b/camera_info_manager/CMakeLists.txt @@ -18,7 +18,9 @@ add_library(${PROJECT_NAME} src/camera_info_manager.cpp) target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) install(TARGETS ${PROJECT_NAME} - DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} COMPONENT main ) install(DIRECTORY include/${PROJECT_NAME}/ diff --git a/image_transport/CMakeLists.txt b/image_transport/CMakeLists.txt index 6e43f2fd..21a62c75 100644 --- a/image_transport/CMakeLists.txt +++ b/image_transport/CMakeLists.txt @@ -37,12 +37,15 @@ target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ) -# Build libimage_transport_plugins +# Build libimage_transport_plugins add_library(${PROJECT_NAME}_plugins src/manifest.cpp src/raw_publisher.cpp) target_link_libraries(${PROJECT_NAME}_plugins ${PROJECT_NAME}) +# Install plugin DLL to ${CATKIN_PACKAGE_LIB_DESTINATION} according to the path in default_plugins.xml install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_plugins - DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} COMPONENT main ) install(DIRECTORY include/${PROJECT_NAME}/ diff --git a/polled_camera/CMakeLists.txt b/polled_camera/CMakeLists.txt index ca29988c..eb95f75f 100644 --- a/polled_camera/CMakeLists.txt +++ b/polled_camera/CMakeLists.txt @@ -26,7 +26,9 @@ add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EX target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) install(TARGETS ${PROJECT_NAME} - DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} From 838f094220660c918750d6734b3da3522c273342 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Fri, 3 Apr 2020 12:42:05 -0500 Subject: [PATCH 4/5] Changelogs Signed-off-by: Michael Carroll --- camera_calibration_parsers/CHANGELOG.rst | 3 +++ camera_info_manager/CHANGELOG.rst | 7 +++++++ image_common/CHANGELOG.rst | 3 +++ image_transport/CHANGELOG.rst | 6 ++++++ polled_camera/CHANGELOG.rst | 6 ++++++ 5 files changed, 25 insertions(+) diff --git a/camera_calibration_parsers/CHANGELOG.rst b/camera_calibration_parsers/CHANGELOG.rst index 3ab58ab7..547fa887 100644 --- a/camera_calibration_parsers/CHANGELOG.rst +++ b/camera_calibration_parsers/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package camera_calibration_parsers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 1.11.13 (2017-11-05) -------------------- * Use Boost_LIBRARIES instead of Boost_PYTHON_LIBRARY diff --git a/camera_info_manager/CHANGELOG.rst b/camera_info_manager/CHANGELOG.rst index cf0dcefc..5e600c0b 100644 --- a/camera_info_manager/CHANGELOG.rst +++ b/camera_info_manager/CHANGELOG.rst @@ -2,6 +2,13 @@ Changelog for package camera_info_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* export runtime binaries correctly on Windows (`#116 `_) +* add indentation, and use _WIN32 instead of WIN32 (`#117 `_) +* add DLL import/export macro (`#118 `_) +* Contributors: James Xu + 1.11.13 (2017-11-05) -------------------- * Fix the find_package(catkin) redundancy diff --git a/image_common/CHANGELOG.rst b/image_common/CHANGELOG.rst index 3b5454c3..8f0787ee 100644 --- a/image_common/CHANGELOG.rst +++ b/image_common/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package image_common ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 1.11.13 (2017-11-05) -------------------- diff --git a/image_transport/CHANGELOG.rst b/image_transport/CHANGELOG.rst index d8f91998..ed0ddd8e 100644 --- a/image_transport/CHANGELOG.rst +++ b/image_transport/CHANGELOG.rst @@ -2,6 +2,12 @@ Changelog for package image_transport ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* export runtime binaries correctly on Windows (`#116 `_) +* add DLL import/export macro (`#118 `_) +* Contributors: James Xu + 1.11.13 (2017-11-05) -------------------- * Disable image publisher plugins by name (`#60 `_) diff --git a/polled_camera/CHANGELOG.rst b/polled_camera/CHANGELOG.rst index be43a8d8..e9e33f64 100644 --- a/polled_camera/CHANGELOG.rst +++ b/polled_camera/CHANGELOG.rst @@ -2,6 +2,12 @@ Changelog for package polled_camera ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* export runtime binaries correctly on Windows (`#116 `_) +* add DLL import/export macro (`#118 `_) +* Contributors: James Xu + 1.11.13 (2017-11-05) -------------------- From 6f57c7fc693dfabca86c232ae73af1556ea3c02b Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Fri, 3 Apr 2020 12:42:22 -0500 Subject: [PATCH 5/5] 1.11.14 --- camera_calibration_parsers/CHANGELOG.rst | 4 ++-- camera_calibration_parsers/package.xml | 2 +- camera_info_manager/CHANGELOG.rst | 4 ++-- camera_info_manager/package.xml | 2 +- image_common/CHANGELOG.rst | 4 ++-- image_common/package.xml | 2 +- image_transport/CHANGELOG.rst | 4 ++-- image_transport/package.xml | 2 +- polled_camera/CHANGELOG.rst | 4 ++-- polled_camera/package.xml | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/camera_calibration_parsers/CHANGELOG.rst b/camera_calibration_parsers/CHANGELOG.rst index 547fa887..2656ee03 100644 --- a/camera_calibration_parsers/CHANGELOG.rst +++ b/camera_calibration_parsers/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package camera_calibration_parsers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +1.11.14 (2020-04-03) +-------------------- 1.11.13 (2017-11-05) -------------------- diff --git a/camera_calibration_parsers/package.xml b/camera_calibration_parsers/package.xml index 4f9a7faa..7494ae84 100644 --- a/camera_calibration_parsers/package.xml +++ b/camera_calibration_parsers/package.xml @@ -1,6 +1,6 @@ camera_calibration_parsers - 1.11.13 + 1.11.14 camera_calibration_parsers contains routines for reading and writing camera calibration parameters. diff --git a/camera_info_manager/CHANGELOG.rst b/camera_info_manager/CHANGELOG.rst index 5e600c0b..984eb42f 100644 --- a/camera_info_manager/CHANGELOG.rst +++ b/camera_info_manager/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package camera_info_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +1.11.14 (2020-04-03) +-------------------- * export runtime binaries correctly on Windows (`#116 `_) * add indentation, and use _WIN32 instead of WIN32 (`#117 `_) * add DLL import/export macro (`#118 `_) diff --git a/camera_info_manager/package.xml b/camera_info_manager/package.xml index a7711992..b01941bc 100644 --- a/camera_info_manager/package.xml +++ b/camera_info_manager/package.xml @@ -1,6 +1,6 @@ camera_info_manager - 1.11.13 + 1.11.14 This package provides a C++ interface for camera calibration diff --git a/image_common/CHANGELOG.rst b/image_common/CHANGELOG.rst index 8f0787ee..37883292 100644 --- a/image_common/CHANGELOG.rst +++ b/image_common/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package image_common ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +1.11.14 (2020-04-03) +-------------------- 1.11.13 (2017-11-05) -------------------- diff --git a/image_common/package.xml b/image_common/package.xml index ce1565b8..b78a7fd5 100644 --- a/image_common/package.xml +++ b/image_common/package.xml @@ -1,6 +1,6 @@ image_common - 1.11.13 + 1.11.14 Common code for working with images in ROS. Patrick Mihelich James Bowman diff --git a/image_transport/CHANGELOG.rst b/image_transport/CHANGELOG.rst index ed0ddd8e..db283bc6 100644 --- a/image_transport/CHANGELOG.rst +++ b/image_transport/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package image_transport ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +1.11.14 (2020-04-03) +-------------------- * export runtime binaries correctly on Windows (`#116 `_) * add DLL import/export macro (`#118 `_) * Contributors: James Xu diff --git a/image_transport/package.xml b/image_transport/package.xml index e77d7e40..78742673 100644 --- a/image_transport/package.xml +++ b/image_transport/package.xml @@ -1,6 +1,6 @@ image_transport - 1.11.13 + 1.11.14 image_transport should always be used to subscribe to and publish images. It provides transparent diff --git a/polled_camera/CHANGELOG.rst b/polled_camera/CHANGELOG.rst index e9e33f64..79d83987 100644 --- a/polled_camera/CHANGELOG.rst +++ b/polled_camera/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package polled_camera ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +1.11.14 (2020-04-03) +-------------------- * export runtime binaries correctly on Windows (`#116 `_) * add DLL import/export macro (`#118 `_) * Contributors: James Xu diff --git a/polled_camera/package.xml b/polled_camera/package.xml index 5bc24719..00902420 100644 --- a/polled_camera/package.xml +++ b/polled_camera/package.xml @@ -1,6 +1,6 @@ polled_camera - 1.11.13 + 1.11.14 polled_camera contains a service and C++ helper classes for implementing a polled