Skip to content

Commit 129c2ca

Browse files
0xc0170hugueskambarajkan01paul-szczepanek-arm
authored
Add CMakelists (#321)
* Add CMakelists The CMake support is still in development. For more information, see mbed-os/cmake/README.md * CMake: Add required Mbed OS component Mbed OS has multiple targets that can be linked to as required. * CMake: Add support for BLE_LED and sync with master This commit syncs the feature-cmake branch with master and adds CMake support for the BLE_LED example project as the BLE_Button example project is being removed. * CMake: Use renamed Mbed CMake targets component They are now prefixed with "mbed-" instead of "mbed-os-" * CMake: Perform toolchain and language setup * CMake: BLE button removal * CMake: Call mbed_set_post_build API for setting post build operations - Update CMake minimum version required from 3.18.2 to 3.19.0 - Replace mbed-os source path MBED_ROOT with MBED_PATH in CMakeLists.txt * add CMake support for BLE_Advertising example Co-authored-by: Hugues Kamba <[email protected]> Co-authored-by: Rajkumar Kanagaraj <[email protected]> Co-authored-by: Paul Szczeanek <[email protected]>
1 parent c424a8e commit 129c2ca

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

BLE_Advertising/CMakeLists.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
5+
6+
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
7+
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.mbedbuild CACHE INTERNAL "")
8+
set(APP_TARGET BLE_Advertising)
9+
10+
include(${MBED_PATH}/tools/cmake/app.cmake)
11+
12+
add_subdirectory(${MBED_PATH})
13+
14+
add_executable(${APP_TARGET})
15+
16+
mbed_configure_app_target(${APP_TARGET})
17+
18+
mbed_set_mbed_target_linker_script(${APP_TARGET})
19+
20+
project(${APP_TARGET})
21+
22+
target_include_directories(${APP_TARGET}
23+
PRIVATE
24+
./source
25+
)
26+
27+
target_sources(${APP_TARGET}
28+
PRIVATE
29+
source/main.cpp
30+
)
31+
32+
target_link_libraries(${APP_TARGET}
33+
PRIVATE
34+
mbed-os
35+
mbed-events
36+
mbed-ble
37+
mbed-ble-cordio
38+
mbed-ble-blue_nrg
39+
)
40+
41+
mbed_set_post_build(${APP_TARGET})
42+
43+
option(VERBOSE_BUILD "Have a verbose build process")
44+
if(VERBOSE_BUILD)
45+
set(CMAKE_VERBOSE_MAKEFILE ON)
46+
endif()

0 commit comments

Comments
 (0)