Skip to content

Commit b9dc288

Browse files
authored
Merge pull request #75 from ARMmbed/feature-cmake
Add CMakelists
2 parents c1db578 + 614b9c0 commit b9dc288

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

getting-started/CMakeLists.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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 getting-started)
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+
# Provide Mbed OS with the header file it needs to configure Mbed TLS
23+
target_include_directories(${APP_TARGET}
24+
PUBLIC
25+
${CMAKE_CURRENT_SOURCE_DIR}
26+
)
27+
28+
target_sources(${APP_TARGET}
29+
PRIVATE
30+
main.cpp
31+
)
32+
33+
target_link_libraries(${APP_TARGET}
34+
PRIVATE
35+
mbed-os
36+
mbed-psa
37+
)
38+
39+
mbed_set_post_build(${APP_TARGET})
40+
41+
option(VERBOSE_BUILD "Have a verbose build process")
42+
if(VERBOSE_BUILD)
43+
set(CMAKE_VERBOSE_MAKEFILE ON)
44+
endif()

0 commit comments

Comments
 (0)