Updated formatting of documentation plus a little reorganization.
[cmake.git] / Modules / SystemInformation.cmake
blob370778c3248e9545be9d7f4116be3acba13ad84c
1 PROJECT(DumpInformation)
3 # first get the standard information for th platform
4 INCLUDE_DIRECTORIES("This does not exists")
5 GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES)
6 SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
8 CONFIGURE_FILE("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
11 FILE(APPEND "${RESULT_FILE}" 
12   "\n=================================================================\n")
13 FILE(APPEND "${RESULT_FILE}" 
14   "=== VARIABLES\n")
15 FILE(APPEND "${RESULT_FILE}" 
16   "=================================================================\n")
17 GET_CMAKE_PROPERTY(res VARIABLES)
18 FOREACH(var ${res})
19   FILE(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
20 ENDFOREACH(var ${res})
22 FILE(APPEND "${RESULT_FILE}" 
23   "\n=================================================================\n")
24 FILE(APPEND "${RESULT_FILE}" 
25   "=== COMMANDS\n")
26 FILE(APPEND "${RESULT_FILE}" 
27   "=================================================================\n")
28 GET_CMAKE_PROPERTY(res COMMANDS)
29 FOREACH(var ${res})
30   FILE(APPEND "${RESULT_FILE}" "${var}\n")
31 ENDFOREACH(var ${res})
33 FILE(APPEND "${RESULT_FILE}" 
34   "\n=================================================================\n")
35 FILE(APPEND "${RESULT_FILE}" 
36   "=== MACROS\n")
37 FILE(APPEND "${RESULT_FILE}" 
38   "=================================================================\n")
39 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
40 GET_CMAKE_PROPERTY(res MACROS)
41 FOREACH(var ${res})
42   FILE(APPEND "${RESULT_FILE}" "${var}\n")
43 ENDFOREACH(var ${res})
45 FILE(APPEND "${RESULT_FILE}" 
46   "\n=================================================================\n")
47 FILE(APPEND "${RESULT_FILE}" 
48   "=== OTHER\n")
49 FILE(APPEND "${RESULT_FILE}" 
50   "=================================================================\n")
51 GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES)
52 FOREACH(var ${res})
53   FILE(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
54 ENDFOREACH(var)
56 GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES)
57 FOREACH(var ${res})
58   FILE(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
59 ENDFOREACH(var)
61 GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION)
62 FILE(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
64 # include other files if they are present, such as when run from within the
65 # binary tree
66 MACRO(DUMP_FILE THE_FILE)
67   IF (EXISTS "${THE_FILE}")
68     FILE(APPEND "${RESULT_FILE}" 
69       "\n=================================================================\n")
70     FILE(APPEND "${RESULT_FILE}" 
71       "=== ${THE_FILE}\n")
72     FILE(APPEND "${RESULT_FILE}" 
73       "=================================================================\n")
74   
75     FILE(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
76     FILE(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
77   ENDIF (EXISTS "${THE_FILE}")
78 ENDMACRO(DUMP_FILE)
80 DUMP_FILE("../CMakeCache.txt")
81 DUMP_FILE("../CMakeFiles/CMakeOutput.log")
82 DUMP_FILE("../CMakeFiles/CMakeError.log")
83 DUMP_FILE("../CMakeFiles/CMakeSystem.cmake")
85 FOREACH (EXTRA_FILE ${EXTRA_DUMP_FILES})
86   DUMP_FILE("${EXTRA_FILE}")
87 ENDFOREACH (EXTRA_FILE)