Repository: nrfconnect/sdk-nrf
Pull request #21875: samples: matter: Add Data Model target
Author: login: adigie
Labels: name: manifest
name: manifest-matter
name: changelog-entry-required
description: Update changelog before merge. Remove label if entry is not needed or already added.
Created: 2025-04-16T12:44:38Z | Merged: 2025-04-22T12:50:29Z



Diff:
diff --git a/applications/matter_bridge/CMakeLists.txt b/applications/matter_bridge/CMakeLists.txt
index e2ee3b57ba63..f6012526cc8e 100644
--- a/applications/matter_bridge/CMakeLists.txt
+++ b/applications/matter_bridge/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-bridge)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     src/bridged_device_types
@@ -127,10 +129,7 @@ endif() # CONFIG_BRIDGE_HUMIDITY_SENSOR_BRIDGED_DEVICE
 
 endif() # CONFIG_BRIDGED_DEVICE_BT
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/bridge.zap
 )
 # NORDIC SDK APP END
diff --git a/applications/matter_weather_station/CMakeLists.txt b/applications/matter_weather_station/CMakeLists.txt
index f6f9a0ac8b6e..5bd8e1800f84 100644
--- a/applications/matter_weather_station/CMakeLists.txt
+++ b/applications/matter_weather_station/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-weather-station)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -31,10 +33,7 @@ target_sources(app PRIVATE
     src/buzzer.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/weather-station.zap
 )
 # NORDIC SDK APP END
diff --git a/samples/matter/common/cmake/data_model.cmake b/samples/matter/common/cmake/data_model.cmake
new file mode 100644
index 000000000000..1de08a3c2acf
--- /dev/null
+++ b/samples/matter/common/cmake/data_model.cmake
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2025 Nordic Semiconductor ASA
+#
+# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
+#
+
+include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
+
+function(ncs_configure_data_model)
+  cmake_parse_arguments(ARG "" "ZAP_FILE" "EXTERNAL_CLUSTERS" ${ARGN})
+
+  if(NOT ARG_ZAP_FILE)
+    message(FATAL_ERROR "ZAP_FILE argument is required")
+  endif()
+
+  target_include_directories(matter-data-model
+    PUBLIC
+    ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
+  )
+
+  chip_configure_data_model(matter-data-model
+    BYPASS_IDL
+    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+    ZAP_FILE ${ARG_ZAP_FILE}
+    EXTERNAL_CLUSTERS ${ARG_EXTERNAL_CLUSTERS}
+  )
+endfunction()
diff --git a/samples/matter/light_bulb/CMakeLists.txt b/samples/matter/light_bulb/CMakeLists.txt
index 15e71444d660..1296ba9db843 100644
--- a/samples/matter/light_bulb/CMakeLists.txt
+++ b/samples/matter/light_bulb/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-light-bulb)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -34,10 +36,7 @@ target_sources(app PRIVATE
     src/zcl_callbacks.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/light_bulb.zap
 )
 # NORDIC SDK APP END
diff --git a/samples/matter/light_switch/CMakeLists.txt b/samples/matter/light_switch/CMakeLists.txt
index 215752b2f9b6..ec83011f48a7 100644
--- a/samples/matter/light_switch/CMakeLists.txt
+++ b/samples/matter/light_switch/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-light-switch)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -35,10 +37,7 @@ target_sources(app PRIVATE
     ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/binding/binding_handler.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/light_switch.zap
 )
 # NORDIC SDK APP END
diff --git a/samples/matter/lock/CMakeLists.txt b/samples/matter/lock/CMakeLists.txt
index 3e06c01b38a6..b62dbad6a178 100644
--- a/samples/matter/lock/CMakeLists.txt
+++ b/samples/matter/lock/CMakeLists.txt
@@ -9,15 +9,17 @@ cmake_minimum_required(VERSION 3.20.0)
 find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
 project(matter-lock)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -48,15 +50,13 @@ if(CONFIG_THREAD_WIFI_SWITCHING)
     )
 endif()
 
