summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/common_user_options.cmake4
-rw-r--r--scripts/cmake/util_functions.cmake14
2 files changed, 18 insertions, 0 deletions
diff --git a/scripts/cmake/common_user_options.cmake b/scripts/cmake/common_user_options.cmake
index 36426a8..7a0b068 100644
--- a/scripts/cmake/common_user_options.cmake
+++ b/scripts/cmake/common_user_options.cmake
@@ -77,6 +77,10 @@ USER_OPTION(TENSORFLOW_LITE_MICRO_CLEAN_BUILD "Select if clean target should be
ON
BOOL)
+USER_OPTION(USE_SINGLE_INPUT "Select if a use case should execute using a default known input file"
+ OFF
+ BOOL)
+
if (NOT TARGET_PLATFORM STREQUAL native)
USER_OPTION(CMSIS_SRC_PATH
diff --git a/scripts/cmake/util_functions.cmake b/scripts/cmake/util_functions.cmake
index 25f9731..9aa19b9 100644
--- a/scripts/cmake/util_functions.cmake
+++ b/scripts/cmake/util_functions.cmake
@@ -212,3 +212,17 @@ function(check_update_public_resources resource_downloaded_dir)
endif ()
endfunction()
+
+function(set_input_file_path_user_option file_extension use_case)
+ if(NOT USE_SINGLE_INPUT)
+ USER_OPTION(${use_case}_FILE_PATH "Directory with custom input files, or path to a single input file, to use in the evaluation application."
+ ${CMAKE_CURRENT_SOURCE_DIR}/resources/${use_case}/samples/
+ PATH_OR_FILE)
+ else()
+ file(GLOB_RECURSE INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/resources/${use_case}/samples/*${file_extension})
+ list (GET INPUTS 0 FIRST_INPUT_FILE)
+ USER_OPTION(${use_case}_FILE_PATH "Directory with custom input files, or path to a single input file, to use in the evaluation application."
+ ${FIRST_INPUT_FILE}
+ PATH_OR_FILE)
+ endif()
+endfunction() \ No newline at end of file