From 69d0e2466f871fb1a4f33abb529863b87361a1ee Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 1 Jun 2015 19:16:43 +0200 Subject: o Start of a CMake-based build. --- CMakeLists.txt | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 CMakeLists.txt (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f7776bc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,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) -- cgit v1.2.3