cmake: Move default value for AUTOCONF_H to kconfig.cmake

This is a cleanup commit moves the setting of AUTOCONF_H from
boilerplate.cmake to kconfig.cmake for better re-usability.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2021-12-15 15:00:06 +01:00 committed by Marti Bolivar
parent b3daa58ee0
commit a5d0b2f734
2 changed files with 7 additions and 5 deletions

View file

@ -127,11 +127,6 @@ file(TO_CMAKE_PATH "${ZEPHYR_BASE}" PROJECT_SOURCE_DIR)
set(ZEPHYR_BINARY_DIR ${PROJECT_BINARY_DIR})
set(AUTOCONF_H ${__build_dir}/include/generated/autoconf.h)
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${AUTOCONF_H})
#
# Import more CMake functions and macros
#

View file

@ -1,5 +1,12 @@
# SPDX-License-Identifier: Apache-2.0
# autoconf.h is generated by Kconfig and placed in <build>/zephyr/include/generated/autoconf.h.
# A project may request a custom location by setting AUTOCONF_H explicitly before
# calling 'find_package(Zephyr)' or loading this module.
set_ifndef(AUTOCONF_H ${PROJECT_BINARY_DIR}/include/generated/autoconf.h)
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${AUTOCONF_H})
# Folders needed for conf/mconf files (kconfig has no method of redirecting all output files).
# conf/mconf needs to be run from a different directory because of: GH-3408
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/kconfig/include/generated)