blob: 2976a3ab9175984ae9ce6b459a0f04cedc82d54d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#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;
}
|