Skip to content

CMake: Add required Mbed OS component #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion NFC_EEPROM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ target_sources(${APP_TARGET}
source/main.cpp
)

target_link_libraries(${APP_TARGET} mbed-os)
target_link_libraries(${APP_TARGET}
mbed-os
mbed-os-nfc
)

mbed_generate_bin_hex(${APP_TARGET})

Expand Down
44 changes: 44 additions & 0 deletions NFC_SmartPoster/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.18.2 FATAL_ERROR)

# TODO: @mbed-os-tools MBED_ROOT and MBED_CONFIG_PATH should probably come from mbedtools
set(MBED_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.mbedbuild CACHE INTERNAL "")
set(APP_TARGET NFC_SmartPoster)

add_subdirectory(${MBED_ROOT})

add_executable(${APP_TARGET})

mbed_configure_app_target(${APP_TARGET})

mbed_set_mbed_target_linker_script(${APP_TARGET})

project(${APP_TARGET})

include(${MBED_CONFIG_PATH}/mbed_config.cmake)

target_include_directories(${APP_TARGET}
PUBLIC
.
)

target_sources(${APP_TARGET}
PRIVATE
main.cpp
SmartPoster.cpp
)

target_link_libraries(${APP_TARGET}
mbed-os
mbed-os-nfc
)

mbed_generate_bin_hex(${APP_TARGET})

option(VERBOSE_BUILD "Have a verbose build process")
if(VERBOSE_BUILD)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
7 changes: 7 additions & 0 deletions NFC_SmartPoster/mbed_app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"target_overrides": {
"NUCLEO_F401RE": {
"target.extra_labels_add": ["PN512"]
}
}
}