2020-02-12 21:55:36 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
# Purpose of this CMake file is to install a ZephyrConfig package reference in:
|
|
|
|
# Unix/Linux/MacOS: ~/.cmake/packages/Zephyr
|
|
|
|
# Windows : HKEY_CURRENT_USER
|
|
|
|
#
|
|
|
|
# Having ZephyrConfig package allows for find_package(Zephyr) to work when ZEPHYR_BASE is not defined.
|
|
|
|
#
|
|
|
|
# Create the reference by running `cmake .` in this directory.
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.13.1)
|
|
|
|
project(ZephyrPackageConfig NONE)
|
|
|
|
|
|
|
|
if(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_LIST_DIR))
|
|
|
|
message(WARNING "\$\{CMAKE_BINARY_DIR\} is different from \$\{CMAKE_CURRENT_LIST_DIR\}, Zephyr config package may not work as expected.")
|
|
|
|
endif()
|
|
|
|
|
2020-03-28 04:31:36 +08:00
|
|
|
message("Zephyr (${CMAKE_CURRENT_LIST_DIR})")
|
2020-02-12 21:55:36 +08:00
|
|
|
message("has been added to the user package registry in:")
|
|
|
|
if(WIN32)
|
2020-03-28 04:31:36 +08:00
|
|
|
message("HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Packages\\Zephyr\n")
|
2020-02-12 21:55:36 +08:00
|
|
|
else()
|
2020-03-28 04:31:36 +08:00
|
|
|
message("~/.cmake/packages/Zephyr\n")
|
2020-02-12 21:55:36 +08:00
|
|
|
endif()
|
|
|
|
|
2020-03-05 20:42:42 +08:00
|
|
|
add_custom_target(pristine
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/pristine.cmake
|
|
|
|
)
|
|
|
|
|
2020-02-12 21:55:36 +08:00
|
|
|
export(PACKAGE Zephyr)
|