Skip to content

Commit

Permalink
cmake: Enable all modes by default
Browse files Browse the repository at this point in the history
Working on the project is easier, when all modes and most other features
are enabled by default.
  • Loading branch information
LukasWoodtli committed Dec 4, 2024
1 parent 9c66532 commit c8c087e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
12 changes: 12 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions examples/client/raw_block1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions examples/client/tinydtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions examples/client/udp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions examples/lightclient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions examples/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 3 additions & 11 deletions wakaama.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c8c087e

Please sign in to comment.