Fixed colcon build not detected on buildfarm

This commit is contained in:
matlabbe 2022-12-12 08:29:54 -08:00
parent e0328f0261
commit 635efcd622

View File

@ -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()