Dart.cmake 3.7 KB

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