forked from lancaster-university/codal-nrf52
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·47 lines (36 loc) · 1.24 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
project(codal-nrf52)
string(FIND "${device.processor}" "NRF52840" pos)
if (NOT "${pos}" STREQUAL "-1")
set(TEMPLATE "nRF52840")
set(DEV "nrf52840")
else()
set(TEMPLATE "nRF52832")
set(DEV "nrf52")
endif()
include("${CODAL_UTILS_LOCATION}")
# find sources and headers
RECURSIVE_FIND_FILE(SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/source" "*.c??")
list(APPEND INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/inc"
"${CMAKE_CURRENT_SOURCE_DIR}/inc/cmsis"
"${CMAKE_CURRENT_SOURCE_DIR}/nrfx/mdk"
"${CMAKE_CURRENT_SOURCE_DIR}/nrfx"
"${CMAKE_CURRENT_SOURCE_DIR}/nrfx/templates/"
"${CMAKE_CURRENT_SOURCE_DIR}/nrfx/templates/${TEMPLATE}"
"${CMAKE_CURRENT_SOURCE_DIR}/nrfx/drivers/include"
)
list(APPEND SOURCE_FILES "asm/CortexContextSwitch.s")
list(APPEND SOURCE_FILES "nrfx/mdk/system_${DEV}.c")
list(APPEND SOURCE_FILES "nrfx/mdk/gcc_startup_${DEV}.S")
list(APPEND SOURCE_FILES "nrfx/drivers/src/nrfx_uarte.c")
list(APPEND SOURCE_FILES "nrfx/drivers/src/prs/nrfx_prs.c")
# add them
include_directories(${INCLUDE_DIRS})
# create our target
add_library(codal-nrf52 ${SOURCE_FILES})
target_link_libraries(
codal-nrf52
codal-core
)
# expose it to parent cmake.
target_include_directories(codal-nrf52 PUBLIC ${INCLUDE_DIRS})