-# Do not treat warnings as errors while the variable may be uninitialized for this sample.
+# Do not treat warnings as errors while the variable may be uninitialized for this sample data model.
 # In the door-lock-server implementation, there is a warning that the C++ "optional"
 # variable may be uninitialized, but actually, it is wrongly interpreted by the Zephyr toolchain.
-target_compile_options(app PRIVATE -Wno-error=maybe-uninitialized)
+target_compile_options(matter-data-model PRIVATE -Wno-error=maybe-uninitialized)
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/lock.zap
 )
+
 # NORDIC SDK APP END
diff --git a/samples/matter/manufacturer_specific/CMakeLists.txt b/samples/matter/manufacturer_specific/CMakeLists.txt
index 9eb873a7d957..29ac86e2f316 100644
--- a/samples/matter/manufacturer_specific/CMakeLists.txt
+++ b/samples/matter/manufacturer_specific/CMakeLists.txt
@@ -13,15 +13,17 @@ project(matter-manufacturer_specific)
 # Override zap-generated directory.
 get_filename_component(CHIP_APP_ZAP_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated REALPATH CACHE)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -33,10 +35,7 @@ target_sources(app PRIVATE
     src/main.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/manufacturer_specific.zap
     EXTERNAL_CLUSTERS "NORDIC_DEV_KIT_CLUSTER"
 )
diff --git a/samples/matter/smoke_co_alarm/CMakeLists.txt b/samples/matter/smoke_co_alarm/CMakeLists.txt
index 493a4e5760c3..0d999a6cc9b8 100644
--- a/samples/matter/smoke_co_alarm/CMakeLists.txt
+++ b/samples/matter/smoke_co_alarm/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-smoke-co-alarm)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -30,10 +32,7 @@ target_sources(app PRIVATE
     src/zcl_callbacks.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/smoke_co_alarm.zap
 )
 # NORDIC SDK APP END
diff --git a/samples/matter/template/CMakeLists.txt b/samples/matter/template/CMakeLists.txt
index 4570e18e3efa..db411ee0e65e 100644
--- a/samples/matter/template/CMakeLists.txt
+++ b/samples/matter/template/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-template)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -29,10 +31,7 @@ target_sources(app PRIVATE
     src/main.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/template.zap
 )
 # NORDIC SDK APP END
diff --git a/samples/matter/thermostat/CMakeLists.txt b/samples/matter/thermostat/CMakeLists.txt
index 4020e203423d..ec42c363e31c 100644
--- a/samples/matter/thermostat/CMakeLists.txt
+++ b/samples/matter/thermostat/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-template)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -34,10 +36,7 @@ target_sources(app PRIVATE
     ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/binding/binding_handler.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/thermostat.zap
 )
 # NORDIC SDK APP END
diff --git a/samples/matter/window_covering/CMakeLists.txt b/samples/matter/window_covering/CMakeLists.txt
index d7f73e2769a2..fd03ccf6c8d4 100644
--- a/samples/matter/window_covering/CMakeLists.txt
+++ b/samples/matter/window_covering/CMakeLists.txt
@@ -10,15 +10,17 @@ find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
 
 project(matter-window-app)
 
-# Enable GNU STD support and initialize the Matter Data Model.
+# Enable GNU STD support.
 include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
-include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
 
 # NORDIC SDK APP START
 
 # Include all source files that are located in the Matter common directory.
 include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
 
