Skip to content

Commit 56e2c2c

Browse files
committed
add check ROS_DISTRO in CMAKE
Signed-off-by: Hyungyu Kim <[email protected]>
1 parent b546ed0 commit 56e2c2c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

turtlebot3_panorama/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ if(DEFINED ENV{ROS_DISTRO})
1616
set(ROS_DISTRO $ENV{ROS_DISTRO})
1717
endif()
1818

19+
if(NOT DEFINED ROS_DISTRO OR ROS_DISTRO STREQUAL "")
20+
execute_process(
21+
COMMAND printenv ROS_DISTRO
22+
OUTPUT_VARIABLE ROS_DISTRO
23+
OUTPUT_STRIP_TRAILING_WHITESPACE
24+
)
25+
endif()
26+
27+
if(NOT DEFINED ROS_DISTRO OR ROS_DISTRO STREQUAL "")
28+
message(WARNING "ROS_DISTRO is not defined.")
29+
endif()
30+
1931
if(ROS_DISTRO STREQUAL "humble")
2032
add_definitions(-DROS2_HUMBLE)
2133
elseif(ROS_DISTRO STREQUAL "jazzy" OR ROS_DISTRO STREQUAL "rolling")

0 commit comments

Comments
 (0)