diff options
Diffstat (limited to 'Tests/SystemInformation')
-rw-r--r-- | Tests/SystemInformation/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/SystemInformation/DumpInformation.cxx | 20 | ||||
-rw-r--r-- | Tests/SystemInformation/DumpInformation.h.in | 2 |
3 files changed, 21 insertions, 6 deletions
diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index 7e67f56..8fbba95 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -6,8 +6,11 @@ CONFIGURE_FILE(${DumpInformation_SOURCE_DIR}/DumpInformation.h.in ${DumpInformation_BINARY_DIR}/DumpInformation.h) ADD_EXECUTABLE(DumpInformation DumpInformation.cxx) +WRITE_FILE(${DumpInformation_BINARY_DIR}/AllVariables.txt "") GET_CMAKE_PROPERTY(VARS VARIABLES) FOREACH(var ${VARS}) - MESSAGE(STATUS "Variable ${var} \"${${var}}\"") + WRITE_FILE(${DumpInformation_BINARY_DIR}/AllVariables.txt + "${var} \"${${var}}\"" APPEND) + #MESSAGE(STATUS "Variable ${var} \"${${var}}\"") ENDFOREACH(var ${VARS}) diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx index 06201e7..2976a3a 100644 --- a/Tests/SystemInformation/DumpInformation.cxx +++ b/Tests/SystemInformation/DumpInformation.cxx @@ -1,15 +1,15 @@ #include <stdio.h> #include "DumpInformation.h" -int main(int, char*[]) +int DumpFile(char* filename, char* comment) { - FILE* file = fopen(CMAKE_DUMP_FILE, "r"); + FILE* file = fopen(filename, "r"); if(!file) { - printf("Error, could not open file %s\n", CMAKE_DUMP_FILE); - return -1; + printf("Error, could not open file %s\n", filename); + return 1; } - printf("#CMake System Variables are:"); + printf("%s", comment); while(!feof(file)) { int ch = fgetc(file); @@ -37,3 +37,13 @@ int main(int, char*[]) 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; +} diff --git a/Tests/SystemInformation/DumpInformation.h.in b/Tests/SystemInformation/DumpInformation.h.in index 8aacd46..42cfe1f 100644 --- a/Tests/SystemInformation/DumpInformation.h.in +++ b/Tests/SystemInformation/DumpInformation.h.in @@ -1 +1,3 @@ #define CMAKE_DUMP_FILE "${DumpInformation_BINARY_DIR}/SystemInformation.out" +#define CMAKE_CACHE_FILE "${CMAKE_BINARY_DIR}/../../CMakeCache.txt" +#define CMAKE_ALL_VARIABLES "${CMAKE_BINARY_DIR}/AllVariables.txt" |