1 # Platform defines. 2 set(CMAKE_SYSTEM_NAME Linux) 3 set(CMAKE_CROSSCOMPILING 1) 4 set(DE_CPU "DE_CPU_ARM") 5 6 # Toolchain/compiler base. 7 set(CC_PATH "/opt/raspi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi" CACHE STRING "Cross compiler path") 8 set(CROSS_COMPILE "${CC_PATH}/bin/arm-bcm2708hardfp-linux-gnueabi-" CACHE STRING "Cross compiler prefix") 9 set(SYSROOT_PATH "${CC_PATH}/arm-bcm2708hardfp-linux-gnueabi/sysroot" CACHE STRING "Raspbian sysroot path") 10 11 set(CMAKE_C_COMPILER "${CROSS_COMPILE}gcc") 12 set(CMAKE_CXX_COMPILER "${CROSS_COMPILE}g++") 13 14 # Search libs and include files (but not programs) from toolchain dir. 15 set(CMAKE_FIND_ROOT_PATH ${SYSROOT_PATH}) 16 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 17 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 18 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 19 20 set(TARGET_C_FLAGS "") 21 set(CMAKE_C_FLAGS "${TARGET_C_FLAGS}" CACHE STRING "" FORCE) 22 set(CMAKE_CXX_FLAGS "${TARGET_C_FLAGS}" CACHE STRING "" FORCE) 23