Dart.cmake 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #.rst:
  2. # Dart
  3. # ----
  4. #
  5. # Configure a project for testing with CTest or old Dart Tcl Client
  6. #
  7. # This file is the backwards-compatibility version of the CTest module.
  8. # It supports using the old Dart 1 Tcl client for driving dashboard
  9. # submissions as well as testing with CTest. This module should be
  10. # included in the CMakeLists.txt file at the top of a project. Typical
  11. # usage:
  12. #
  13. # ::
  14. #
  15. # include(Dart)
  16. # if(BUILD_TESTING)
  17. # # ... testing related CMake code ...
  18. # endif()
  19. #
  20. # The BUILD_TESTING option is created by the Dart module to determine
  21. # whether testing support should be enabled. The default is ON.
  22. # This file configures a project to use the Dart testing/dashboard process.
  23. # It is broken into 3 sections.
  24. #
  25. # Section #1: Locate programs on the client and determine site and build name
  26. # Section #2: Configure or copy Tcl scripts from the source tree to build tree
  27. # Section #3: Custom targets for performing dashboard builds.
  28. #
  29. #
  30. #=============================================================================
  31. # Copyright 2001-2009 Kitware, Inc.
  32. #
  33. # Distributed under the OSI-approved BSD License (the "License");
  34. # see accompanying file Copyright.txt for details.
  35. #
  36. # This software is distributed WITHOUT ANY WARRANTY; without even the
  37. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  38. # See the License for more information.
  39. #=============================================================================
  40. # (To distribute this file outside of CMake, substitute the full
  41. # License text for the above reference.)
  42. option(BUILD_TESTING "Build the testing tree." ON)
  43. if(BUILD_TESTING)
  44. find_package(Dart QUIET)
  45. #
  46. # Section #1:
  47. #
  48. # CMake commands that will not vary from project to project. Locates programs
  49. # on the client and configure site name and build name.
  50. #
  51. set(RUN_FROM_DART 1)
  52. include(CTest)
  53. set(RUN_FROM_DART)
  54. find_program(COMPRESSIONCOMMAND NAMES gzip compress zip
  55. DOC "Path to program used to compress files for transfer to the dart server")
  56. find_program(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
  57. find_program(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
  58. option(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
  59. OFF)
  60. option(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
  61. option(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
  62. set(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
  63. set(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
  64. set(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
  65. set (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
  66. mark_as_advanced(
  67. COMPRESSIONCOMMAND
  68. DART_BUILD_ERROR_REPORT_LIMIT
  69. DART_BUILD_WARNING_REPORT_LIMIT
  70. DART_TESTING_TIMEOUT
  71. DART_VERBOSE_BUILD
  72. DELIVER_CONTINUOUS_EMAIL
  73. GUNZIPCOMMAND
  74. JAVACOMMAND
  75. )
  76. set(HAVE_DART)
  77. if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
  78. set(HAVE_DART 1)
  79. endif()
  80. #
  81. # Section #2:
  82. #
  83. # Make necessary directories and configure testing scripts
  84. #
  85. # find a tcl shell command
  86. if(HAVE_DART)
  87. find_package(Tclsh)
  88. endif()
  89. if (HAVE_DART)
  90. # make directories in the binary tree
  91. file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
  92. "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME}")
  93. # configure files
  94. configure_file(
  95. "${DART_ROOT}/Source/Client/Dart.conf.in"
  96. "${PROJECT_BINARY_DIR}/DartConfiguration.tcl" )
  97. #
  98. # Section 3:
  99. #
  100. # Custom targets to perform dashboard builds and submissions.
  101. # These should NOT need to be modified from project to project.
  102. #
  103. # add testing targets
  104. set(DART_EXPERIMENTAL_NAME Experimental)
  105. if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
  106. set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
  107. endif()
  108. endif ()
  109. set(RUN_FROM_CTEST_OR_DART 1)
  110. include(CTestTargets)
  111. set(RUN_FROM_CTEST_OR_DART)
  112. endif()
  113. #
  114. # End of Dart.cmake
  115. #