1 #------------------------------------------------------------------------- 2 # drawElements CMake utilities 3 # ---------------------------- 4 # 5 # Copyright 2016 The Android Open Source Project 6 # 7 # Licensed under the Apache License, Version 2.0 (the "License"); 8 # you may not use this file except in compliance with the License. 9 # You may obtain a copy of the License at 10 # 11 # http://www.apache.org/licenses/LICENSE-2.0 12 # 13 # Unless required by applicable law or agreed to in writing, software 14 # distributed under the License is distributed on an "AS IS" BASIS, 15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 # See the License for the specific language governing permissions and 17 # limitations under the License. 18 # 19 #------------------------------------------------------------------------- 20 21 # Platform defines. 22 set(CMAKE_SYSTEM_NAME Linux) 23 set(CMAKE_CROSSCOMPILING 1) 24 set(DE_CPU "DE_CPU_ARM") 25 26 # Toolchain/compiler base. 27 set(CC_PATH "/opt/raspi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi" CACHE STRING "Cross compiler path") 28 set(CROSS_COMPILE "${CC_PATH}/bin/arm-bcm2708hardfp-linux-gnueabi-" CACHE STRING "Cross compiler prefix") 29 set(SYSROOT_PATH "${CC_PATH}/arm-bcm2708hardfp-linux-gnueabi/sysroot" CACHE STRING "Raspbian sysroot path") 30 31 set(CMAKE_C_COMPILER "${CROSS_COMPILE}gcc") 32 set(CMAKE_CXX_COMPILER "${CROSS_COMPILE}g++") 33 34 # Search libs and include files (but not programs) from toolchain dir. 35 set(CMAKE_FIND_ROOT_PATH ${SYSROOT_PATH}) 36 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 37 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 38 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 39 40 set(TARGET_C_FLAGS "") 41 set(CMAKE_C_FLAGS "${TARGET_C_FLAGS}" CACHE STRING "" FORCE) 42 set(CMAKE_CXX_FLAGS "${TARGET_C_FLAGS}" CACHE STRING "" FORCE) 43