From eb1d711bf6e01fd3744b4eddc272d626716d48ca Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Thu, 17 Nov 2022 14:31:51 +0100 Subject: Fix CMake warning when downloading external projects Setting policy CMP0135 to NEW adopts the new behavior without breaking backwards compatibility. Change-Id: I2a6cf783a6b2ed00d6c2119cf6d780c3054c25c5 --- tflite_micro.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tflite_micro.cmake b/tflite_micro.cmake index e6db207..2d5bc3b 100644 --- a/tflite_micro.cmake +++ b/tflite_micro.cmake @@ -30,6 +30,12 @@ include(FetchContent) # Download third party macro(download_third_party target) + cmake_policy(PUSH) + + if(POLICY CMP0135) + cmake_policy(SET CMP0135 NEW) + endif() + cmake_parse_arguments(DOWNLOAD "" "URL;URL_MD5;SOURCE_DIR" "" ${ARGN}) message("Downloading ${DOWNLOAD_URL}") @@ -44,6 +50,8 @@ macro(download_third_party target) if (NOT ${target}_POPULATED) FetchContent_Populate(${target}) endif() + + cmake_policy(POP) endmacro() function(tensorflow_source_exists RESULT TARGET SOURCE) -- cgit v1.2.1