From e4ccde3774cc4140f17f91bf807a39deff350514 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Fri, 17 Dec 2021 11:43:54 +0100 Subject: [PATCH] cmake: moved unittest.cmake to Zephyr CMake modules dir Move the unittest.cmake to the new Zephyr CMake modules dir. This allows us to have a single Zephyr CMake package and load unittest module as: 'find_package(Zephyr COMPONENTS unittest)' This unifies the way Zephyr package is sourced and removes the need for a dedicated ZephyrUnittest package. Deprecate the use of: 'find_package(ZephyrUnittest)' Signed-off-by: Torsten Rasmussen --- {subsys/testsuite => cmake/modules}/unittest.cmake | 0 share/zephyr-package/cmake/ZephyrConfig.cmake | 11 ++++++----- 2 files changed, 6 insertions(+), 5 deletions(-) rename {subsys/testsuite => cmake/modules}/unittest.cmake (100%) diff --git a/subsys/testsuite/unittest.cmake b/cmake/modules/unittest.cmake similarity index 100% rename from subsys/testsuite/unittest.cmake rename to cmake/modules/unittest.cmake diff --git a/share/zephyr-package/cmake/ZephyrConfig.cmake b/share/zephyr-package/cmake/ZephyrConfig.cmake index 7e85508ab86..22e5089d56a 100644 --- a/share/zephyr-package/cmake/ZephyrConfig.cmake +++ b/share/zephyr-package/cmake/ZephyrConfig.cmake @@ -13,8 +13,12 @@ macro(include_boilerplate location) list(PREPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/cmake/modules) if(ZEPHYR_UNITTEST) + message(WARNING "The ZephyrUnittest CMake package has been deprecated.\n" + "ZephyrUnittest has been replaced with Zephyr CMake module 'unittest' \n" + "and can be loaded as: 'find_package(Zephyr COMPONENTS unittest)'" + ) set(ZephyrUnittest_FOUND True) - set(BOILERPLATE_FILE ${ZEPHYR_BASE}/subsys/testsuite/unittest.cmake) + set(Zephyr_FIND_COMPONENTS unittest) else() set(Zephyr_FOUND True) endif() @@ -36,10 +40,7 @@ macro(include_boilerplate location) if(NOT NO_BOILERPLATE) list(LENGTH Zephyr_FIND_COMPONENTS components_length) - if(DEFINED BOILERPLATE_FILE) - message("Including boilerplate (${location}): ${BOILERPLATE_FILE}") - include(${BOILERPLATE_FILE} NO_POLICY_SCOPE) - elseif(components_length EQUAL 0) + if(components_length EQUAL 0) message("Loading Zephyr default modules (${location}).") include(zephyr_default NO_POLICY_SCOPE) else()