Use OpenCV_DIR from cache only if user doesn't define OpenCV_DIR (#18963)

This commit is contained in:
Ilya Churaev 2023-08-03 15:17:18 +04:00 committed by GitHub
parent 32e0e859b2
commit 73530676cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -151,8 +151,11 @@ endif()
unset(_IE_nlohmann_json_FOUND) unset(_IE_nlohmann_json_FOUND)
# inherit OpenCV from main IE project if enabled # inherit OpenCV from main IE project if enabled
if ("@OpenCV_FOUND@") if("@OpenCV_FOUND@")
load_cache("${cache_path}" READ_WITH_PREFIX "" OpenCV_DIR) # Use OpenCV_DIR from cache only if user doesn't define OpenCV_DIR
if(NOT OpenCV_DIR)
load_cache("${cache_path}" READ_WITH_PREFIX "" OpenCV_DIR)
endif()
find_dependency(OpenCV) find_dependency(OpenCV)
endif() endif()

View File

@ -71,8 +71,11 @@ foreach(component @openvino_export_components@)
endforeach() endforeach()
# inherit OpenCV from main OpenVINO project if enabled # inherit OpenCV from main OpenVINO project if enabled
if ("@OpenCV_FOUND@") if("@OpenCV_FOUND@")
load_cache("${cache_path}" READ_WITH_PREFIX "" OpenCV_DIR) # Use OpenCV_DIR from cache only if user doesn't define OpenCV_DIR
if(NOT OpenCV_DIR)
load_cache("${cache_path}" READ_WITH_PREFIX "" OpenCV_DIR)
endif()
find_dependency(OpenCV) find_dependency(OpenCV)
endif() endif()