Skip to content

Commit 88a4c4b

Browse files
committed
Add CMakeLists.txt to support Mbed CLI 2
1 parent 93fd2c8 commit 88a4c4b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

CMakeLists.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (c) 2021 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_BINARY_DIR} CACHE INTERNAL "")
8+
set(APP_TARGET mbed-os-example-psa)
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+
project(${APP_TARGET})
19+
20+
target_sources(${APP_TARGET}
21+
PRIVATE
22+
main.cpp
23+
)
24+
25+
target_link_libraries(${APP_TARGET}
26+
PRIVATE
27+
mbed-os
28+
mbed-psa
29+
)
30+
31+
mbed_set_post_build(${APP_TARGET})
32+
33+
option(VERBOSE_BUILD "Have a verbose build process")
34+
if(VERBOSE_BUILD)
35+
set(CMAKE_VERBOSE_MAKEFILE ON)
36+
endif()

0 commit comments

Comments
 (0)