Skip to content

Commit

Permalink
Merge pull request #54 from ecmwf/feature/optionalConfig
Browse files Browse the repository at this point in the history
Feature/optional config
  • Loading branch information
danovaro authored Dec 9, 2024
2 parents e55aa5a + 75f43be commit 4660734
Show file tree
Hide file tree
Showing 3 changed files with 322 additions and 38 deletions.
28 changes: 27 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,33 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
########################################################################################################################
### dependencies and options

ecbuild_bundle( PROJECT share GIT "https://github.com/ecmwf/metkit-configs" BRANCH main UPDATE)
if(NOT METKIT_CONFIGS_BRANCH)
set(METKIT_CONFIGS_BRANCH main)
endif()

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/share")
if(IS_SYMLINK "${CMAKE_CURRENT_SOURCE_DIR}/share")
if (METKIT_CONFIGS_PATH)
#check if it matches with METKIT_CONFIGS_PATH
file(REAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/share" current_metkit_config_path EXPAND_TILDE)
file(REAL_PATH "${METKIT_CONFIGS_PATH}" requested_metkit_config_path EXPAND_TILDE)
if(NOT (current_metkit_config_path STREQUAL requested_metkit_config_path))
message(SEND_ERROR "metkit-configs refers to ${current_metkit_config_path}; requested METKIT_CONFIGS_PATH is ${requested_metkit_config_path}")
endif()
endif()
elseif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/share")
# update the content
ecbuild_bundle( PROJECT share GIT "https://github.com/ecmwf/metkit-configs" BRANCH "${METKIT_CONFIGS_BRANCH}" UPDATE )
else()
message(SEND_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/share must point to a valid metkit configuration. Cannot be a regular file")
endif()
else()
if(METKIT_CONFIGS_PATH)
file( CREATE_LINK "${METKIT_CONFIGS_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/share" SYMBOLIC )
else()
ecbuild_bundle( PROJECT share GIT "https://github.com/ecmwf/metkit-configs" BRANCH "${METKIT_CONFIGS_BRANCH}" UPDATE )
endif()
endif()

ecbuild_add_option( FEATURE BUILD_TOOLS
DEFAULT ON
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.22
1.11.23
Loading

0 comments on commit 4660734

Please sign in to comment.