summaryrefslogtreecommitdiffstats
path: root/Modules/Dart.cmake
blob: 84efa5fa9f905a56160924df3ae3242ef27c9633 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Dart.cmake
#
# This file configures a project to use the Dart testing/dashboard process.
# It is broken into 3 sections.
# 
# Section #1: Locate programs on the client and determine site and build name
# Section #2: Configure or copy Tcl scripts from the source tree to build tree
# Section #3: Custom targets for performing dashboard builds.
#
#
OPTION(BUILD_TESTING "Build the testing tree." "On")

IF(BUILD_TESTING)
  #
  # Section #1:
  #
  # CMake commands that will not vary from project to project. Locates programs
  # on the client and configure site name and build name.
  #

  # find programs used by testing
  # look for the make program
  IF(NOT UNIX) 
    FIND_PROGRAM(MAKEPROGRAM msdev )
  ENDIF(NOT UNIX)
  FIND_PROGRAM(MAKEPROGRAM NAMES gmake make )
  FIND_PROGRAM(CVSCOMMAND cvs )
  FIND_PROGRAM(GREPCOMMAND grep )
  FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip )
  FIND_PROGRAM(GUNZIPCOMMAND gunzip )
  FIND_PROGRAM(JAVACOMMAND java )

  # find a tcl shell command
  IF (UNIX)
    FIND_PROGRAM(TCLSHCOMMAND cygtclsh80 )
  ENDIF(UNIX)
  FIND_PROGRAM(TCLSHCOMMAND 
               NAMES tclsh tclsh83 tclsh8.3 tclsh82 tclsh8.2 tclsh80 tclsh8.0 
               )
  FIND_PROGRAM(HOSTNAME hostname /usr/bsd /usr/sbin /usr/bin /bin /sbin)
  FIND_PROGRAM(NSLOOKUP nslookup /usr/bin /usr/sbin /usr/local/bin)

  # set the site name
  SITE_NAME(SITE)
  # set the build name
  BUILD_NAME(BUILDNAME)
  # set the build command
  BUILD_COMMAND(MAKECOMMAND ${MAKEPROGRAM} )

  #
  # Section #2:
  # 
  # Make necessary directories and configure testing scripts
  #

  # make directories in the binary tree
  MAKE_DIRECTORY(${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME})

  # configure files
  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/Utility.conf.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/Utility.conf )

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/Build.tcl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/Build.tcl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/Utility.tcl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/Utility.tcl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/DashboardManager.tcl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/DashboardManager.tcl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/Test.tcl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/Test.tcl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/Submit.tcl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/Submit.tcl COPYONLY)
  
  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/Doxygen.tcl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/Doxygen.tcl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/DashboardConfig.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/DashboardConfig.xsl )

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/Build.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/Build.xsl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/Coverage.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/Coverage.xsl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/CoverageLog.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/CoverageLog.xsl COPYONLY)
  
  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/Dashboard.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/Dashboard.xsl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/Doxygen.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/Doxygen.xsl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/Purify.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/Purify.xsl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/Test.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/Test.xsl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/TestOverview.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/TestOverview.xsl COPYONLY)

  CONFIGURE_FILE(
  ${PROJECT_SOURCE_DIR}/Testing/Utilities/XSL/Update.xsl.in
  ${PROJECT_BINARY_DIR}/Testing/Utilities/XSL/Update.xsl COPYONLY)

  #
  # Section 3:
  #
  # Custom targets to perform dashboard builds and submissions.
  # These should NOT need to be modified from project to project.
  #

  # add testing targets
  ADD_CUSTOM_TARGET(Nightly 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Nightly Start Build Test Submit")
  ADD_CUSTOM_TARGET(NightlyBuild   
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Nightly Start Build")
  ADD_CUSTOM_TARGET(NightlyTest 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Nightly Test")
  ADD_CUSTOM_TARGET(NightlyCoverage 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Nightly Coverage")
  ADD_CUSTOM_TARGET(NightlySubmit 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Nightly Submit")
  ADD_CUSTOM_TARGET(NightlyDashboardStart 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Nightly DashboardStart")
  ADD_CUSTOM_TARGET(NightlyDashboardEnd 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Nightly DashboardEnd")
  ADD_CUSTOM_TARGET(ExperimentalBuild 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Experimental Start Build")
  ADD_CUSTOM_TARGET(ExperimentalTest 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Experimental Test")
  ADD_CUSTOM_TARGET(ExperimentalCoverage 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Experimental Coverage")
  ADD_CUSTOM_TARGET(ExperimentalSubmit 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Experimental Submit")
  ADD_CUSTOM_TARGET(Experimental 
  "${TCLSHCOMMAND} Testing/Utilities/DashboardManager.tcl Experimental Start Build Test Submit")

ENDIF(BUILD_TESTING)

#
# End of Dart.cmake
#