Added cmake_policy call to allow IN_LIST in if() (#17916)

This commit is contained in:
Ilya Lavrenov 2023-06-07 14:12:54 +04:00 committed by GitHub
parent f023f5d672
commit 6df054b073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -440,6 +440,14 @@ endfunction()
# OpenVINO config
#
cmake_policy(PUSH)
# we need CMP0057 to allow IN_LIST in if() command
if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
else()
message(FATAL_ERROR "OpenVINO requires CMake 3.3 or newer")
endif()
# need to store current PACKAGE_PREFIX_DIR, because it's overwritten by sub-package one
set(_ov_package_prefix_dir "${PACKAGE_PREFIX_DIR}")
@ -559,3 +567,5 @@ unset(${CMAKE_FIND_PACKAGE_NAME}_ONNX_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_TensorFlow_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_TensorFlowLite_FOUND)
unset(${CMAKE_FIND_PACKAGE_NAME}_PyTorch_FOUND)
cmake_policy(POP)