forked from rapyuta-robotics/ros12_bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (45 loc) · 1.69 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 2.8.3)
project(ros12_bridge)
##################
## Dependencies ##
##################
## add in all packages here that are required to be converted an bridged between 1 and 2
# think of this a meta depend list
set(PKG_DEPS
#mycustompackage_msgs
)
find_package(catkin REQUIRED COMPONENTS ${PKG_DEPS})
######################
## ROS2 Build Steps ##
######################
option(CMAKE_FORCE_ROS12_REBUILD "Force Ros12 Bridge rebuild" OFF)
if ("$ENV{ROS2_WS_PATH}" STREQUAL "")
message(FATAL_ERROR "env var ROS2_WS_PATH is undefined" )
endif()
if ("$ENV{ROS1_WS_PATH}" STREQUAL "")
message(FATAL_ERROR "env var ROS1_WS_PATH is undefined" )
endif()
if (CMAKE_FORCE_ROS12_REBUILD)
set(cleanros2 "--clean-all")
message(WARNING "Using the clean all option `${cleanros2}`.\nBe patient this might take ~10 minutes\nTo unset it `--cmake-args -DCMAKE_FORCE_ROS12_REBUILD=OFF`")
else()
set(cleanros2 "--no-clean-bridge")
message(STATUS "Will check for changes.\nTo force a rebuild use `--cmake-args -DCMAKE_FORCE_ROS12_REBUILD=ON`")
endif()
message(STATUS "Entering the ROS2 build context.")
add_custom_target( build_ros1_bridge_in_ros2_ws ALL
COMMAND ./ros2_builder "${cleanros2}" --file=../pkg_build_config.yaml
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resource/
COMMENT "building ros2 parts"
SOURCES pkg_build_config.yaml
)
##############
catkin_package(
CATKIN_DEPENDS ${PKG_DEPS}
)
catkin_install_python(PROGRAMS scripts/ros12_bridge
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)
install(DIRECTORY config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config)