@@ -183,14 +183,15 @@ if(Idefix_EVOLVE_VECTOR_POTENTIAL)
183183endif ()
184184#update version.hpp if possible
185185git_describe (GIT_SHA1 )
186- set (Idefix_VERSION ${Idefix_VERSION_MAJOR} .${Idefix_VERSION_MINOR} .${Idefix_VERSION_PATCH} -${GIT_SHA1} )
187- file (WRITE ${CMAKE_SOURCE_DIR } /src/version.hpp "#define IDEFIX_GIT_COMMIT \" ${GIT_SHA1} \"\n " )
188- file (APPEND ${CMAKE_SOURCE_DIR } /src/version.hpp "#define IDEFIX_VERSION_MAJOR \" ${Idefix_VERSION_MAJOR} \"\n " )
189- file (APPEND ${CMAKE_SOURCE_DIR } /src/version.hpp "#define IDEFIX_VERSION_MINOR \" ${Idefix_VERSION_MINOR} \"\n " )
190- file (APPEND ${CMAKE_SOURCE_DIR } /src/version.hpp "#define IDEFIX_VERSION_PATCH \" ${Idefix_VERSION_PATCH} \"\n " )
191- file (APPEND ${CMAKE_SOURCE_DIR } /src/version.hpp "#define IDEFIX_VERSION \" ${Idefix_VERSION} \"\n " )
192186
193187
188+ set (Idefix_VERSION ${Idefix_VERSION_MAJOR} .${Idefix_VERSION_MINOR} .${Idefix_VERSION_PATCH} -${GIT_SHA1} )
189+ configure_file (
190+ ${CMAKE_SOURCE_DIR } /src/version.h.in
191+ ${CMAKE_BINARY_DIR } /build/generated/version.h
192+ @ONLY
193+ )
194+
194195if (NOT ${Idefix_DEFS} STREQUAL "definitions.hpp" )
195196 add_compile_definitions ("DEFINITIONS_FILE=\" ${Idefix_DEFS} \" " )
196197endif ()
@@ -269,6 +270,15 @@ target_include_directories(idefix PUBLIC
269270
270271target_link_libraries (idefix Kokkos::kokkos )
271272
273+ # Generate header with compiler information (name, flags, path)
274+ configure_file (
275+ ${CMAKE_SOURCE_DIR } /src/compiler_info.h.in
276+ ${CMAKE_BINARY_DIR } /build/generated/compiler_info.h
277+ @ONLY
278+ )
279+ # Make sure the generated header is on the include path
280+ target_include_directories (idefix PRIVATE ${CMAKE_BINARY_DIR } /build/generated )
281+
272282message (STATUS "Idefix final configuration" )
273283if (Idefix_EVOLVE_VECTOR_POTENTIAL)
274284 message (STATUS " MHD: ${Idefix_MHD} (Vector potential)" )
0 commit comments