From d22b7bb95e91528f7b1759b6112a4ad2af4bfa63 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:25:32 -0400 Subject: [PATCH] STAB3: fix cmake build for ST4 or ST3 (#1086) --- model/src/cmake/check_switches.cmake | 6 +++--- model/src/cmake/switches.json | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/model/src/cmake/check_switches.cmake b/model/src/cmake/check_switches.cmake index 563d529e2..d09a91c5e 100644 --- a/model/src/cmake/check_switches.cmake +++ b/model/src/cmake/check_switches.cmake @@ -52,7 +52,7 @@ function(check_switches switches switch_files) message(FATAL_ERROR "Switch '${valid_opt}' requires '${required_switch}' to be set") endif() elseif(json_type STREQUAL "ARRAY") - string(JSON n_requires_any LENGTH ${vategory} valid-options ${j_options} requries ${i_requires}) + string(JSON n_requires_any LENGTH ${category} valid-options ${j_options} requires ${i_requires}) math(EXPR n_requires_any "${n_requires_any} - 1") # Loop over array and check that one of the switches is present @@ -70,7 +70,7 @@ function(check_switches switches switch_files) if(NOT found) message(FATAL_ERROR "Switch ${valid_opt} requires one of ${possible_values} to be set") endif() - + endif() endforeach() endif() @@ -98,7 +98,7 @@ function(check_switches switches switch_files) elseif(num_switches STREQUAL "upto2" AND n_switches_in_category GREATER 2) message(FATAL_ERROR "Too many ${category_name} switches found (max 2)") endif() - + endforeach() set(${switch_files} ${files} PARENT_SCOPE) diff --git a/model/src/cmake/switches.json b/model/src/cmake/switches.json index ca01708af..ff2cdc9ad 100644 --- a/model/src/cmake/switches.json +++ b/model/src/cmake/switches.json @@ -264,7 +264,7 @@ }, { "name": "STAB3", - "requires": ["ST3", "ST4"] + "requires_any": ["ST3", "ST4"] } ] }, @@ -756,16 +756,16 @@ } ] }, - { - "name": "ddlib", + { + "name": "ddlib", "num_switches": "upto1", "description": "domain decomposition library", "valid-options": [ - { + { "name": "METIS", "requires": ["PDLIB"] - }, - { + }, + { "name": "SCOTCH", "requires": ["PDLIB"] }