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 <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
61453e4a58
commit
e4ccde3774
2 changed files with 6 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue