1 #include "DumpInformation.h"
5 void cmDumpInformationPrintFile(const char* name
, FILE* fout
)
8 "Avoid ctest truncation of output: CTEST_FULL_OUTPUT\n");
10 "================================================================\n");
12 if(stat(name
, &fs
) != 0)
14 fprintf(fout
, "The file \"%s\" does not exist.\n", name
);
19 FILE* fin
= fopen(name
, "r");
23 "Contents of \"%s\":\n"
24 "----------------------------------------------------------------\n",
26 const int bufferSize
= 4096;
27 char buffer
[bufferSize
];
29 while((n
= fread(buffer
, 1, bufferSize
, fin
)) > 0)
31 for(char* c
= buffer
; c
< buffer
+n
; ++c
)
35 case '<': fprintf(fout
, "<"); break;
36 case '>': fprintf(fout
, ">"); break;
37 case '&': fprintf(fout
, "&"); break;
38 default: putc(*c
, fout
); break;
47 fprintf(fout
, "Error opening \"%s\" for reading.\n", name
);
52 int main(int,char *[])
56 DumpInformation_BINARY_DIR
"/SystemInformation.out",
57 DumpInformation_BINARY_DIR
"/AllVariables.txt",
58 DumpInformation_BINARY_DIR
"/AllCommands.txt",
59 DumpInformation_BINARY_DIR
"/AllMacros.txt",
60 DumpInformation_BINARY_DIR
"/OtherProperties.txt",
61 DumpInformation_BINARY_DIR
"/../../Source/cmConfigure.h",
62 DumpInformation_BINARY_DIR
"/../../CMakeCache.txt",
63 DumpInformation_BINARY_DIR
"/../../CMakeOutput.log",
64 DumpInformation_BINARY_DIR
"/../../CMakeError.log",
65 DumpInformation_BINARY_DIR
"/../../Bootstrap.cmk/cmake_bootstrap.log",
66 DumpInformation_BINARY_DIR
"/../../Source/cmsys/Configure.hxx",
67 DumpInformation_BINARY_DIR
"/../../Source/cmsys/Configure.h",
72 for(f
= files
; *f
; ++f
)
74 cmDumpInformationPrintFile(*f
, stdout
);