VTKmSystemInformation.cmake 2.26 KB
Newer Older
1 2 3 4 5 6 7 8
##============================================================================
##  Copyright (c) Kitware, Inc.
##  All rights reserved.
##  See LICENSE.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 above copyright notice for more information.
##
9
##  Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
10
##  Copyright 2014 UT-Battelle, LLC.
11
##  Copyright 2014 Los Alamos National Security.
12
##
13
##  Under the terms of Contract DE-NA0003525 with NTESS,
14 15 16 17 18 19 20 21 22 23 24 25 26 27
##  the U.S. Government retains certain rights in this software.
##
##  Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
##  Laboratory (LANL), the U.S. Government retains certain rights in
##  this software.
##============================================================================

# This script is used to create the SystemInformation test. The test always
# passes. It just captures in its output the configuration of the system.
# This allows you to inspect the configuration of the system of a failed
# dashboard in case you don't have access to that dashboard.
#
# This script is called with a command like:
#
28
# cmake -D VTKm_BINARY_DIR=<top-of-build-tree> -D VTKm_SOURCE_DIR=<top-of-source-tree> -P <this-script>
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#

set(FILES
  vtkm/internal/Configure.h
  CMakeCache.txt
  CMakeFiles/CMakeError.log
  )

function(print_file filename)
  set(full_filename "${VTKm_BINARY_DIR}/${filename}")
  message("

==============================================================================

Contents of \"${filename}\":
------------------------------------------------------------------------------")
  if(EXISTS "${full_filename}")
    file(READ ${full_filename} contents)
    message("${contents}")
  else()
    message("The file \"${full_filename}\" does not exist.")
  endif()
endfunction(print_file)

53

54 55
message("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")

56 57 58 59 60 61 62 63 64 65 66 67
execute_process(
  COMMAND git rev-parse -q HEAD
  WORKING_DIRECTORY "${VTKm_SOURCE_DIR}"
  OUTPUT_VARIABLE GIT_SHA
  )

message("

==============================================================================

git SHA: ${GIT_SHA}")

68 69 70
foreach(filename ${FILES})
  print_file(${filename})
endforeach()