Dart.cmake 4.1 KB
Newer Older
1 2 3 4 5 6
#.rst:
# Dart
# ----
#
# Configure a project for testing with CTest or old Dart Tcl Client
#
7 8
# This file is the backwards-compatibility version of the CTest module.
# It supports using the old Dart 1 Tcl client for driving dashboard
9 10 11 12 13 14 15 16 17 18 19
# submissions as well as testing with CTest.  This module should be
# included in the CMakeLists.txt file at the top of a project.  Typical
# usage:
#
# ::
#
#   include(Dart)
#   if(BUILD_TESTING)
#     # ... testing related CMake code ...
#   endif()
#
20 21 22
# The BUILD_TESTING option is created by the Dart module to determine
# whether testing support should be enabled.  The default is ON.

23 24
# This file configures a project to use the Dart testing/dashboard process.
# It is broken into 3 sections.
25
#
26 27 28
#  Section #1: Locate programs on the client and determine site and build name
#  Section #2: Configure or copy Tcl scripts from the source tree to build tree
#  Section #3: Custom targets for performing dashboard builds.
29 30
#
#
31 32 33 34 35 36 37 38 39 40 41

#=============================================================================
# Copyright 2001-2009 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.
#=============================================================================
42
# (To distribute this file outside of CMake, substitute the full
43 44
#  License text for the above reference.)

45
option(BUILD_TESTING "Build the testing tree." ON)
46

47 48
if(BUILD_TESTING)
  find_package(Dart QUIET)
Ken Martin's avatar
Ken Martin committed
49

50 51 52 53 54 55 56
  #
  # Section #1:
  #
  # CMake commands that will not vary from project to project. Locates programs
  # on the client and configure site name and build name.
  #

57 58 59
  set(RUN_FROM_DART 1)
  include(CTest)
  set(RUN_FROM_DART)
60

61
  find_program(COMPRESSIONCOMMAND NAMES gzip compress zip
Andy Cedilnik's avatar
Andy Cedilnik committed
62
    DOC "Path to program used to compress files for transfer to the dart server")
63 64 65
  find_program(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
  find_program(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
  option(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
66
    OFF)
67 68
  option(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
  option(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
69

70 71 72 73
  set(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
  set(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
  set(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
  set (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
74

75
  mark_as_advanced(
Ken Martin's avatar
Ken Martin committed
76
    COMPRESSIONCOMMAND
77 78
    DART_BUILD_ERROR_REPORT_LIMIT
    DART_BUILD_WARNING_REPORT_LIMIT
79
    DART_TESTING_TIMEOUT
Andy Cedilnik's avatar
Andy Cedilnik committed
80
    DART_VERBOSE_BUILD
81
    DELIVER_CONTINUOUS_EMAIL
Andy Cedilnik's avatar
Andy Cedilnik committed
82
    GUNZIPCOMMAND
83
    JAVACOMMAND
84
    )
Ken Martin's avatar
Ken Martin committed
85

86 87 88
  set(HAVE_DART)
  if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
    set(HAVE_DART 1)
89
  endif()
90

91 92
  #
  # Section #2:
93
  #
94 95
  # Make necessary directories and configure testing scripts
  #
96
  # find a tcl shell command
97 98
  if(HAVE_DART)
    find_package(Tclsh)
99
  endif()
100

101

102
  if (HAVE_DART)
103
    # make directories in the binary tree
104
    file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
Andy Cedilnik's avatar
Andy Cedilnik committed
105
      "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME}")
106

107
    # configure files
108
    configure_file(
Andy Cedilnik's avatar
Andy Cedilnik committed
109 110
      "${DART_ROOT}/Source/Client/Dart.conf.in"
      "${PROJECT_BINARY_DIR}/DartConfiguration.tcl" )
111

112 113 114 115 116 117 118 119
    #
    # Section 3:
    #
    # Custom targets to perform dashboard builds and submissions.
    # These should NOT need to be modified from project to project.
    #

    # add testing targets
120 121 122
    set(DART_EXPERIMENTAL_NAME Experimental)
    if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
      set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
123 124
    endif()
  endif ()
125 126 127 128

  set(RUN_FROM_CTEST_OR_DART 1)
  include(CTestTargets)
  set(RUN_FROM_CTEST_OR_DART)
129
endif()
130 131 132 133

#
# End of Dart.cmake
#
134