1# SPDX-License-Identifier: Apache-2.0 2 3# Purpose of this CMake file is to install a ZephyrConfig package reference in: 4# Unix/Linux/MacOS: ~/.cmake/packages/Zephyr 5# Windows : HKEY_CURRENT_USER 6# 7# Having ZephyrConfig package allows for find_package(Zephyr) to work when ZEPHYR_BASE is not defined. 8# 9# Create the reference by running `cmake -P zephyr_export.cmake` in this directory. 10 11string(MD5 MD5_SUM ${CMAKE_CURRENT_LIST_DIR}) 12if(WIN32) 13 execute_process(COMMAND ${CMAKE_COMMAND} 14 -E write_regv 15 "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Packages\\Zephyr\;${MD5_SUM}" "${CMAKE_CURRENT_LIST_DIR}" 16) 17else() 18 file(WRITE $ENV{HOME}/.cmake/packages/Zephyr/${MD5_SUM} ${CMAKE_CURRENT_LIST_DIR}) 19endif() 20 21message("Zephyr (${CMAKE_CURRENT_LIST_DIR})") 22message("has been added to the user package registry in:") 23if(WIN32) 24 message("HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Packages\\Zephyr\n") 25else() 26 message("~/.cmake/packages/Zephyr\n") 27endif() 28 29file(REMOVE ${CMAKE_CURRENT_LIST_DIR}/${MD5_INFILE}) 30