-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
64 lines (43 loc) · 1.81 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
56
57
58
59
60
cmake_minimum_required(VERSION 3.14)
message(STATUS "Configuring CMake for nRF5 SDK")
set(CMAKE_SYSTEM_NAME "Generic")
set(CMAKE_SYSTEM_PROCESSOR "ARM")
project(nrf52_template LANGUAGES NONE)
set(CMAKE_CONFIG_DIR "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR} CACHE STRING "" FORCE)
string(TIMESTAMP BUILD_DATE "%Y%m%d%H%M")
add_custom_target(pristine
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CONFIG_DIR}/pristine.cmake
# Equivalent to rm -rf build/*
)
include("${CMAKE_CONFIG_DIR}/toolchain.cmake")
include("${CMAKE_CONFIG_DIR}/platform.cmake")
include("${CMAKE_CONFIG_DIR}/softdevice.cmake")
include("${CMAKE_CONFIG_DIR}/finddependency.cmake")
include("${CMAKE_CONFIG_DIR}/findsdk.cmake")
# We have to return manually from here s.t. the CMake generation
# doesn't stop and we have the nRF5_SDK target available.
if (NOT SDK_ROOT)
return()
endif ()
include("${CMAKE_CONFIG_DIR}/git.cmake")
include("${CMAKE_CONFIG_DIR}/version.cmake")
include("${CMAKE_CONFIG_DIR}/sdk/${nRF5_SDK_VERSION}.cmake")
include("${CMAKE_CONFIG_DIR}/platform/${PLATFORM}.cmake")
include("${CMAKE_CONFIG_DIR}/softdevice/${SOFTDEVICE}.cmake")
message(STATUS "SDK: ${nRF5_SDK_VERSION}")
message(STATUS "Platform: ${PLATFORM}")
message(STATUS "Arch: ${${PLATFORM}_ARCH}")
message(STATUS "SoftDevice: ${SOFTDEVICE}")
configure_file(version.h.in ${CMAKE_SOURCE_DIR}/apps/app/config/version.h)
set(SDK_BOOTLOADER_HEX_FILE "${CMAKE_SOURCE_DIR}/apps/dfu/sdk_bootloader_hex/nrf52810_xxaa_s112.hex")
set(KEY_FILE "${CMAKE_SOURCE_DIR}/private.key")
set(ARCH ${${PLATFORM}_ARCH})
enable_language(C ASM)
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
include("${CMAKE_CONFIG_DIR}/nrfjprog.cmake")
add_subdirectory(apps/app)
add_subdirectory(apps/factory_test)
add_subdirectory(apps/dfu)