Dart.cmake 3.6 KB

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