Skip to content

Commit

Permalink
FMU cmake output buildinfo on stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
ndim committed Nov 27, 2024
1 parent eb6737e commit 0fc8e8e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/build-helpers/buildinfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function(buildinfo_setup)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/src/buildinfo-include.c"
"${BUILDINFO_INCLUDE_TOP}")
string(CONCAT BUILDINFO_SUMMARY_TOP
"\n"
"\n"
"Configuration summary:\n"
"----------------------\n"
"\n"
Expand All @@ -19,13 +21,13 @@ endfunction()

function(buildinfo_item KEY VAL)
cmake_parse_arguments(arg "" "" "" ${ARGN})
message(STATUS "BEGIN buildinfo_item")
message(STATUS " K,V: ${KEY}, ${VAL}")
# message(STATUS "BEGIN buildinfo_item")
# message(STATUS " K,V: ${KEY}, ${VAL}")
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/src/buildinfo-include.c"
" {\"AUTO-BUIDLINFO ${KEY}\", \"${VAL}\"},\n")
" {\"AUTO-BUILDINFO ${KEY}\", \"${VAL}\"},\n")
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/buildinfo-summary.txt"
" * ${KEY}: ${VAL}\n")
message(STATUS "END buildinfo_item")
# message(STATUS "END buildinfo_item")
endfunction()

function(buildinfo_output)
Expand All @@ -35,8 +37,8 @@ function(buildinfo_output)
#file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/buildinfo-summary.txt"
# "\nThe End.\n")
file(READ "${CMAKE_CURRENT_BINARY_DIR}/buildinfo-summary.txt" msg)
message("\n${msg}")
# message(STATUS "END buildinfo_output")
message(STATUS ${msg})
message(STATUS "END buildinfo_output")
endfunction()

buildinfo_setup()

0 comments on commit 0fc8e8e

Please sign in to comment.