From ae219bbde0d7be6082fc1d0d7246c720ed9b38d1 Mon Sep 17 00:00:00 2001 From: Alessandro Aimi Date: Mon, 21 Oct 2024 11:34:52 +0200 Subject: [PATCH] Loop file names in examples' CMakeLists.txt (#175) --- examples/CMakeLists.txt | 72 +++++++++++------------------------------ 1 file changed, 19 insertions(+), 53 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fb74a3170d..53d8eee4f2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,55 +1,21 @@ -build_lib_example( - NAME simple-network-example - SOURCE_FILES simple-network-example.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} +set(base_examples + simple-network-example + network-server-example + complete-network-example + adr-example + lorawan-energy-model-example + aloha-throughput + parallel-reception-example + frame-counter-update ) -build_lib_example( - NAME network-server-example - SOURCE_FILES network-server-example.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} -) - -build_lib_example( - NAME complete-network-example - SOURCE_FILES complete-network-example.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} -) - -build_lib_example( - NAME adr-example - SOURCE_FILES adr-example.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} -) - -build_lib_example( - NAME lorawan-energy-model-example - SOURCE_FILES lorawan-energy-model-example.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} -) - -build_lib_example( - NAME aloha-throughput - SOURCE_FILES aloha-throughput.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} -) - -build_lib_example( - NAME parallel-reception-example - SOURCE_FILES parallel-reception-example.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} -) - -build_lib_example( - NAME frame-counter-update - SOURCE_FILES frame-counter-update.cc - LIBRARIES_TO_LINK ${libcore} - ${liblorawan} -) +foreach( + example + ${base_examples} +) + build_lib_example( + NAME ${example} + SOURCE_FILES ${example}.cc + LIBRARIES_TO_LINK ${liblorawan} + ) +endforeach()