CMake/Modules/SystemInformation.cmake
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00

104 lines
3.6 KiB
CMake

#=============================================================================
# Copyright 2007-2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
cmake_minimum_required(VERSION ${CMAKE_VERSION})
project(DumpInformation)
# first get the standard information for th platform
include_directories("This does not exists")
get_directory_property(incl INCLUDE_DIRECTORIES)
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
configure_file("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
file(APPEND "${RESULT_FILE}"
"=== VARIABLES\n")
file(APPEND "${RESULT_FILE}"
"=================================================================\n")
get_cmake_property(res VARIABLES)
foreach(var ${res})
file(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
endforeach()
file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
file(APPEND "${RESULT_FILE}"
"=== COMMANDS\n")
file(APPEND "${RESULT_FILE}"
"=================================================================\n")
get_cmake_property(res COMMANDS)
foreach(var ${res})
file(APPEND "${RESULT_FILE}" "${var}\n")
endforeach()
file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
file(APPEND "${RESULT_FILE}"
"=== MACROS\n")
file(APPEND "${RESULT_FILE}"
"=================================================================\n")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
get_cmake_property(res MACROS)
foreach(var ${res})
file(APPEND "${RESULT_FILE}" "${var}\n")
endforeach()
file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
file(APPEND "${RESULT_FILE}"
"=== OTHER\n")
file(APPEND "${RESULT_FILE}"
"=================================================================\n")
get_directory_property(res INCLUDE_DIRECTORIES)
foreach(var ${res})
file(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
endforeach()
get_directory_property(res LINK_DIRECTORIES)
foreach(var ${res})
file(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
endforeach()
get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
file(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
# include other files if they are present, such as when run from within the
# binary tree
macro(DUMP_FILE THE_FILE)
if (EXISTS "${THE_FILE}")
file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
file(APPEND "${RESULT_FILE}"
"=== ${THE_FILE}\n")
file(APPEND "${RESULT_FILE}"
"=================================================================\n")
file(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
file(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
endif ()
endmacro()
DUMP_FILE("../CMakeCache.txt")
DUMP_FILE("../CMakeFiles/CMakeOutput.log")
DUMP_FILE("../CMakeFiles/CMakeError.log")
DUMP_FILE("../CMakeFiles/CMakeSystem.cmake")
foreach (EXTRA_FILE ${EXTRA_DUMP_FILES})
DUMP_FILE("${EXTRA_FILE}")
endforeach ()