Dart.cmake 3.6 KB

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