From c8c087e228e4bf36b4389f9d6ec63688213c60c1 Mon Sep 17 00:00:00 2001 From: Lukas Woodtli Date: Wed, 4 Dec 2024 16:19:44 +0100 Subject: [PATCH] cmake: Enable all modes by default Working on the project is easier, when all modes and most other features are enabled by default. --- CMakePresets.json | 12 ++++++++++++ examples/client/raw_block1/CMakeLists.txt | 2 ++ examples/client/tinydtls/CMakeLists.txt | 2 ++ examples/client/udp/CMakeLists.txt | 2 ++ examples/lightclient/CMakeLists.txt | 3 +++ examples/server/CMakeLists.txt | 2 ++ wakaama.cmake | 14 +++----------- 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 44594e707..2add8c7f6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -12,6 +12,18 @@ "hidden": true, "binaryDir": "${sourceDir}/build-presets/${presetName}", "cacheVariables": { + "WAKAAMA_MODE_SERVER": { + "type": "BOOL", + "value": "OFF" + }, + "WAKAAMA_MODE_BOOTSTRAP_SERVER": { + "type": "BOOL", + "value": "OFF" + }, + "WAKAAMA_MODE_CLIENT": { + "type": "BOOL", + "value": "OFF" + }, "WAKAAMA_PLATFORM": { "type": "STRING", "value": "POSIX" diff --git a/examples/client/raw_block1/CMakeLists.txt b/examples/client/raw_block1/CMakeLists.txt index 0a36b88d4..810bdc371 100644 --- a/examples/client/raw_block1/CMakeLists.txt +++ b/examples/client/raw_block1/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.21) project(lwm2mclient_raw_block1 C) set(WAKAAMA_MODE_CLIENT ON) +set(WAKAAMA_MODE_SERVER OFF) +set(WAKAAMA_MODE_BOOTSTRAP_SERVER OFF) set(WAKAAMA_CLIENT_INITIATED_BOOTSTRAP ON) set(WAKAAMA_DATA_SENML_JSON ON) set(WAKAAMA_DATA_SENML_CBOR OFF) diff --git a/examples/client/tinydtls/CMakeLists.txt b/examples/client/tinydtls/CMakeLists.txt index 622213837..8c1b05de1 100644 --- a/examples/client/tinydtls/CMakeLists.txt +++ b/examples/client/tinydtls/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.21) project(lwm2mclient_tinydtls C) set(WAKAAMA_MODE_CLIENT ON) +set(WAKAAMA_MODE_SERVER OFF) +set(WAKAAMA_MODE_BOOTSTRAP_SERVER OFF) set(WAKAAMA_CLIENT_INITIATED_BOOTSTRAP ON) set(WAKAAMA_DATA_SENML_JSON ON) set(WAKAAMA_DATA_SENML_CBOR OFF) diff --git a/examples/client/udp/CMakeLists.txt b/examples/client/udp/CMakeLists.txt index d0b9ad946..8d492db07 100644 --- a/examples/client/udp/CMakeLists.txt +++ b/examples/client/udp/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.21) project(lwm2mclient C) set(WAKAAMA_MODE_CLIENT ON) +set(WAKAAMA_MODE_SERVER OFF) +set(WAKAAMA_MODE_BOOTSTRAP_SERVER OFF) set(WAKAAMA_CLIENT_INITIATED_BOOTSTRAP ON) set(WAKAAMA_DATA_SENML_JSON ON) set(WAKAAMA_DATA_SENML_CBOR OFF) diff --git a/examples/lightclient/CMakeLists.txt b/examples/lightclient/CMakeLists.txt index 4b3aa51ca..6bb52687d 100644 --- a/examples/lightclient/CMakeLists.txt +++ b/examples/lightclient/CMakeLists.txt @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.21) project(lightclient C) set(WAKAAMA_MODE_CLIENT ON) +set(WAKAAMA_MODE_SERVER OFF) +set(WAKAAMA_MODE_BOOTSTRAP_SERVER OFF) + set(WAKAAMA_CLI ON) set(WAKAAMA_TRANSPORT POSIX_UDP) set(WAKAAMA_PLATFORM POSIX) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index 033852c71..2b0bb36ea 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.21) project(lwm2mserver C) set(WAKAAMA_MODE_SERVER ON) +set(WAKAAMA_MODE_CLIENT OFF) +set(WAKAAMA_MODE_BOOTSTRAP_SERVER OFF) set(WAKAAMA_CLI ON) set(WAKAAMA_TRANSPORT POSIX_UDP) set(WAKAAMA_PLATFORM POSIX) diff --git a/wakaama.cmake b/wakaama.cmake index 47438cbb3..7a092ed4c 100644 --- a/wakaama.cmake +++ b/wakaama.cmake @@ -5,17 +5,9 @@ set(WAKAAMA_EXAMPLE_DIRECTORY "${WAKAAMA_TOP_LEVEL_DIRECTORY}/examples") set(WAKAAMA_EXAMPLE_SHARED_DIRECTORY "${WAKAAMA_EXAMPLE_DIRECTORY}/shared") # Mode -option(WAKAAMA_MODE_SERVER "Enable LWM2M Server interfaces" OFF) -option(WAKAAMA_MODE_BOOTSTRAP_SERVER "Enable LWM2M Bootstrap Server interfaces" OFF) -option(WAKAAMA_MODE_CLIENT "Enable LWM2M Client interfaces" OFF) - -if(NOT WAKAAMA_MODE_SERVER - AND NOT WAKAAMA_MODE_BOOTSTRAP_SERVER - AND NOT WAKAAMA_MODE_CLIENT -) - message(WARNING "No mode selected. Defaulting to 'WAKAAMA_MODE_SERVER'") - set(WAKAAMA_MODE_SERVER ON) -endif() +option(WAKAAMA_MODE_SERVER "Enable LWM2M Server interfaces" ON) +option(WAKAAMA_MODE_BOOTSTRAP_SERVER "Enable LWM2M Bootstrap Server interfaces" ON) +option(WAKAAMA_MODE_CLIENT "Enable LWM2M Client interfaces" ON) # Client option(WAKAAMA_CLIENT_INITIATED_BOOTSTRAP "Enable client initiated bootstrap support in a client" OFF)