forked from dji-sdk/Payload-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (46 loc) · 1.98 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
if (NOT USE_SYSTEM_ARCH)
# select use platform 'LINUX' or 'RTOS' here, reset cache and reload cmake project
set(USE_SYSTEM_ARCH LINUX)
endif ()
if (USE_SYSTEM_ARCH MATCHES RTOS)
cmake_minimum_required(VERSION 3.15)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_AR arm-none-eabi-ar)
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
set(CMAKE_OBJDUMP arm-none-eabi-objdump)
set(SIZE arm-none-eabi-size)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
endif ()
project(entry)
# Disable in-source builds to prevent source tree corruption.
if (" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "FATAL: In-source builds are not allowed.
You should create a separate directory for build files.")
endif ()
if (USE_SYSTEM_ARCH MATCHES LINUX)
add_definitions(-DSYSTEM_ARCH_LINUX)
add_subdirectory(samples/sample_c/platform/linux/manifold2)
add_subdirectory(samples/sample_c++/platform/linux/manifold2)
#add_subdirectory(samples/sample_c/platform/rtos_freertos/stm32f4_discovery/drivers)
execute_process(COMMAND uname -m OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
if (DEVICE_SYSTEM_ID MATCHES x86_64)
set(LIBRARY_PATH psdk_lib/lib/x86_64-linux-gnu-gcc)
elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
set(LIBRARY_PATH psdk_lib/lib/aarch64-linux-gnu-gcc)
else ()
message(FATAL_ERROR "FATAL: Please confirm your platform.")
endif ()
# install(FILES ${LIBRARY_PATH}/libpayloadsdk.a
# DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
# )
# install(DIRECTORY psdk_lib/include
# DESTINATION "${CMAKE_INSTALL_PREFIX}"
# )
elseif (USE_SYSTEM_ARCH MATCHES RTOS)
add_definitions(-DSYSTEM_ARCH_RTOS)
add_subdirectory(samples/sample_c/platform/rtos_freertos/stm32f4_discovery/project/armgcc)
endif ()
add_custom_target(${PROJECT_NAME} ALL)