SystemInformation.cmake 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. cmake_minimum_required(VERSION ${CMAKE_VERSION})
  4. project(DumpInformation)
  5. # first get the standard information for th platform
  6. include_directories("This does not exists")
  7. get_directory_property(incl INCLUDE_DIRECTORIES)
  8. set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
  9. configure_file("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
  10. file(APPEND "${RESULT_FILE}"
  11. "\n=================================================================\n")
  12. file(APPEND "${RESULT_FILE}"
  13. "=== VARIABLES\n")
  14. file(APPEND "${RESULT_FILE}"
  15. "=================================================================\n")
  16. get_cmake_property(res VARIABLES)
  17. foreach(var ${res})
  18. file(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
  19. endforeach()
  20. file(APPEND "${RESULT_FILE}"
  21. "\n=================================================================\n")
  22. file(APPEND "${RESULT_FILE}"
  23. "=== COMMANDS\n")
  24. file(APPEND "${RESULT_FILE}"
  25. "=================================================================\n")
  26. get_cmake_property(res COMMANDS)
  27. foreach(var ${res})
  28. file(APPEND "${RESULT_FILE}" "${var}\n")
  29. endforeach()
  30. file(APPEND "${RESULT_FILE}"
  31. "\n=================================================================\n")
  32. file(APPEND "${RESULT_FILE}"
  33. "=== MACROS\n")
  34. file(APPEND "${RESULT_FILE}"
  35. "=================================================================\n")
  36. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
  37. get_cmake_property(res MACROS)
  38. foreach(var ${res})
  39. file(APPEND "${RESULT_FILE}" "${var}\n")
  40. endforeach()
  41. file(APPEND "${RESULT_FILE}"
  42. "\n=================================================================\n")
  43. file(APPEND "${RESULT_FILE}"
  44. "=== OTHER\n")
  45. file(APPEND "${RESULT_FILE}"
  46. "=================================================================\n")
  47. get_directory_property(res INCLUDE_DIRECTORIES)
  48. foreach(var ${res})
  49. file(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
  50. endforeach()
  51. get_directory_property(res LINK_DIRECTORIES)
  52. foreach(var ${res})
  53. file(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
  54. endforeach()
  55. get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
  56. file(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
  57. # include other files if they are present, such as when run from within the
  58. # binary tree
  59. macro(DUMP_FILE THE_FILE)
  60. if (EXISTS "${THE_FILE}")
  61. file(APPEND "${RESULT_FILE}"
  62. "\n=================================================================\n")
  63. file(APPEND "${RESULT_FILE}"
  64. "=== ${THE_FILE}\n")
  65. file(APPEND "${RESULT_FILE}"
  66. "=================================================================\n")
  67. file(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
  68. file(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
  69. endif ()
  70. endmacro()
  71. DUMP_FILE("../CMakeCache.txt")
  72. DUMP_FILE("../CMakeFiles/CMakeOutput.log")
  73. DUMP_FILE("../CMakeFiles/CMakeError.log")
  74. DUMP_FILE("../CMakeFiles/CMakeSystem.cmake")
  75. foreach (EXTRA_FILE ${EXTRA_DUMP_FILES})
  76. DUMP_FILE("${EXTRA_FILE}")
  77. endforeach ()