summaryrefslogtreecommitdiff
path: root/scripts/cmake/util_functions.cmake
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2021-04-07 09:27:38 +0100
committerIsabella Gottardi <isabella.gottardi@arm.com>2021-05-07 12:19:19 +0100
commit2181d0ac35f30202985a877950c88325ff665f6b (patch)
treee16c50d41d85945e0c2c864323ac1769b02af64f /scripts/cmake/util_functions.cmake
parentd580eee180be219e118152cedabc9637da8574d6 (diff)
downloadml-embedded-evaluation-kit-2181d0ac35f30202985a877950c88325ff665f6b.tar.gz
MLECO-1766: Default build flow helper scripts added
MLECO-1882: Anomaly Detection use-case default model download added and tests updated to run with it. Test data generation cmake logic moved from use-case cmakes to top-level cmake script. Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com> Change-Id: Ifde469e3585c37b9a53810236a92ce52d4fbb407
Diffstat (limited to 'scripts/cmake/util_functions.cmake')
-rw-r--r--scripts/cmake/util_functions.cmake17
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/cmake/util_functions.cmake b/scripts/cmake/util_functions.cmake
index e39de2f..ecd9d2a 100644
--- a/scripts/cmake/util_functions.cmake
+++ b/scripts/cmake/util_functions.cmake
@@ -20,6 +20,21 @@
##############################################################################
function(USER_OPTION name description default type)
+ if (${type} STREQUAL PATH_OR_FILE)
+
+ if (DEFINED ${name})
+ get_path_type(${${name}} PATH_TYPE)
+ else()
+ get_path_type(${default} PATH_TYPE)
+ endif()
+
+ # Set the default type if path is not a dir or file path (or undefined)
+ if (NOT ${PATH_TYPE} STREQUAL PATH AND NOT ${PATH_TYPE} STREQUAL FILEPATH)
+ message(FATAL_ERROR "Invalid ${name}. It should be a dir or file path.")
+ endif()
+ set(type ${PATH_TYPE})
+ endif()
+
if (NOT DEFINED ${name})
set(${name} ${default} CACHE ${type} ${description})
endif()
@@ -123,7 +138,7 @@ endfunction()
# download_path: location where this file is to be downloaded (path including filename)
function(download_file_from_modelzoo model_zoo_version file_sub_path download_path)
- set(MODEL_ZOO_REPO "https://github.com/ARM-software/ML-zoo/raw")
+ set(MODEL_ZOO_REPO "https://github.com/ARM-software/ML-zoo/raw")
string(JOIN "/" FILE_URL
${MODEL_ZOO_REPO} ${model_zoo_version} ${file_sub_path})