How to specify a custom rostoolchain.cmake when compiling with catkin?
I'm attempting to cross-compile ROS for ARM on my x86-64 laptop. To do this, I'm trying to run catkin_make_isolated
with this rostoolchain.cmake file:
#File rostoolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
# Have to set this one to BOTH, to allow CMake to find rospack
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
And I'm calling it like:
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_TOOLCHAIN_FILE=/path/to/rostoolchain.cmake -DCMAKE_BUILD_TYPE=Release --install-space /tmp/ros/$ROS_DISTRO -j1
However, the output reports:
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_TOOLCHAIN_FILE
and the compiler shown is "GNU GCC" instead of "arm-linux-gnueabihf-gcc", implying my custom cmake file is being ignored.
How do I fix this? What's the proper way to cross-compile ROS for ARM on x86?
There's almost no documentation of this in the wiki. I found this page, but it's not very descriptive and hasn't been updated in three years.