| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #include <stdio.h>
- #include "DumpInformation.h"
- int DumpFile(char* filename, char* comment)
- {
- FILE* file = fopen(filename, "r");
- if(!file)
- {
- printf("Error, could not open file %s\n", filename);
- return 1;
- }
- printf("%s", comment);
- while(!feof(file))
- {
- int ch = fgetc(file);
- if(ch != EOF)
- {
- if(ch == '<')
- {
- printf("<");
- }
- else if(ch == '>')
- {
- printf(">");
- }
- else if(ch == '&')
- {
- printf("&");
- }
- else
- {
- putc(ch, stdout);
- }
- }
- }
- printf("\n");
- fclose(file);
- return 0;
- }
- int main(int, char*[])
- {
- int res = 0;
- res += DumpFile(CMAKE_DUMP_FILE, "#CMake System Variables are:");
- res += DumpFile(CMAKE_CACHE_FILE, "#CMake Cache is:");
- res += DumpFile(CMAKE_ALL_VARIABLES, "#CMake Variables are:");
- return res;
- }
|