summaryrefslogtreecommitdiffstats
path: root/Tests/SystemInformation/DumpInformation.cxx
blob: 06201e7965e1ea9cf501c56a05f907c18b87e370 (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
#include <stdio.h>
#include "DumpInformation.h"

int main(int, char*[])
{
  FILE* file = fopen(CMAKE_DUMP_FILE, "r");
  if(!file)
    {
    printf("Error, could not open file %s\n", CMAKE_DUMP_FILE);
    return -1;
    }
  printf("#CMake System Variables are:");
  while(!feof(file))
    {
    int ch = fgetc(file);
    if(ch != EOF)
      {
      if(ch == '<')
        {
        printf("&lt;");
        }
      else if(ch == '>')
        {
        printf("&gt;");
        }
      else if(ch == '&')
        {
        printf("&amp;");
        }
      else 
        {
        putc(ch, stdout);
        }
      }
    }
  printf("\n");
  fclose(file);
  return 0;
}