Dart.cmake 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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. #
  15. # Section #1:
  16. #
  17. # CMake commands that will not vary from project to project. Locates programs
  18. # on the client and configure site name and build name.
  19. #
  20. # the project must have a DartConfig.cmake file
  21. IF(EXISTS ${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  22. INCLUDE(${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  23. ELSE(EXISTS ${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  24. # Dashboard is opened for submissions for a 24 hour period starting at
  25. # the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
  26. SET (NIGHTLY_START_TIME "00:00:00 EDT")
  27. # Dart server to submit results (used by client)
  28. SET (DROP_SITE "public.kitware.com")
  29. SET (DROP_LOCATION "/incoming")
  30. SET (DROP_SITE_USER "anonymous")
  31. SET (DROP_SITE_PASSWORD "random@ringworld")
  32. SET (DROP_SITE_MODE "active")
  33. SET (TRIGGER_SITE "http://${DROP_SITE}/cgi-bin/Submit-Random-TestingResults.pl")
  34. # Project Home Page
  35. SET (PROJECT_URL "http://www.kitware.com")
  36. # Dart server configuration
  37. SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/random-rollup-dashboard.sh")
  38. #SET (CVS_WEB_URL "")
  39. #SET (CVS_WEB_CVSROOT "")
  40. #SET (USE_DOXYGEN "Off")
  41. #SET (DOXYGEN_URL "" )
  42. ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  43. # make program just needs to use CMAKE_MAKE_PROGRAM which is required
  44. # to be defined by cmake
  45. SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
  46. OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
  47. 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_PROGRAM(COVERAGE_COMMAND gcov DOC "Path to the coverage program that Dart client uses for performing coverage inspection")
  66. # find a tcl shell command
  67. INCLUDE(${CMAKE_ROOT}/Modules/FindTclsh.cmake)
  68. # set the site name
  69. SITE_NAME(SITE)
  70. # set the build name
  71. IF(NOT BUILDNAME)
  72. SET(DART_COMPILER "${CMAKE_CXX_COMPILER}")
  73. IF(NOT DART_COMPILER)
  74. SET(DART_COMPILER "${CMAKE_C_COMPILER}")
  75. ENDIF(NOT DART_COMPILER)
  76. IF(NOT DART_COMPILER)
  77. SET(DART_COMPILER "unknown")
  78. ENDIF(NOT DART_COMPILER)
  79. IF(WIN32)
  80. SET(DART_NAME_COMPONENT "NAME_WE")
  81. ELSE(WIN32)
  82. SET(DART_NAME_COMPONENT "NAME")
  83. ENDIF(WIN32)
  84. IF(UNIX OR BORLAND)
  85. GET_FILENAME_COMPONENT(DART_CXX_NAME "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
  86. ELSE(UNIX OR BORLAND)
  87. GET_FILENAME_COMPONENT(DART_CXX_NAME "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
  88. ENDIF(UNIX OR BORLAND)
  89. SET(BUILDNAME "${CMAKE_SYSTEM_NAME}-${DART_CXX_NAME}")
  90. MESSAGE(STATUS "Using Buildname: ${BUILDNAME}")
  91. ENDIF(NOT BUILDNAME)
  92. # set the build command
  93. BUILD_COMMAND(MAKECOMMAND ${MAKEPROGRAM} )
  94. SET (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
  95. MARK_AS_ADVANCED(
  96. DART_VERBOSE_BUILD
  97. DART_BUILD_WARNING_REPORT_LIMIT
  98. DART_BUILD_ERROR_REPORT_LIMIT
  99. SITE
  100. MAKECOMMAND
  101. JAVACOMMAND
  102. PURIFYCOMMAND
  103. GUNZIPCOMMAND
  104. COMPRESSIONCOMMAND
  105. CVSCOMMAND
  106. CVS_UPDATE_OPTIONS
  107. DART_TESTING_TIMEOUT
  108. SCPCOMMAND
  109. COVERAGE_COMMAND
  110. DELIVER_CONTINUOUS_EMAIL
  111. )
  112. # BUILDNAME
  113. #
  114. # Section #2:
  115. #
  116. # Make necessary directories and configure testing scripts
  117. #
  118. IF (DART_ROOT)
  119. # make directories in the binary tree
  120. FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard
  121. ${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME})
  122. # configure files
  123. CONFIGURE_FILE(
  124. ${DART_ROOT}/Source/Client/Utility.conf.in
  125. ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
  126. #
  127. # Section 3:
  128. #
  129. # Custom targets to perform dashboard builds and submissions.
  130. # These should NOT need to be modified from project to project.
  131. #
  132. # add testing targets
  133. IF(TCL_TCLSH)
  134. SET(DART_EXPERIMENTAL_NAME Experimental)
  135. IF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
  136. SET(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
  137. ENDIF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
  138. ADD_CUSTOM_TARGET(${DART_EXPERIMENTAL_NAME}
  139. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update Configure Build Test)
  140. ADD_CUSTOM_TARGET(${DART_EXPERIMENTAL_NAME}Submit
  141. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Submit)
  142. # for non IDE based builds nmake and make
  143. # add all these extra targets
  144. IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
  145. # Make targets for Experimental builds
  146. ADD_CUSTOM_TARGET(ExperimentalStart
  147. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start)
  148. ADD_CUSTOM_TARGET(ExperimentalUpdate
  149. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update)
  150. ADD_CUSTOM_TARGET(ExperimentalConfigure
  151. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Configure)
  152. ADD_CUSTOM_TARGET(ExperimentalBuild
  153. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Build)
  154. ADD_CUSTOM_TARGET(ExperimentalTest
  155. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Test)
  156. ADD_CUSTOM_TARGET(ExperimentalCoverage
  157. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Coverage)
  158. ADD_CUSTOM_TARGET(ExperimentalDashboardStart
  159. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardStart)
  160. ADD_CUSTOM_TARGET(ExperimentalDashboardEnd
  161. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardEnd)
  162. # Continuous
  163. ADD_CUSTOM_TARGET(Continuous
  164. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start Update Configure Build Test Submit)
  165. ADD_CUSTOM_TARGET(ContinuousStart
  166. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start)
  167. ADD_CUSTOM_TARGET(ContinuousUpdate
  168. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Update)
  169. ADD_CUSTOM_TARGET(ContinuousConfigure
  170. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Configure)
  171. ADD_CUSTOM_TARGET(ContinuousBuild
  172. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Build)
  173. ADD_CUSTOM_TARGET(ContinuousTest
  174. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Test)
  175. ADD_CUSTOM_TARGET(ContinuousCoverage
  176. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Coverage)
  177. ADD_CUSTOM_TARGET(ContinuousSubmit
  178. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Submit)
  179. # Nightly
  180. ADD_CUSTOM_TARGET(Nightly
  181. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start Update Configure Build Test Submit)
  182. ADD_CUSTOM_TARGET(NightlyStart
  183. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start)
  184. ADD_CUSTOM_TARGET(NightlyUpdate
  185. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Update)
  186. ADD_CUSTOM_TARGET(NightlyConfigure
  187. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Configure)
  188. ADD_CUSTOM_TARGET(NightlyBuild
  189. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Build)
  190. ADD_CUSTOM_TARGET(NightlyTest
  191. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Test)
  192. ADD_CUSTOM_TARGET(NightlyCoverage
  193. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Coverage)
  194. ADD_CUSTOM_TARGET(NightlySubmit
  195. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Submit)
  196. ADD_CUSTOM_TARGET(NightlyDashboardStart
  197. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardStart)
  198. ADD_CUSTOM_TARGET(NightlyDashboardEnd
  199. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardEnd)
  200. ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
  201. ELSE(TCL_TCLSH)
  202. MESSAGE("Could not find TCL_TCLSH, disabling testing." "Error")
  203. ENDIF(TCL_TCLSH)
  204. ENABLE_TESTING()
  205. ELSE(DART_ROOT)
  206. # make directories in the binary tree
  207. FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
  208. GET_FILENAME_COMPONENT(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
  209. SET(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
  210. FIND_PROGRAM(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
  211. MARK_AS_ADVANCED(CMAKE_CTEST_COMMAND)
  212. # Use CTest
  213. # configure files
  214. CONFIGURE_FILE(
  215. ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
  216. ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
  217. #
  218. # Section 3:
  219. #
  220. # Custom targets to perform dashboard builds and submissions.
  221. # These should NOT need to be modified from project to project.
  222. #
  223. # add testing targets
  224. FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
  225. ADD_CUSTOM_TARGET(${mode} ${CMAKE_CTEST_COMMAND} -D ${mode})
  226. ENDFOREACH(mode)
  227. # for non IDE based builds nmake and make
  228. # add all these extra targets
  229. IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
  230. # Make targets for Experimental builds
  231. FOREACH(mode Nightly Experimental Continuous)
  232. FOREACH(testtype Start Update Configure Build Test Coverage Submit)
  233. # missing purify
  234. ADD_CUSTOM_TARGET(${mode}${testtype}
  235. ${CMAKE_CTEST_COMMAND} -D ${mode}${testtype})
  236. ENDFOREACH(testtype)
  237. ENDFOREACH(mode)
  238. ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
  239. ENDIF (DART_ROOT)
  240. ENDIF(BUILD_TESTING)
  241. #
  242. # End of Dart.cmake
  243. #