2 #=============================================================================
3 # Copyright 2007-2010 Kitware, Inc.
5 # Distributed under the OSI-approved BSD License (the "License");
6 # see accompanying file Copyright.txt for details.
8 # This software is distributed WITHOUT ANY WARRANTY; without even the
9 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # See the License for more information.
11 #=============================================================================
12 # (To distribute this file outside of CMake, substitute the full
13 # License text for the above reference.)
15 cmake_minimum_required(VERSION ${CMAKE_VERSION})
16 project(DumpInformation)
18 # first get the standard information for th platform
19 include_directories("This does not exists")
20 get_directory_property(incl INCLUDE_DIRECTORIES)
21 set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
23 configure_file("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
26 file(APPEND "${RESULT_FILE}"
27 "\n=================================================================\n")
28 file(APPEND "${RESULT_FILE}"
30 file(APPEND "${RESULT_FILE}"
31 "=================================================================\n")
32 get_cmake_property(res VARIABLES)
34 file(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
37 file(APPEND "${RESULT_FILE}"
38 "\n=================================================================\n")
39 file(APPEND "${RESULT_FILE}"
41 file(APPEND "${RESULT_FILE}"
42 "=================================================================\n")
43 get_cmake_property(res COMMANDS)
45 file(APPEND "${RESULT_FILE}" "${var}\n")
48 file(APPEND "${RESULT_FILE}"
49 "\n=================================================================\n")
50 file(APPEND "${RESULT_FILE}"
52 file(APPEND "${RESULT_FILE}"
53 "=================================================================\n")
54 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
55 get_cmake_property(res MACROS)
57 file(APPEND "${RESULT_FILE}" "${var}\n")
60 file(APPEND "${RESULT_FILE}"
61 "\n=================================================================\n")
62 file(APPEND "${RESULT_FILE}"
64 file(APPEND "${RESULT_FILE}"
65 "=================================================================\n")
66 get_directory_property(res INCLUDE_DIRECTORIES)
68 file(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
71 get_directory_property(res LINK_DIRECTORIES)
73 file(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
76 get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
77 file(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
79 # include other files if they are present, such as when run from within the
81 macro(DUMP_FILE THE_FILE)
82 if (EXISTS "${THE_FILE}")
83 file(APPEND "${RESULT_FILE}"
84 "\n=================================================================\n")
85 file(APPEND "${RESULT_FILE}"
87 file(APPEND "${RESULT_FILE}"
88 "=================================================================\n")
90 file(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
91 file(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
95 DUMP_FILE("../CMakeCache.txt")
96 DUMP_FILE("../CMakeFiles/CMakeOutput.log")
97 DUMP_FILE("../CMakeFiles/CMakeError.log")
98 DUMP_FILE("../CMakeFiles/CMakeSystem.cmake")
100 foreach (EXTRA_FILE ${EXTRA_DUMP_FILES})
101 DUMP_FILE("${EXTRA_FILE}")