zephyr/share/zephyr-package/cmake/pristine.cmake
Torsten Rasmussen 3074a7a498 cmake: Relocating Zephyr Unittest CMake package.
Fixes: #23872

Relocating Zephyr Unittest CMake package to ensure that
HINTS ${ZEPHYR_BASE} in
find_package(ZephyrUnittest HINTS ${ZEPHYR_BASE}) works correctly when
the package has not been exported to CMake user package registry.

This ensure that the new package functionality is fully backwards
compatible on systems where the package is not exported and ZEPHYR_BASE
is set.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-31 10:00:15 -04:00

23 lines
760 B
CMake

# SPDX-License-Identifier: Apache-2.0
# Purpose of this CMake file is to clean all CMake files generated by CMake when
# exporting Zephry to CMake user package registry.
# Get a list of all files.
file(GLOB_RECURSE GENERATED_FILES
LIST_DIRECTORIES true
${CMAKE_CURRENT_LIST_DIR}/*
)
# Remove the files that is used be Zephyr from the list.
list(REMOVE_ITEM GENERATED_FILES
"${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
"${CMAKE_CURRENT_LIST_DIR}/pristine.cmake"
"${CMAKE_CURRENT_LIST_DIR}/zephyr_package_search.cmake"
"${CMAKE_CURRENT_LIST_DIR}/ZephyrConfigVersion.cmake"
"${CMAKE_CURRENT_LIST_DIR}/ZephyrConfig.cmake"
)
# Delete everything else, as those files are created by CMake.
file(REMOVE_RECURSE ${GENERATED_FILES})