summaryrefslogtreecommitdiff
path: root/scripts/cmake/tensorflow.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cmake/tensorflow.cmake')
-rw-r--r--scripts/cmake/tensorflow.cmake15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/cmake/tensorflow.cmake b/scripts/cmake/tensorflow.cmake
index ea3b320..8d52765 100644
--- a/scripts/cmake/tensorflow.cmake
+++ b/scripts/cmake/tensorflow.cmake
@@ -49,6 +49,12 @@ set(TENSORFLOW_LITE_MICRO_PATH "${TENSORFLOW_SRC_PATH}/tensorflow/lite/micro")
set(TENSORFLOW_LITE_MICRO_GENDIR ${CMAKE_CURRENT_BINARY_DIR}/tensorflow/)
set(TENSORFLOW_LITE_MICRO_PLATFORM_LIB_NAME "libtensorflow-microlite.a")
+# Add virtual environment's Python directory path to the system path.
+# NOTE: This path is passed to the TensorFlow Lite Micro's make env
+# as it depends on some basic Python packages (like Pillow) installed
+# and the system-wide Python installation might not have them.
+set(ENV_PATH "${PYTHON_VENV}/bin:$ENV{PATH}")
+
if (TARGET_PLATFORM STREQUAL native)
set(TENSORFLOW_LITE_MICRO_TARGET "linux")
set(TENSORFLOW_LITE_MICRO_TARGET_ARCH x86_64)
@@ -73,7 +79,8 @@ endif()
if (TENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS)
message(STATUS "Refreshing TensorFlow Lite Micro's third party downloads...")
execute_process(
- COMMAND make -f ${TENSORFLOW_LITE_MICRO_PATH}/tools/make/Makefile clean_downloads third_party_downloads
+ COMMAND ${CMAKE_COMMAND} -E env PATH=${ENV_PATH}
+ make -f ${TENSORFLOW_LITE_MICRO_PATH}/tools/make/Makefile clean_downloads third_party_downloads
RESULT_VARIABLE return_code
WORKING_DIRECTORY ${TENSORFLOW_SRC_PATH})
if (NOT return_code EQUAL "0")
@@ -91,12 +98,6 @@ endif()
list(APPEND MAKE_TARGETS_LIST "microlite")
message(STATUS "TensorFlow Lite Micro build to be called for these targets: ${MAKE_TARGETS_LIST}")
-# Add virtual environment's Python directory path to the system path.
-# NOTE: This path is passed to the TensorFlow Lite Micro's make env
-# as it depends on some basic Python packages (like Pillow) installed
-# and the system-wide Python installation might not have them.
-set(ENV_PATH "${PYTHON_VENV}/bin:$ENV{PATH}")
-
# Commands and targets
add_custom_target(tensorflow_build ALL