c++_tests: force the first run for header generation
@@ -116,6 +116,15 @@ include(rust_cargo)
get_filename_component(RUST_BUILD_CWD ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
#this should create "target" directory if it does not exists
set(RUST_SWIG_SRCS "${RUST_BUILD_CWD}/src/cpp_glue.rs.in")
+# force regeneration of headers for the first build
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${RUST_SWIG_SRCS}
+ RESULT_VARIABLE touch_retcode
+ )
+if(NOT "${touch_retcode}" STREQUAL "0")
+ message(FATAL_ERROR "touch of src/cpp_glue.rs.in failed")
+endif()
+
configure_file(cmake/rust_swig_gen.cmake.in ${CMAKE_BINARY_DIR}/rust_swig_gen.cmake @ONLY)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/rust_swig_gen)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/rust_swig_regen_headers.cmake)
