set(CMAKE_SYSTEM_NAMELinux)set(CMAKE_SYSTEM_PROCESSORaarch64)# Change to match your target architectureset(CROSS_COMPILER_PATH/home/user/cross_compilers/aarch64--glibc--stable-2022.08-1)# Set cross-compiler pathsset(CMAKE_C_COMPILER${CROSS_COMPILER_PATH}/bin/${CMAKE_SYSTEM_PROCESSOR}-buildroot-linux-gnu-gcc)set(CMAKE_CXX_COMPILER${CROSS_COMPILER_PATH}/bin/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu-g++)set(CMAKE_SYSROOT/home/user/rootfs/ubuntuRootFS)# Set to your root filesystem# Set where CMake should look for libraries and headersset(CMAKE_FIND_ROOT_PATH${CMAKE_SYSROOT}${CMAKE_SYSROOT}/usr${CMAKE_SYSROOT}/usr/local)# Only search inside the target rootfsset(CMAKE_FIND_ROOT_PATH_MODE_PROGRAMNEVER)set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARYONLY)set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDEONLY)# ROS 2 pathsset(AMENT_PREFIX_PATH${CMAKE_SYSROOT}/opt/ros/humble)set(CMAKE_PREFIX_PATH${AMENT_PREFIX_PATH})