Skip to content

Commit

Permalink
Fixed colcon build not detected on buildfarm
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Dec 12, 2022
1 parent e0328f0 commit 635efcd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ IF(CATKIN_TOPLEVEL OR CATKIN_BUILD_BINARY_PACKAGE OR CATKIN_SKIP_TESTING OR CATK
SET(CATKIN_BUILD TRUE)
ELSE()
# Detect if it is called by colcon (ros2)
string(FIND ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} POS)
IF(${POS} EQUAL -1)
SET(COLCON_BUILD TRUE)
IF(DEFINED AMENT_PREFIX_PATH) # buildfarm
SET(COLCON_BUILD TRUE)
ELSE() # colcon local build in ros2_ws
string(FIND ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} POS)
IF(${POS} EQUAL -1)
SET(COLCON_BUILD TRUE)
ENDIF()
ENDIF()
ENDIF()

Expand Down

0 comments on commit 635efcd

Please sign in to comment.