Dart.cmake 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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 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. IF (DART_ROOT)
  117. # make directories in the binary tree
  118. FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard
  119. ${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME})
  120. # configure files
  121. CONFIGURE_FILE(
  122. ${DART_ROOT}/Source/Client/Utility.conf.in
  123. ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
  124. #
  125. # Section 3:
  126. #
  127. # Custom targets to perform dashboard builds and submissions.
  128. # These should NOT need to be modified from project to project.
  129. #
  130. # add testing targets
  131. IF(TCL_TCLSH)
  132. ADD_CUSTOM_TARGET(Experimental
  133. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update Configure Build Test)
  134. ADD_CUSTOM_TARGET(ExperimentalSubmit
  135. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Submit)
  136. # for non IDE based builds nmake and make
  137. # add all these extra targets
  138. IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
  139. # Make targets for Experimental builds
  140. ADD_CUSTOM_TARGET(ExperimentalStart
  141. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start)
  142. ADD_CUSTOM_TARGET(ExperimentalUpdate
  143. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update)
  144. ADD_CUSTOM_TARGET(ExperimentalConfigure
  145. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Configure)
  146. ADD_CUSTOM_TARGET(ExperimentalBuild
  147. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Build)
  148. ADD_CUSTOM_TARGET(ExperimentalTest
  149. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Test)
  150. ADD_CUSTOM_TARGET(ExperimentalCoverage
  151. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Coverage)
  152. ADD_CUSTOM_TARGET(ExperimentalDashboardStart
  153. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardStart)
  154. ADD_CUSTOM_TARGET(ExperimentalDashboardEnd
  155. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardEnd)
  156. # Continuous
  157. ADD_CUSTOM_TARGET(Continuous
  158. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start Update Configure Build Test Submit)
  159. ADD_CUSTOM_TARGET(ContinuousStart
  160. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start)
  161. ADD_CUSTOM_TARGET(ContinuousUpdate
  162. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Update)
  163. ADD_CUSTOM_TARGET(ContinuousConfigure
  164. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Configure)
  165. ADD_CUSTOM_TARGET(ContinuousBuild
  166. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Build)
  167. ADD_CUSTOM_TARGET(ContinuousTest
  168. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Test)
  169. ADD_CUSTOM_TARGET(ContinuousCoverage
  170. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Coverage)
  171. ADD_CUSTOM_TARGET(ContinuousSubmit
  172. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Submit)
  173. # Nightly
  174. ADD_CUSTOM_TARGET(Nightly
  175. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start Update Configure Build Test Submit)
  176. ADD_CUSTOM_TARGET(NightlyStart
  177. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start)
  178. ADD_CUSTOM_TARGET(NightlyUpdate
  179. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Update)
  180. ADD_CUSTOM_TARGET(NightlyConfigure
  181. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Configure)
  182. ADD_CUSTOM_TARGET(NightlyBuild
  183. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Build)
  184. ADD_CUSTOM_TARGET(NightlyTest
  185. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Test)
  186. ADD_CUSTOM_TARGET(NightlyCoverage
  187. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Coverage)
  188. ADD_CUSTOM_TARGET(NightlySubmit
  189. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Submit)
  190. ADD_CUSTOM_TARGET(NightlyDashboardStart
  191. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardStart)
  192. ADD_CUSTOM_TARGET(NightlyDashboardEnd
  193. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardEnd)
  194. ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
  195. ELSE(TCL_TCLSH)
  196. MESSAGE("Could not find TCL_TCLSH, disabling testing." "Error")
  197. ENDIF(TCL_TCLSH)
  198. ENABLE_TESTING()
  199. ELSE(DART_ROOT)
  200. # make directories in the binary tree
  201. FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
  202. GET_FILENAME_COMPONENT(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
  203. SET(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
  204. FIND_PROGRAM(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
  205. MARK_AS_ADVANCED(CMAKE_CTEST_COMMAND)
  206. # Use CTest
  207. # configure files
  208. CONFIGURE_FILE(
  209. ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
  210. ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
  211. #
  212. # Section 3:
  213. #
  214. # Custom targets to perform dashboard builds and submissions.
  215. # These should NOT need to be modified from project to project.
  216. #
  217. # add testing targets
  218. FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
  219. ADD_CUSTOM_TARGET(${mode} ${CMAKE_CTEST_COMMAND} -D ${mode})
  220. ENDFOREACH(mode)
  221. # for non IDE based builds nmake and make
  222. # add all these extra targets
  223. IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
  224. # Make targets for Experimental builds
  225. FOREACH(mode Nightly Experimental Continuous)
  226. FOREACH(testtype Start Update Configure Build Test Coverage Submit)
  227. # missing purify
  228. ADD_CUSTOM_TARGET(${mode}${testtype}
  229. ${CMAKE_CTEST_COMMAND} -D ${mode}${testtype})
  230. ENDFOREACH(testtype)
  231. ENDFOREACH(mode)
  232. ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
  233. ENDIF (DART_ROOT)
  234. ENDIF(BUILD_TESTING)
  235. #
  236. # End of Dart.cmake
  237. #