Skip to content

Commit 3e65f06

Browse files
ArekBalysNordicnordicjm
authored andcommitted
samples: matter: Add CHIP_APP_ZAP_DIR kconfig to the mfg sample
We need to use the new CONFIG_CHIP_APP_ZAP_DIR to set the proper path to the custom zap-generated directory in Matter stack. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
1 parent d461dbd commit 3e65f06

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

samples/matter/common/cmake/data_model.cmake

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7+
string(CONFIGURE "${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILE_PATH}" zap_file_path)
8+
cmake_path(GET zap_file_path PARENT_PATH zap_parent_dir)
9+
10+
# If we have a new app zap dir assigned we need to include zap parent dir to app target as well.
11+
if(CONFIG_CHIP_APP_ZAP_DIR)
12+
string(CONFIGURE "${CONFIG_CHIP_APP_ZAP_DIR}" app_zap_dir)
13+
14+
# Override zap-generated directory.
15+
get_filename_component(CHIP_APP_ZAP_DIR ${app_zap_dir} REALPATH CACHE)
16+
else()
17+
string(CONFIGURE "${zap_parent_dir}/zap-generated" app_zap_dir)
18+
endif()
19+
720
include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
821

922
function(ncs_configure_data_model)
10-
string(CONFIGURE "${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILE_PATH}" zap_file_path)
11-
cmake_path(GET zap_file_path PARENT_PATH zap_parent_dir)
12-
1323
cmake_parse_arguments(ARG "" "" "EXTERNAL_CLUSTERS" ${ARGN})
1424

1525
target_include_directories(matter-data-model
@@ -19,7 +29,7 @@ function(ncs_configure_data_model)
1929

2030
chip_configure_data_model(matter-data-model
2131
BYPASS_IDL
22-
GEN_DIR ${zap_parent_dir}/zap-generated
32+
GEN_DIR ${app_zap_dir}
2333
ZAP_FILE ${zap_file_path}
2434
EXTERNAL_CLUSTERS ${ARG_EXTERNAL_CLUSTERS}
2535
)

samples/matter/manufacturer_specific/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ project(matter-manufacturer_specific)
1313
include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/zap_helpers.cmake)
1414
ncs_get_zap_parent_dir(ZAP_PARENT_DIR)
1515

16-
# Override zap-generated directory.
17-
get_filename_component(CHIP_APP_ZAP_DIR ${ZAP_PARENT_DIR}/zap-generated REALPATH CACHE)
18-
1916
# Enable GNU STD support.
2017
include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
2118

samples/matter/manufacturer_specific/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CONFIG_CHIP_DEVICE_PRODUCT_NAME="Matter Manufacturer Specific"
1515

1616
# Configure ZAP file name
1717
CONFIG_NCS_SAMPLE_MATTER_ZAP_FILE_PATH="${APPLICATION_CONFIG_DIR}/src/default_zap/manufacturer_specific.zap"
18+
CONFIG_CHIP_APP_ZAP_DIR="${APPLICATION_CONFIG_DIR}/src/default_zap/zap-generated"
1819

1920
# 32768 == 0x8000 (example Product ID added temporaly,
2021
# but it must be changed with proper PID from the list:

0 commit comments

Comments
 (0)