From 8eb44589cff8d520e5c204e5828a59d4f98fc637 Mon Sep 17 00:00:00 2001 From: Alexis Masson Date: Thu, 9 Mar 2023 16:57:44 +0100 Subject: [PATCH] fix: silence the warnings from ExternalProject_Add CMake 3.24 introduced a change in behavior in ExternalProject_Add() regarding timestamps when extracting an archive. As updating the code would break compatibility with older CMake versions, this commit instead tells newer CMake versions to behave like older ones, using a policy setting. Note from the CMake docs: The OLD behavior of a policy is deprecated by definition and may be removed in a future version of CMake. -> so the code will have to be updated eventually, and compatibility be broken... --- cmake/FindArduinoCtags.cmake | 5 +++++ cmake/ensure_core_deps.cmake | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/cmake/FindArduinoCtags.cmake b/cmake/FindArduinoCtags.cmake index 50d58f58fa..305e147846 100644 --- a/cmake/FindArduinoCtags.cmake +++ b/cmake/FindArduinoCtags.cmake @@ -3,6 +3,11 @@ include(FetchContent) include(FindPackageHandleStandardArgs) function(get_ctags) + + # Prevent warnings in CMake>=3.24 regarding ExternalProject_Add() + # cf. https://cmake.org/cmake/help/latest/policy/CMP0135.html + cmake_policy(SET CMP0135 OLD) + cmake_host_system_information( RESULT HOSTINFO QUERY OS_NAME OS_PLATFORM diff --git a/cmake/ensure_core_deps.cmake b/cmake/ensure_core_deps.cmake index 323af46bea..99fa25bf84 100644 --- a/cmake/ensure_core_deps.cmake +++ b/cmake/ensure_core_deps.cmake @@ -58,6 +58,11 @@ function(get_target_url JSONARR OUT_URL OUT_SHA) endfunction() function(declare_deps CORE_VERSION) + + # Prevent warnings in CMake>=3.24 regarding ExternalProject_Add() + # cf. https://cmake.org/cmake/help/latest/policy/CMP0135.html + cmake_policy(SET CMP0135 OLD) + file(REAL_PATH "${DL_DIR}/package_stmicroelectronics_index.json" JSONFILE) if (NOT EXISTS ${JSONFILE}) file(DOWNLOAD "${JSONCONFIG_URL}" ${JSONFILE})