Skip to content

Commit dd8d051

Browse files
[nrfconnect] Simplify CMake files (project-chip#4524)
* [nrfconnect] Simplify CMake files Get rid of app.cmake file by leveraging Zephyr standard mechanisms to: * automatically link the app with CHIP libraries when CHIP is loaded as a Zephyr module. * automatically pull a Device Tree overlay for a selected board into the project. * Restyled by prettier-markdown Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 4e1faf2 commit dd8d051

File tree

11 files changed

+27
-50
lines changed

11 files changed

+27
-50
lines changed

config/nrfconnect/README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
This directory contains build scripts and common configuration files used by
44
CHIP nRF Connect applications. It is structured as follows:
55

6-
| File/Folder | Contents |
7-
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8-
| chip-gn | GN project used to build selected CHIP libraries with the _nrfconnect_ platform integration layer |
9-
| chip-module | CMake wrapper for the GN project defined in `chip-gn` directory, and other components that allow one to use CHIP as a Zephyr module |
10-
| app/app.cmake | Helper CMake module to be used by nRF Connect applications in this repository to inject `chip-module` into the Zephyr module list and load Zephyr build system |
11-
| app/\*.conf | Common and optional Kconfig configuration files that can be used in nRF Connect applications |
6+
| File/Folder | Contents |
7+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
8+
| chip-gn | GN project used to build selected CHIP libraries with the _nrfconnect_ platform integration layer |
9+
| chip-module | CMake wrapper for the GN project defined in `chip-gn` directory, and other components that allow one to use CHIP as a Zephyr module |
10+
| app | Common and optional Kconfig configuration files that can be used in nRF Connect applications |

config/nrfconnect/app/app.cmake

-39
This file was deleted.

config/nrfconnect/chip-module/Kconfig

+7
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,11 @@ config CHIP_NFC_COMMISSIONING
8888
help
8989
Enables NFC commissioning by sharing onboarding payload in NFC tag.
9090

91+
config APP_LINK_WITH_CHIP
92+
bool "Link 'app' with Connected Home over IP"
93+
default y
94+
help
95+
Add Connected Home over IP header files to the 'app' include path
96+
and link the 'app' with Connected Home over IP libraries.
97+
9198
endif

examples/lighting-app/nrfconnect/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ get_filename_component(LIGHTING_COMMON ${CHIP_ROOT}/examples/lighting-app/lighti
2121

2222
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)
2323

24-
include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
24+
# Load NCS/Zephyr build system
25+
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
26+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
2527

2628
project(chip-nrf52840-lighting-example)
2729

examples/lock-app/nrfconnect/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ get_filename_component(LOCK_COMMON ${CHIP_ROOT}/examples/lock-app/lock-common RE
2121

2222
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)
2323

24-
include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
24+
# Load NCS/Zephyr build system
25+
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
26+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
2527

2628
project(chip-nrf52840-lock-example)
2729

examples/pigweed-app/nrfconnect/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ if(${BOARD} STREQUAL "nrf52840dongle_nrf52840")
2323
list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-usb_support.conf)
2424
endif()
2525

26-
include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
26+
# Load NCS/Zephyr build system
27+
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
28+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
2729

2830
project(chip-nrf52840-pigweed-example)
2931

examples/shell/nrfconnect/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ get_filename_component(APP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/.. REALPATH)
2020

2121
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)
2222

23-
include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
23+
# Load NCS/Zephyr build system
24+
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
25+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
2426

2527
project(chip-nrf52840-shell-example)
2628

src/test_driver/nrfconnect/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ set(CHIP_LIBRARIES
7373
${CHIP_TESTS}
7474
)
7575

76-
include(${CHIP_ROOT}/config/nrfconnect/app/app.cmake)
76+
# Load NCS/Zephyr build system
77+
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
78+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
7779

7880
# ==================================================
7981
# Build 'all tests' runner

0 commit comments

Comments
 (0)