-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XXX same behaviour between automake and cmake builds
* use the same file names for messages and C code * print the same "Configuration summary" output
- Loading branch information
Showing
6 changed files
with
53 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
function(buildinfo_setup) | ||
message(STATUS "BEGIN buildinfo_setup") | ||
string(CONCAT BUILDINFO_INCLUDE_TOP | ||
" /* buildinfo-include.c - DO NOT MODIFY THIS FILE! */\n" | ||
" /* This include file buildinfo-include.c is AUTOGENERATED by configure. */\n" | ||
" /* This file is meant to be \#include'ed, but is not a header file. */\n" | ||
) | ||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/src/buildinfo-include.c" | ||
"${BUILDINFO_INCLUDE_TOP}") | ||
string(CONCAT BUILDINFO_SUMMARY_TOP | ||
"Configuration summary:\n" | ||
"----------------------\n" | ||
"\n" | ||
) | ||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/buildinfo-summary.txt" | ||
"${BUILDINFO_SUMMARY_TOP}") | ||
message(STATUS "END buildinfo_setup") | ||
endfunction() | ||
|
||
function(buildinfo_item KEY VAL) | ||
cmake_parse_arguments(arg "" "" "" ${ARGN}) | ||
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") | ||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/buildinfo-summary.txt" | ||
" * ${KEY}: ${VAL}\n") | ||
message(STATUS "END buildinfo_item") | ||
endfunction() | ||
|
||
function(buildinfo_output) | ||
message(STATUS "BEGIN buildinfo_output") | ||
message(STATUS "END buildinfo_output") | ||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/src/buildinfo-include.c" | ||
" /* end of buildinfo-include.c */\n") | ||
#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") | ||
endfunction() | ||
|
||
buildinfo_setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
EXTRA_DIST += build-helpers/buildinfo.m4 | ||
EXTRA_DIST += build-helpers/buildinfo.md | ||
|
||
DISTCLEANFILES += auto-buildinfo.c | ||
DISTCLEANFILES += auto-buildinfo.msg | ||
DISTCLEANFILES += buildinfo-include.c | ||
DISTCLEANFILES += buildinfo-summary.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters