-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
55 lines (45 loc) · 1.37 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 3.6)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
project(nrf52_ble_app_template)
# Load machine-specific definitions (edit and rename environment.cmake.template)
include(environment.cmake)
# Enable "fake cross-platform" build.
set(CMAKE_SYSROOT ${ARM_COMPILER_ROOT})
# 1) Include CMSIS directories as system include directories
include_directories(BEFORE SYSTEM
"${ARM_COMPILER_ROOT}/include"
"${CMSIS_ROOT}/Include"
)
# 2) Include this directory, to find cmake_cross_platform.h
include_directories(.)
# 3) Trick compiler into ignoring the host machine and compiler
add_definitions(
# Undefine all host definitions.
-include cmake_cross_platform.h
# Fake the ARM Compiler
-D__ARMCC_VERSION=${ARM_COMPILER_VERSION}
)
# Inluce properties derived from the Keil uVision Project File
include(ble_app_template.cmake)
add_definitions(
${DEFINES_COMMON}
${DEFINES_ASM}
${DEFINES_C}
)
remove_definitions(
${UNDEFINES_COMMON}
${UNDEFINES_ASM}
${UNDEFINES_C}
)
include_directories(
${INCLUDE_DIRS_COMMON}
${INCLUDE_DIRS_ASM}
${INCLUDE_DIRS_C}
CMSIS/Include # Additional CMSIS includes for NVIC functions
)
add_executable(${PROJECT_NAME}
${SOURCES_COMMON}
${SOURCES_ASM}
${SOURCES_C}
)