aboutsummaryrefslogtreecommitdiff
path: root/cmake/CMakeARMToolChain.txt
blob: 9d6847bdf79721d176c8956cc730489c10931c08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

SET(CMAKE_SYSTEM_PROCESSOR ARM)
SET(HAWKING_CROSS_COMPILE ON)

# specify the cross compiler
SET(CMAKE_C_COMPILER   arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)

# For external builds, paths to dependent libraries/packages are assumed to
# be specified by environment variables.
# For internal development builds setup a default path for dependent libs/pkgs
if ("$ENV{DEFAULT_DEV_INSTALL_DIR}" STREQUAL "")
   set(DEFAULT_DEV_INSTALL_DIR /opt/ti)
else()
   set(DEFAULT_DEV_INSTALL_DIR $ENV{DEFAULT_DEV_INSTALL_DIR})
endif()

# Point to the development kit file system where we should get ARM
# libraries and headers
if ("$ENV{LINUX_DEVKIT_ROOT}" STREQUAL "")
   SET(LINUX_DEVKIT_ROOT ${DEFAULT_DEV_INSTALL_DIR}/mcsdk_linux_3_00_04_18/linux-devkit/arago-2013.12/sysroots/cortexa15hf-vfp-neon-3.8-oe-linux-gnueabi)
   MESSAGE(STATUS "Environment variable LINUX_DEVKIT_ROOT not set. "
                  "Assuming the linux devkit filesystem is installed "
                  "at ${LINUX_DEVKIT_ROOT}")
else()
   SET(LINUX_DEVKIT_ROOT $ENV{LINUX_DEVKIT_ROOT})
endif()


SET(CMAKE_FIND_ROOT_PATH  ${LINUX_DEVKIT_ROOT}/usr/include 
                          ${LINUX_DEVKIT_ROOT}/usr/lib )
MESSAGE(STATUS "Devkit installation at " ${LINUX_DEVKIT_ROOT})

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)

# The OpenCL package has dependencies on some non-system headers (BOOST, GL)
# The cross compiler will not include the host machine's /usr/include
# directory in it's default search so we need to explicitly add it to 
# include_directories().  HOWEVER, CMAKE will ignore attempts to 
# add '/usr/include' to include_directories(). Hence the '../' in the
# path specified here.
# NOTE: Ensure this appears in the include list after target system headers
#       (search for references to CMAKE_FIND_ROOT_PATH)
set(HOST_USR_INCLUDE_PATH /usr/include/../include)