1 set(CMAKE_SYSTEM_NAME Linux)
2 set(CMAKE_SYSTEM_VERSION 1)
3 set(CMAKE_SYSTEM_PROCESSOR arm)
5 set(GCC_COMPILER_VERSION "4.6" CACHE STRING "GCC Compiler version")
7 set(FLOAT_ABI_SUFFIX "")
10 set(FLOAT_ABI_SUFFIX "hf")
13 set(CMAKE_C_COMPILER arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-gcc-${GCC_COMPILER_VERSION})
14 set(CMAKE_CXX_COMPILER arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-g++-${GCC_COMPILER_VERSION})
15 set(ARM_LINUX_SYSROOT /usr/arm-linux-gnueabi${FLOAT_ABI_SUFFIX} CACHE PATH "ARM cross compilation system root")
17 set(CMAKE_CXX_FLAGS "" CACHE STRING "c++ flags")
18 set(CMAKE_C_FLAGS "" CACHE STRING "c flags")
19 set(CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "shared linker flags")
20 set(CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "module linker flags")
21 set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc" CACHE STRING "executable linker flags")
23 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi")
24 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi")
26 set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_SHARED_LINKER_FLAGS}")
27 set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_MODULE_LINKER_FLAGS}")
28 set(CMAKE_EXE_LINKER_FLAGS "-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_EXE_LINKER_FLAGS}")
31 message(WARNING "You use obsolete variable USE_NEON to enable NEON instruction set. Use -DENABLE_NEON=ON instead." )
34 message(WARNING "You use obsolete variable USE_VFPV3 to enable VFPV3 instruction set. Use -DENABLE_VFPV3=ON instead." )
35 set(ENABLE_VFPV3 TRUE)
38 set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${ARM_LINUX_SYSROOT})
40 if(EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
41 set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CUDA_TOOLKIT_ROOT_DIR})
44 set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
45 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
46 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
47 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
49 # macro to find programs on the host OS
50 macro( find_host_program )
51 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
52 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )
53 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
54 if( CMAKE_HOST_WIN32 )
57 elseif( CMAKE_HOST_APPLE )
61 find_program( ${ARGN} )
65 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
66 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
67 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
70 # macro to find packages on the host OS
71 macro( find_host_package )
72 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
73 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )
74 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
75 if( CMAKE_HOST_WIN32 )
78 elseif( CMAKE_HOST_APPLE )
82 find_package( ${ARGN} )
86 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
87 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
88 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )