summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: f7776bc7c632e4ff39c0b9cdc9c72304acc065e3 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
cmake_minimum_required(VERSION 3.2)
project(phone_remote_nrf51)

list(APPEND CMAKE_REQUIRED_DEFINITIONS BLE_STACK_SUPPORT_REQD)
list(APPEND CMAKE_REQUIRED_DEFINITIONS SOFTDEVICE_PRESENT)

set(SOURCE_FILES)
list(APPEND SOURCE_FILES main.c)
list(APPEND SOURCE_FILES phone_remote.c)
list(APPEND SOURCE_FILES LiquidCrystal.c)

add_definitions(-DNRF51)
add_definitions(-DBOARD_PCA10031)
add_definitions(-DBLE_STACK_SUPPORT_REQD)
#add_compile_options(-std=gnu99)
#add_compile_options(-march=cortex-m0)
#add_compile_options(-mthumb)
#add_compile_options(-mabi=aapcs)

list(APPEND SOURCE_FILES ${NRF_SDK}/components/ble/common/ble_advdata.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/ble/common/ble_conn_params.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/ble/common/ble_srv_common.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/ble/device_manager/device_manager_peripheral.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/drivers_nrf/hal/nrf_delay.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/drivers_nrf/pstorage/pstorage.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/drivers_nrf/uart/app_uart_fifo.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/button/app_button.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/fifo/app_fifo.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/gpiote/app_gpiote.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/timer/app_timer.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/trace/app_trace.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/sensorsim/ble_sensorsim.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/util/app_error.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/util/nrf_assert.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/libraries/uart/retarget.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/components/softdevice/common/softdevice_handler/softdevice_handler.c)
list(APPEND SOURCE_FILES ${NRF_SDK}/examples/bsp/bsp.c)

#include_directories(AFTER /usr/lib/gcc/arm-none-eabi/4.9/include)
include_directories(AFTER ${NRF_SDK}/components/ble/common)
include_directories(AFTER ${NRF_SDK}/components/ble/ble_services/ble_bas)
include_directories(AFTER ${NRF_SDK}/components/ble/ble_services/ble_hrs)
include_directories(AFTER ${NRF_SDK}/components/ble/ble_services/ble_dis)
include_directories(AFTER ${NRF_SDK}/components/ble/device_manager)
include_directories(AFTER ${NRF_SDK}/components/ble/device_manager/config)
include_directories(AFTER ${NRF_SDK}/components/drivers_nrf/hal)
include_directories(AFTER ${NRF_SDK}/components/drivers_nrf/pstorage)
include_directories(AFTER ${NRF_SDK}/components/drivers_nrf/pstorage/config)
include_directories(AFTER ${NRF_SDK}/components/drivers_nrf/uart)
include_directories(AFTER ${NRF_SDK}/components/libraries/button)
include_directories(AFTER ${NRF_SDK}/components/libraries/gpiote)
include_directories(AFTER ${NRF_SDK}/components/libraries/sensorsim)
include_directories(AFTER ${NRF_SDK}/components/libraries/scheduler)
include_directories(AFTER ${NRF_SDK}/components/libraries/timer)
include_directories(AFTER ${NRF_SDK}/components/libraries/trace)
include_directories(AFTER ${NRF_SDK}/components/libraries/util)
include_directories(AFTER ${NRF_SDK}/components/libraries/fifo)
include_directories(AFTER ${NRF_SDK}/components/softdevice/common/softdevice_handler)
include_directories(AFTER ${NRF_SDK}/components/toolchain)
include_directories(AFTER ${NRF_SDK}/components/toolchain/gcc)
include_directories(AFTER ${NRF_SDK}/examples/bsp)

set(NRF_SOFTDEVICE s110)

if(${NRF_SOFTDEVICE} STREQUAL s110)
include_directories(AFTER ${NRF_SDK}/components/softdevice/s110/headers)
add_definitions(-DSOFTDEVICE_PRESENT)
add_definitions(-DS110)
elseif(${NRF_SOFTDEVICE} STREQUAL s120)
include_directories(AFTER ${NRF_SDK}/components/softdevice/s120/headers)
add_definitions(-DSOFTDEVICE_PRESENT)
add_definitions(-DS120)
elseif(${NRF_SOFTDEVICE} STREQUAL s130)
include_directories(AFTER ${NRF_SDK}/components/softdevice/s130/headers)
add_definitions(-DSOFTDEVICE_PRESENT)
add_definitions(-DS130)
endif()

add_executable(phone_remote_nrf51 ${SOURCE_FILES} ${NRF_SOURCE_FILES} ${NRF_SDK}/components/softdevice/s110/headers/nrf_error.h)