Dart.cmake 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. # Dart.cmake
  2. #
  3. # This file configures a project to use the Dart testing/dashboard process.
  4. # It is broken into 3 sections.
  5. #
  6. # Section #1: Locate programs on the client and determine site and build name
  7. # Section #2: Configure or copy Tcl scripts from the source tree to build tree
  8. # Section #3: Custom targets for performing dashboard builds.
  9. #
  10. #
  11. OPTION(BUILD_TESTING "Build the testing tree." "On")
  12. IF(BUILD_TESTING)
  13. INCLUDE(${CMAKE_ROOT}/Modules/FindDart.cmake)
  14. IF (DART_ROOT)
  15. #
  16. # Section #1:
  17. #
  18. # CMake commands that will not vary from project to project. Locates programs
  19. # on the client and configure site name and build name.
  20. #
  21. # the project must have a DartConfig.cmake file
  22. IF(EXISTS ${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  23. INCLUDE(${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  24. ELSE(EXISTS ${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  25. # Dashboard is opened for submissions for a 24 hour period starting at
  26. # the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
  27. SET (NIGHTLY_START_TIME "00:00:00 EDT")
  28. # Dart server to submit results (used by client)
  29. SET (DROP_SITE "public.kitware.com")
  30. SET (DROP_LOCATION "/incoming")
  31. SET (DROP_SITE_USER "anonymous")
  32. SET (DROP_SITE_PASSWORD "random@ringworld")
  33. SET (DROP_SITE_MODE "active")
  34. SET (TRIGGER_SITE "http://${DROP_SITE}/cgi-bin/Submit-Random-TestingResults.pl")
  35. # Project Home Page
  36. SET (PROJECT_URL "http://www.kitware.com")
  37. # Dart server configuration
  38. SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/random-rollup-dashboard.sh")
  39. #SET (CVS_WEB_URL "")
  40. #SET (CVS_WEB_CVSROOT "")
  41. #SET (USE_DOXYGEN "Off")
  42. #SET (DOXYGEN_URL "" )
  43. ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  44. # make program just needs to use CMAKE_MAKE_PROGRAM which is required
  45. # to be defined by cmake
  46. SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
  47. OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes." "OFF")
  48. OPTION(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
  49. OPTION(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
  50. SET(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
  51. SET(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
  52. SET(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
  53. FIND_PROGRAM(CVSCOMMAND cvs )
  54. SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING "Options passed to the cvs update command.")
  55. SET(DART_TESTING_TIMEOUT 1500 CACHE STRING "Time alloted for a test before Dart will kill the test.")
  56. FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip
  57. DOC "Path to program used to compress files for transfer to the dart server")
  58. FIND_PROGRAM(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
  59. FIND_PROGRAM(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
  60. FIND_PROGRAM(PURIFYCOMMAND purify
  61. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
  62. DOC "Path to Rational purify command, used for memory error detection."
  63. )
  64. FIND_PROGRAM(SCPCOMMAND scp DOC "Path to scp command, used by some Dart clients for submitting results to a Dart server (when not using ftp for submissions)")
  65. # find a tcl shell command
  66. INCLUDE(${CMAKE_ROOT}/Modules/FindTclsh.cmake)
  67. # set the site name
  68. SITE_NAME(SITE)
  69. # set the build name
  70. IF(NOT BUILDNAME)
  71. SET(DART_COMPILER "${CMAKE_CXX_COMPILER}")
  72. IF(NOT DART_COMPILER)
  73. SET(DART_COMPILER "${CMAKE_C_COMPILER}")
  74. ENDIF(NOT DART_COMPILER)
  75. IF(NOT DART_COMPILER)
  76. SET(DART_COMPILER "unknown")
  77. ENDIF(NOT DART_COMPILER)
  78. IF(WIN32)
  79. SET(DART_NAME_COMPONENT "NAME_WE")
  80. ELSE(WIN32)
  81. SET(DART_NAME_COMPONENT "NAME")
  82. ENDIF(WIN32)
  83. IF(UNIX OR BORLAND)
  84. GET_FILENAME_COMPONENT(DART_CXX_NAME "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
  85. ELSE(UNIX OR BORLAND)
  86. GET_FILENAME_COMPONENT(DART_CXX_NAME "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
  87. ENDIF(UNIX OR BORLAND)
  88. SET(BUILDNAME "${CMAKE_SYSTEM_NAME}-${DART_CXX_NAME}")
  89. MESSAGE(STATUS "Using Buildname: ${BUILDNAME}")
  90. ENDIF(NOT BUILDNAME)
  91. # set the build command
  92. BUILD_COMMAND(MAKECOMMAND ${MAKEPROGRAM} )
  93. SET (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
  94. MARK_AS_ADVANCED(
  95. DART_VERBOSE_BUILD
  96. DART_BUILD_WARNING_REPORT_LIMIT
  97. DART_BUILD_ERROR_REPORT_LIMIT
  98. SITE
  99. MAKECOMMAND
  100. JAVACOMMAND
  101. PURIFYCOMMAND
  102. GUNZIPCOMMAND
  103. COMPRESSIONCOMMAND
  104. CVSCOMMAND
  105. CVS_UPDATE_OPTIONS
  106. DART_TESTING_TIMEOUT
  107. SCPCOMMAND
  108. DELIVER_CONTINUOUS_EMAIL
  109. )
  110. # BUILDNAME
  111. #
  112. # Section #2:
  113. #
  114. # Make necessary directories and configure testing scripts
  115. #
  116. # make directories in the binary tree
  117. MAKE_DIRECTORY(${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard)
  118. MAKE_DIRECTORY(${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME})
  119. # configure files
  120. CONFIGURE_FILE(
  121. ${DART_ROOT}/Source/Client/Utility.conf.in
  122. ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
  123. #
  124. # Section 3:
  125. #
  126. # Custom targets to perform dashboard builds and submissions.
  127. # These should NOT need to be modified from project to project.
  128. #
  129. # add testing targets
  130. IF(TCL_TCLSH)
  131. ADD_CUSTOM_TARGET(Experimental
  132. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update Configure Build Test)
  133. ADD_CUSTOM_TARGET(ExperimentalSubmit
  134. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Submit)
  135. # for non IDE based builds nmake and make
  136. # add all these extra targets
  137. IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
  138. # Make targets for Experimental builds
  139. ADD_CUSTOM_TARGET(ExperimentalStart
  140. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start)
  141. ADD_CUSTOM_TARGET(ExperimentalUpdate
  142. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update)
  143. ADD_CUSTOM_TARGET(ExperimentalConfigure
  144. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Configure)
  145. ADD_CUSTOM_TARGET(ExperimentalBuild
  146. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Build)
  147. ADD_CUSTOM_TARGET(ExperimentalTest
  148. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Test)
  149. ADD_CUSTOM_TARGET(ExperimentalCoverage
  150. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Coverage)
  151. ADD_CUSTOM_TARGET(ExperimentalDashboardStart
  152. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardStart)
  153. ADD_CUSTOM_TARGET(ExperimentalDashboardEnd
  154. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardEnd)
  155. # Continuous
  156. ADD_CUSTOM_TARGET(Continuous
  157. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start Update Configure Build Test Submit)
  158. ADD_CUSTOM_TARGET(ContinuousStart
  159. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start)
  160. ADD_CUSTOM_TARGET(ContinuousUpdate
  161. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Update)
  162. ADD_CUSTOM_TARGET(ContinuousConfigure
  163. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Configure)
  164. ADD_CUSTOM_TARGET(ContinuousBuild
  165. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Build)
  166. ADD_CUSTOM_TARGET(ContinuousTest
  167. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Test)
  168. ADD_CUSTOM_TARGET(ContinuousCoverage
  169. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Coverage)
  170. ADD_CUSTOM_TARGET(ContinuousSubmit
  171. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Submit)
  172. # Nightly
  173. ADD_CUSTOM_TARGET(Nightly
  174. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start Update Configure Build Test Submit)
  175. ADD_CUSTOM_TARGET(NightlyStart
  176. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start)
  177. ADD_CUSTOM_TARGET(NightlyUpdate
  178. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Update)
  179. ADD_CUSTOM_TARGET(NightlyConfigure
  180. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Configure)
  181. ADD_CUSTOM_TARGET(NightlyBuild
  182. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Build)
  183. ADD_CUSTOM_TARGET(NightlyTest
  184. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Test)
  185. ADD_CUSTOM_TARGET(NightlyCoverage
  186. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Coverage)
  187. ADD_CUSTOM_TARGET(NightlySubmit
  188. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Submit)
  189. ADD_CUSTOM_TARGET(NightlyDashboardStart
  190. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardStart)
  191. ADD_CUSTOM_TARGET(NightlyDashboardEnd
  192. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardEnd)
  193. ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
  194. ELSE(TCL_TCLSH)
  195. MESSAGE("Could not find TCL_TCLSH, disabling testing." "Error")
  196. ENDIF(TCL_TCLSH)
  197. ENABLE_TESTING()
  198. ENDIF (DART_ROOT)
  199. ENDIF(BUILD_TESTING)
  200. #
  201. # End of Dart.cmake
  202. #