File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.8)
2
2
project (witmotion_ros)
3
3
4
+ # VERSIONING
5
+ if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /witmotion-uart-qt/version" )
6
+ message (FATAL_ERROR "witmotion-uart-qt directory does not contain submodule data. Please update submodules to compile the underlying library in-place for ROS integration" )
7
+ endif (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /witmotion-uart-qt/version" )
8
+ execute_process (COMMAND git rev-parse --short HEAD
9
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
10
+ OUTPUT_VARIABLE COMMIT_ID
11
+ OUTPUT_STRIP_TRAILING_WHITESPACE
12
+ )
13
+ file (STRINGS "witmotion-uart-qt/version" PROJECT_VERSION)
14
+ if (CMAKE_BUILD_TYPE STREQUAL "Release" )
15
+ set (PROJECT_VERSION "${PROJECT_VERSION} " )
16
+ else (CMAKE_BUILD_TYPE STREQUAL "Release" )
17
+ set (PROJECT_VERSION "${PROJECT_VERSION} ~dev_${COMMIT_ID} " )
18
+ endif (CMAKE_BUILD_TYPE STREQUAL "Release" )
19
+ message (STATUS "Building version ${PROJECT_VERSION} " )
20
+ string (REGEX MATCH "[0-9]*\. [0-9]*\. [0-9]*" modified_version ${PROJECT_VERSION} )
21
+ file (READ ${CMAKE_CURRENT_SOURCE_DIR} /package.xml package_data)
22
+ string (REGEX REPLACE "\< version\> .*\<\/ version\> " "\< version\> ${modified_version} \<\/ version\> " package_data "${package_data} " )
23
+ file (WRITE ${CMAKE_CURRENT_SOURCE_DIR} /package.xml "${package_data} " )
24
+
4
25
add_compile_options (-std=gnu++14)
5
26
6
27
set (CMAKE_BUILD_TYPE Release)
Original file line number Diff line number Diff line change 1
1
<package format =" 2" >
2
2
<name >witmotion_ros</name >
3
- <version >0.0.1 </version >
3
+ <version >0.8.22 </version >
4
4
<description >Standalone QT-based IMU/GPS decoder nodes for Witmotion UART-compatible sensor devices</description >
5
5
6
6
<
maintainer email =
" [email protected] " >Andrey Vukolov</
maintainer >
You can’t perform that action at this time.
0 commit comments