From 688dc2fed7b207bdf80b5f4af5a5df8faad9f2ec Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 17 Jan 2022 21:25:16 +0100 Subject: [PATCH] Create Version.h in binary dir instead of src dir Don't use source directory for generated files. Use the binary (build) directory instead. --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2e0a114..8846531e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ else() endif() 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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 062d8a50..aec6ce04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -612,6 +612,7 @@ list(APPEND RECOVERYLOADER_SOURCE_FILES set(INCLUDE_FILES + ${CMAKE_CURRENT_BINARY_DIR}/src/Version.h BootloaderVersion.h logging/Logger.h logging/NrfLogger.h @@ -710,6 +711,7 @@ set(INCLUDE_FILES ) include_directories( + ${CMAKE_BINARY_DIR}/src # include generated files like Version.h . ../ libs/