Create Version.h in binary dir instead of src dir

Don't use source directory for generated files. Use the binary (build)
directory instead.
This commit is contained in:
Reinhold Gschweicher 2022-01-17 21:25:16 +01:00
parent 26ae828e39
commit 688dc2fed7
2 changed files with 3 additions and 1 deletions

View file

@ -100,7 +100,7 @@ else()
endif() endif()
set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!") set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/Version.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh)

View file

@ -612,6 +612,7 @@ list(APPEND RECOVERYLOADER_SOURCE_FILES
set(INCLUDE_FILES set(INCLUDE_FILES
${CMAKE_CURRENT_BINARY_DIR}/src/Version.h
BootloaderVersion.h BootloaderVersion.h
logging/Logger.h logging/Logger.h
logging/NrfLogger.h logging/NrfLogger.h
@ -710,6 +711,7 @@ set(INCLUDE_FILES
) )
include_directories( include_directories(
${CMAKE_BINARY_DIR}/src # include generated files like Version.h
. .
../ ../
libs/ libs/