Skip to content

Commit

Permalink
Fixed android build (res tool not found)
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Sep 4, 2022
1 parent 69b0cae commit f1c987a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions utilite/resource_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@ if (CMAKE_CROSSCOMPILING OR ANDROID OR IOS)
# The target named 'res_tool' can be used elsewhere in all cases, when cross compiling or not.

IF(NOT RTABMAP_RES_TOOL)
FIND_PROGRAM(RTABMAP_RES_TOOL ${PROJECT_PREFIX}-res_tool)
IF (COMMAND find_host_program)
# On android docker build
MESSAGE(STATUS "Looking for ${PROJECT_PREFIX}-res tool in ${PROJECT_BINARY_DIR}/../bin")
FIND_HOST_PROGRAM( RTABMAP_RES_TOOL ${PROJECT_PREFIX}-res_tool PATHS ${PROJECT_BINARY_DIR}/../bin NO_DEFAULT_PATH)
IF(NOT RTABMAP_RES_TOOL)
MESSAGE( FATAL_ERROR "RTABMAP_RES_TOOL is not defined (it is the path to \"rtabmap-res_tool\" application created by a non-Android build)." )
MESSAGE(STATUS "Looking for ${PROJECT_PREFIX}-res tool on host system")
FIND_HOST_PROGRAM( RTABMAP_RES_TOOL ${PROJECT_PREFIX}-res_tool)
ENDIF(NOT RTABMAP_RES_TOOL)
ENDIF()
ELSE()
MESSAGE(STATUS "Looking for ${PROJECT_PREFIX}-res tool on host system")
FIND_PROGRAM( RTABMAP_RES_TOOL ${PROJECT_PREFIX}-res_tool )
ENDIF()
IF(NOT RTABMAP_RES_TOOL)
MESSAGE( FATAL_ERROR "RTABMAP_RES_TOOL is not defined (it is the path to \"${PROJECT_PREFIX}-res_tool\" application created by a non-Android build)." )
ENDIF(NOT RTABMAP_RES_TOOL)
ENDIF(NOT RTABMAP_RES_TOOL)

MESSAGE(STATUS "Using res_tool at ${RTABMAP_RES_TOOL}")

Expand Down

0 comments on commit f1c987a

Please sign in to comment.