Skip to content

Commit 5d33dfd

Browse files
committed
Adding catkin_package cmd in CMakeLists to read package version in code
1 parent 2b6cfe8 commit 5d33dfd

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES aarch64 OR arm)
113113

114114
endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES aarch64 OR arm)
115115

116+
# Make package version available in CPP as a defination
117+
add_definitions("-D${PROJECT_NAME}_VERSION=\"${${PROJECT_NAME}_VERSION}\"")
118+
116119
add_library (acquilib SHARED
117120
src/capture.cpp
118121
src/camera.cpp

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package format="2">
33
<name>spinnaker_sdk_camera_driver</name>
4-
<version>0.0.0</version>
4+
<version>1.1.0</version>
55
<description>Point Grey (FLIR) Spinnaker based camera driver (Blackfly S etc.)</description>
66

77
<maintainer email="vikrantshah+ros@gmail.com">Vikrant Shah</maintainer>

src/capture.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void acquisition::Capture::init_variables_register_to_ros() {
139139
// Retrieve singleton reference to system object
140140
ROS_INFO_STREAM("*** SYSTEM INFORMATION ***");
141141
ROS_INFO_STREAM("Creating system instance...");
142+
ROS_INFO_STREAM("spinnaker_sdk_camera_driver package version: " << spinnaker_sdk_camera_driver_VERSION);
142143
system_ = System::GetInstance();
143144

144145
const LibraryVersion spinnakerLibraryVersion = system_->GetLibraryVersion();

0 commit comments

Comments
 (0)