Skip to content

Commit c2e2084

Browse files
hugueskamba0xc0170
authored andcommitted
Add CMakelists
The CMake support is still in development. For more information, see mbed-os/cmake/README.md
1 parent b748a17 commit c2e2084

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

getting-started/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
5+
6+
# TODO: @mbed-os-tools MBED_ROOT and MBED_CONFIG_PATH should probably come from mbedtools
7+
set(MBED_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
8+
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.mbedbuild CACHE INTERNAL "")
9+
set(APP_TARGET getting-started)
10+
11+
add_subdirectory(${MBED_ROOT})
12+
13+
add_executable(${APP_TARGET})
14+
15+
mbed_configure_app_target(${APP_TARGET})
16+
17+
mbed_set_mbed_target_linker_script(${APP_TARGET})
18+
19+
project(${APP_TARGET})
20+
21+
# Provide Mbed OS with the header file it needs to configure Mbed TLS
22+
target_include_directories(mbed-os
23+
PUBLIC
24+
${CMAKE_CURRENT_SOURCE_DIR}
25+
)
26+
27+
target_sources(${APP_TARGET}
28+
PRIVATE
29+
main.cpp
30+
)
31+
32+
target_link_libraries(${APP_TARGET} mbed-os)
33+
34+
mbed_generate_bin_hex(${APP_TARGET})
35+
36+
option(VERBOSE_BUILD "Have a verbose build process")
37+
if(VERBOSE_BUILD)
38+
set(CMAKE_VERBOSE_MAKEFILE ON)
39+
endif()

0 commit comments

Comments
 (0)