From 4c0ac91ef2b052eb57328b85edcb0071cb7558b2 Mon Sep 17 00:00:00 2001 From: Eanna O Cathain Date: Thu, 22 Sep 2022 15:18:34 +0100 Subject: MLECO-3254 Default to using only one file per UC Signed-off-by: Eanna O Cathain Change-Id: I4a1cd2b5746cb479ae0d81ed973961cec2f3046e --- scripts/cmake/common_user_options.cmake | 4 ++++ scripts/cmake/util_functions.cmake | 14 ++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'scripts') 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 -- cgit v1.2.1