+# Include Data Model utils
+include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
+
 target_include_directories(app PRIVATE
     src
     ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
@@ -31,10 +33,7 @@ target_sources(app PRIVATE
     src/zcl_callbacks.cpp
 )
 
-chip_configure_data_model(app
-    INCLUDE_SERVER
-    BYPASS_IDL
-    GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
+ncs_configure_data_model(
     ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/window-app.zap
 )
 # NORDIC SDK APP END
diff --git a/west.yml b/west.yml
index b0e1b493acaa..dfe3854c5cdf 100644
--- a/west.yml
+++ b/west.yml
@@ -156,7 +156,7 @@ manifest:
     - name: matter
       repo-path: sdk-connectedhomeip
       path: modules/lib/matter
-      revision: e1aa96e144224f3c275498bed787e565ff04ed4b
+      revision: a06ea5a33f739287c179714e596062140abdc349
       west-commands: scripts/west/west-commands.yml
       submodules:
         - name: nlio


Reviews:
user: login: ArekBalysNordic
body: LGTM
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T10:32:12Z
user: login: LuDuda
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T12:32:05Z
user: login: adigie
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-17T12:47:17Z
user: login: ArekBalysNordic
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-18T12:53:29Z
user: login: kkasperczyk-no
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-22T05:31:56Z
user: login: nordicjm
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-22T10:42:04Z
user: login: adigie
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-22T10:46:46Z
user: login: nordicjm
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-22T12:20:46Z

Review comments:
diff_hunk: @@ -0,0 +1,33 @@
+#
+# Copyright (c) 2025 Nordic Semiconductor ASA
+#
+# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
+#
+
+include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
+
+function(ncs_configure_data_model)
+    cmake_parse_arguments(ARG "" "ZAP_FILE" "EXTERNAL_CLUSTERS" ${ARGN})
+
+    if(NOT ARG_ZAP_FILE)
+        message(FATAL_ERROR "ZAP_FILE argument is required")
+    endif()
+
+    add_library(data-model STATIC)
path: samples/matter/common/cmake/data_model.cmake
user: login: LuDuda
body: What about?

```suggestion
    add_library(matter-data-model STATIC)
```
created_at: 2025-04-17T12:29:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,33 @@
+#
+# Copyright (c) 2025 Nordic Semiconductor ASA
+#
+# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
+#
+
+include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
+
+function(ncs_configure_data_model)
+    cmake_parse_arguments(ARG "" "ZAP_FILE" "EXTERNAL_CLUSTERS" ${ARGN})
+
+    if(NOT ARG_ZAP_FILE)
+        message(FATAL_ERROR "ZAP_FILE argument is required")
+    endif()
+
+    add_library(data-model STATIC)
+
+    target_link_libraries(data-model PUBLIC zephyr_interface chip)
+
+    target_link_options(chip INTERFACE -Wl,--whole-archive $<TARGET_FILE:data-model> -Wl,--no-whole-archive)
+
+    target_include_directories(data-model
+        PUBLIC
+            ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
+    )
+
+    chip_configure_data_model(data-model
+        BYPASS_IDL
+        GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
path: samples/matter/common/cmake/data_model.cmake
user: login: LuDuda
body: Previously there was one more entry `INCLUDE_SERVER` how does it work now?
created_at: 2025-04-17T12:30:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,33 @@
+#
+# Copyright (c) 2025 Nordic Semiconductor ASA
+#
+# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
+#
+
+include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
+
+function(ncs_configure_data_model)
+    cmake_parse_arguments(ARG "" "ZAP_FILE" "EXTERNAL_CLUSTERS" ${ARGN})
+
+    if(NOT ARG_ZAP_FILE)
+        message(FATAL_ERROR "ZAP_FILE argument is required")
+    endif()
+
+    add_library(data-model STATIC)
+
+    target_link_libraries(data-model PUBLIC zephyr_interface chip)
+
+    target_link_options(chip INTERFACE -Wl,--whole-archive $<TARGET_FILE:data-model> -Wl,--no-whole-archive)
+
+    target_include_directories(data-model
+        PUBLIC
+            ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}
+    )
+
+    chip_configure_data_model(data-model
+        BYPASS_IDL
+        GEN_DIR ${CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH}/zap-generated
path: samples/matter/common/cmake/data_model.cmake
user: login: adigie
body: This argument was removed some time ago.
created_at: 2025-04-17T12:47:16Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,27 @@
+#
+# Copyright (c) 2025 Nordic Semiconductor ASA
+#
+# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
+#
+
+include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
+
+function(ncs_configure_data_model)
+    cmake_parse_arguments(ARG "" "ZAP_FILE" "EXTERNAL_CLUSTERS" ${ARGN})
path: samples/matter/common/cmake/data_model.cmake
user: login: nordicjm
body: cmake indent is 2 spaces
created_at: 2025-04-22T10:41:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,27 @@
+#
+# Copyright (c) 2025 Nordic Semiconductor ASA
+#
+# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
+#
+
+include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake)
+
+function(ncs_configure_data_model)
+    cmake_parse_arguments(ARG "" "ZAP_FILE" "EXTERNAL_CLUSTERS" ${ARGN})
path: samples/matter/common/cmake/data_model.cmake
user: login: adigie
body: Fixed.
created_at: 2025-04-22T10:46:46Z
author_association: MEMBER

PR comments:
user: login: NordicBuilder
created_at: 2025-04-16T12:47:31Z
body: ## CI Information

<sup>_To view the history of this post, clich the 'edited' button above_</sup>
Build number: 9
### Inputs:
#### Sources:
sdk-nrf: PR head: [77663a2b5462dbf73c5f1ef351501e984eb941b2](https://github.com/nrfconnect/sdk-nrf/pull/21875/commits/77663a2b5462dbf73c5f1ef351501e984eb941b2)
matter: PR head: [a06ea5a33f739287c179714e596062140abdc349](https://github.com/nrfconnect/sdk-connectedhomeip/commit/a06ea5a33f739287c179714e596062140abdc349)
<details><summary> more details</summary>

sdk-nrf:
> PR head: [77663a2b5462dbf73c5f1ef351501e984eb941b2](https://github.com/nrfconnect/sdk-nrf/pull/21875/commits/77663a2b5462dbf73c5f1ef351501e984eb941b2)
> merge base: [2aad7c1c93a32fd44637a538574f22e0492f22e8](https://github.com/nrfconnect/sdk-nrf/commit/2aad7c1c93a32fd44637a538574f22e0492f22e8)
> target head (main): [6e4cb68edb19fcbce7c4ddfe5e584a7861b007c8](https://github.com/nrfconnect/sdk-nrf/commit/6e4cb68edb19fcbce7c4ddfe5e584a7861b007c8)
> [Diff](https://github.com/nrfconnect/sdk-nrf/compare/2aad7c1c93a32fd44637a538574f22e0492f22e8..77663a2b5462dbf73c5f1ef351501e984eb941b2)

matter:
> PR head: [a06ea5a33f739287c179714e596062140abdc349](https://github.com/nrfconnect/sdk-connectedhomeip/commit/a06ea5a33f739287c179714e596062140abdc349)
> merge base: [e1aa96e144224f3c275498bed787e565ff04ed4b](https://github.com/nrfconnect/sdk-connectedhomeip/commit/e1aa96e144224f3c275498bed787e565ff04ed4b)
> [Diff](https://github.com/nrfconnect/sdk-connectedhomeip/compare/e1aa96e144224f3c275498bed787e565ff04ed4b..a06ea5a33f739287c179714e596062140abdc349)
</details>

#### Github labels
| Enabled | Name | Description |
| -- | -- | -- |
|| ci-disabled | _Disable the ci execution_ | 
|| ci-all-test | _Run all of ci, no test spec filtering will be done_ | 
|| ci-force-downstream | _Force execution of downstream even if twister fails_ | 
|| ci-run-twister | _Force run twister_ | 
|| ci-run-zephyr-twister | _Force run zephyr twister_ | 

<details><summary> List of changed files detected by CI (16)</summary>

```
applications
│  ├── matter_bridge
│  │  │ CMakeLists.txt
│  ├── matter_weather_station
│  │  │ CMakeLists.txt
modules
│  ├── lib
│  │  ├── matter
│  │  │  ├── config
│  │  │  │  ├── common
│  │  │  │  │  ├── cmake
│  │  │  │  │  │  │ chip_gn.cmake
│  │  │  │  ├── nrfconnect
│  │  │  │  │  ├── chip-module
│  │  │  │  │  │  │ CMakeLists.txt
│  │  │  ├── src
│  │  │  │  ├── messaging
│  │  │  │  │  ├── tests
│  │  │  │  │  │  │ BUILD.gn
│  │  │  │  ├── test_driver
│  │  │  │  │  ├── nrfconnect
│  │  │  │  │  │  │ prj.conf
samples
│  ├── matter
│  │  ├── common
│  │  │  ├── cmake
│  │  │  │  │ data_model.cmake
│  │  ├── light_bulb
│  │  │  │ CMakeLists.txt
│  │  ├── light_switch
│  │  │  │ CMakeLists.txt
│  │  ├── lock
│  │  │  │ CMakeLists.txt
│  │  ├── manufacturer_specific
│  │  │  │ CMakeLists.txt
│  │  ├── smoke_co_alarm
│  │  │  │ CMakeLists.txt
│  │  ├── template
│  │  │  │ CMakeLists.txt
│  │  ├── thermostat
│  │  │  │ CMakeLists.txt
│  │  ├── window_covering
│  │  │  │ CMakeLists.txt
west.yml
```
</details>

### Outputs:

#### Toolchain
Version: 7cbc0036f4
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:7cbc0036f4_8bf7ca4353

#### Test Spec & Results: :white_check_mark: Success; :x: Failure; :orange_circle: Queued; :yellow_circle: Progress; :white_medium_square: Skipped; :warning: Quarantine
- :white_medium_square: Toolchain - Skipped: existing toolchain is used
- :white_check_mark: Build twister
   - sdk-nrf test count: 7
- :yellow_circle: Integration tests
   - :white_check_mark: test-fw-nrfconnect-chip

<details><summary>Disabled integration tests</summary>

- 
   - desktop52_verification
   - doc-internal
   - test_ble_nrf_config
   - test-fw-nrfconnect-apps
   - test-fw-nrfconnect-ble_mesh
   - test-fw-nrfconnect-ble_samples
   - test-fw-nrfconnect-boot
   - test-fw-nrfconnect-fem
   - test-fw-nrfconnect-nfc
   - test-fw-nrfconnect-nrf-iot_cloud
   - test-fw-nrfconnect-nrf-iot_libmodem-nrf
   - test-fw-nrfconnect-nrf-iot_mosh
   - test-fw-nrfconnect-nrf-iot_positioning
   - test-fw-nrfconnect-nrf-iot_samples
   - test-fw-nrfconnect-nrf-iot_serial_lte_modem
   - test-fw-nrfconnect-nrf-iot_thingy91
   - test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
   - test-fw-nrfconnect-nrf_crypto
   - test-fw-nrfconnect-proprietary_esb
   - test-fw-nrfconnect-ps
   - test-fw-nrfconnect-rpc
   - test-fw-nrfconnect-rs
   - test-fw-nrfconnect-tfm
   - test-fw-nrfconnect-thread
   - test-low-level
   - test-sdk-audio
   - test-sdk-dfu
   - test-sdk-find-my
   - test-sdk-mcuboot
   - test-sdk-pmic-samples
   - test-sdk-wifi
   - test-secdom-samples-public
</details>



*Note: This message is automatically posted and updated by the CI*
author_association: CONTRIBUTOR
user: login: NordicBuilder
created_at: 2025-04-16T12:48:46Z
body: The following west manifest projects have changed revision in this Pull Request:

| Name | Old Revision | New Revision | Diff |
| ---- | ------------ | ------------ |------|
| matter | https://github.com/nrfconnect/sdk-connectedhomeip/commit/e1aa96e144224f3c275498bed787e565ff04ed4b | https://github.com/nrfconnect/sdk-connectedhomeip/commit/a06ea5a33f739287c179714e596062140abdc349 (`master`)| [nrfconnect/sdk-connectedhomeip@e1aa96e1..a06ea5a3](https://github.com/nrfconnect/sdk-connectedhomeip/compare/e1aa96e144224f3c275498bed787e565ff04ed4b..a06ea5a33f739287c179714e596062140abdc349) |

✅ **All manifest checks OK**

*Note: This message is automatically posted and updated by the Manifest GitHub Action.* 
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-16T13:18:07Z
body: You can find the documentation preview for this PR [here](https://ncsdoc.z6.web.core.windows.net/PR-21875/).

author_association: NONE
user: login: ArekBalysNordic
created_at: 2025-04-17T10:33:42Z
body: A small release note or migration guide entry may be good here, since we want to change the CMakeLists structure.
author_association: CONTRIBUTOR
user: login: adigie
created_at: 2025-04-22T10:31:46Z
body: @nrfconnect/ncs-co-build-system please review.
author_association: MEMBER