# arm-linux-gnueabihf.cmake
# CMake toolchain file for ARM Linux cross-compilation
# Set the target systemset(CMAKE_SYSTEM_NAME Linux)set(CMAKE_SYSTEM_PROCESSOR arm)
# Specify the cross compilerset(CMAKE_C_COMPILER "d:/program/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc.exe")set(CMAKE_CXX_COMPILER "d:/program/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++.exe")
# Where is the target environment locatedset(CMAKE_FIND_ROOT_PATH "d:/program/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf")
# Adjust the default behavior of the FIND_XXX() commands:# search programs in the host environmentset(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# search headers and libraries in the target environmentset(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# Don't use Windows-specific settingsset(WIN32 FALSE)set(UNIX TRUE)
# Explicitly set the system name to Linux to ensure proper platform detectionset(CMAKE_SYSTEM_NAME Linux)来源:CSDN 原文,首次发布于 2025-06-17。