From 588368dd2a46ddec70741c6cc87a79a0b26ee383 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Fri, 23 Oct 2020 18:13:15 +0200 Subject: Add automatic generation of version and build type headers for compilation This change replaces the static version and build type header file generation by CMake with dynamic CMake targets to generate the version file whenever a Make target is executed. Thus, there is no need anymore to reconfigure and rerun CMake after the repository version or build configuration has changed. --- src/utils/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/utils/CMakeLists.txt') diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index cfc5548..f3ea912 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -4,15 +4,11 @@ cmake_minimum_required(VERSION 3.10) project(xloop-utils) # include global headers -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) - -# prepare date for configuring config.h -string(TIMESTAMP DATE "%d-%b-%Y") +include_directories(${PROJECT_INCLUDE_GEN_DIR}) # configure configuration config.h and add it to each source file -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) -add_compile_options(-include ${CMAKE_CURRENT_BINARY_DIR}/config.h) +add_compile_options(-include ${CMAKE_CURRENT_SOURCE_DIR}/config.h) # add xloop specific compile options add_definitions(-DCONFIG_BLK_DEV_XLOOP_MIN_COUNT=${BLK_DEV_XLOOP_MIN_COUNT} -DXLOOP_MAJOR=${XLOOP_MAJOR}) -- cgit v1.2.3-55-g7522