blob: dc6d565459ca2727d38144d4894e02406b6e5faf (
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
54
55
56
|
set(CMAKE_SYSTEM_VERSION 1)
set(OS "@platform_os@")
set(CPU "@use_cpu@")
set(PLATFORM "@use_platform@")
if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android")
set(CMAKE_SYSTEM_NAME Linux)
endif()
set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@)
# set special CORE_SYSTEM_NAME
if("${OS}" STREQUAL "android")
set(CORE_SYSTEM_NAME android)
list(APPEND CMAKE_FIND_ROOT_PATH @use_toolchain@/sysroot/usr)
elseif("${OS}" STREQUAL "osx")
set(CORE_SYSTEM_NAME osx)
elseif("${OS}" STREQUAL "ios")
set(CORE_SYSTEM_NAME ios)
elseif("${PLATFORM}" STREQUAL "raspberry-pi")
set(CORE_SYSTEM_NAME rbpi)
list(APPEND CMAKE_FIND_ROOT_PATH @use_firmware@/opt/vc)
set(CMAKE_LIBRARY_PATH @CMAKE_FIND_ROOT_PATH@/lib:@use_firmware@/opt/vc/lib)
set(CMAKE_INCLUDE_PATH @CMAKE_FIND_ROOT_PATH@/include:@use_firmware@/opt/vc/include)
endif()
if("${OS}" STREQUAL "ios" OR "${OS}" STREQUAL "osx")
set(CMAKE_OSX_SYSROOT @use_sdk_path@)
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT}/usr /usr/X11R6)
set(CMAKE_LIBRARY_PATH @CMAKE_FIND_ROOT_PATH@/lib:@use_sdk_path@/lib:/usr/X11R6/lib)
set(CMAKE_INCLUDE_PATH @CMAKE_FIND_ROOT_PATH@/include:@use_sdk_path@/include:/usr/X11R6/include)
endif()
# specify the cross compiler
set(CMAKE_C_COMPILER @CC@)
set(CMAKE_CXX_COMPILER @CXX@)
set(CMAKE_AR @AR@ CACHE FILEPATH "Archiver")
set(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker")
set(CMAKE_C_FLAGS "@platform_cflags@ @platform_includes@")
set(CMAKE_CXX_FLAGS "@platform_cxxflags@ @platform_includes@")
set(CMAKE_CPP_FLAGS "@platform_cflags@ @platform_includes@")
set(CMAKE_LD_FLAGS "@platform_ldflags@")
set(ENV{CFLAGS} ${CMAKE_C_FLAGS})
set(ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS})
set(ENV{CPPFLAGS} ${CMAKE_CPP_FLAGS})
set(ENV{LDFLAGS} ${CMAKE_LD_FLAGS})
# 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)
if(NOT OS STREQUAL "linux")
set(ADDONS_PREFER_STATIC_LIBS ON)
endif()
|