From 0b845cd28c47ec2761108eef58866da904d69ac1 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Thu, 1 Dec 2022 11:40:24 +0100 Subject: [PATCH] cmake: update FindDeprecated for SOURCES PR#51049 deprecated SOURCES but placed it below the Deprecated_FIND_COMPONENTS check causing following message to be printed when building for the unit_testing board: -- The following deprecated component(s) could not be found: SOURCES Fix this by placing the deprecated SOURCES handling at proper location and append SOURCES to Deprecated_FIND_COMPONENTS list. Signed-off-by: Torsten Rasmussen --- cmake/modules/FindDeprecated.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/modules/FindDeprecated.cmake b/cmake/modules/FindDeprecated.cmake index 35d69875149..c2582474b2c 100644 --- a/cmake/modules/FindDeprecated.cmake +++ b/cmake/modules/FindDeprecated.cmake @@ -78,12 +78,8 @@ if("XTOOLS" IN_LIST Deprecated_FIND_COMPONENTS) "Please set ZEPHYR_TOOLCHAIN_VARIANT to 'zephyr'") endif() -if(NOT "${Deprecated_FIND_COMPONENTS}" STREQUAL "") - message(STATUS "The following deprecated component(s) could not be found: " - "${Deprecated_FIND_COMPONENTS}") -endif() - if("SOURCES" IN_LIST Deprecated_FIND_COMPONENTS) + list(REMOVE_ITEM Deprecated_FIND_COMPONENTS SOURCES) if(SOURCES) message(DEPRECATION "Setting SOURCES prior to calling find_package() for unit tests is deprecated." @@ -92,5 +88,10 @@ if("SOURCES" IN_LIST Deprecated_FIND_COMPONENTS) endif() endif() +if(NOT "${Deprecated_FIND_COMPONENTS}" STREQUAL "") + message(STATUS "The following deprecated component(s) could not be found: " + "${Deprecated_FIND_COMPONENTS}") +endif() + set(Deprecated_FOUND True) set(DEPRECATED_FOUND True)