Dart.cmake 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. INCLUDE(${PROJECT_SOURCE_DIR}/DartConfig.cmake)
  23. # find programs used by testing
  24. # look for the make program
  25. IF(NOT UNIX)
  26. FIND_PROGRAM(MAKEPROGRAM msdev )
  27. ENDIF(NOT UNIX)
  28. FIND_PROGRAM(MAKEPROGRAM NAMES gmake make )
  29. FIND_PROGRAM(CVSCOMMAND cvs )
  30. FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip )
  31. FIND_PROGRAM(GUNZIPCOMMAND gunzip )
  32. FIND_PROGRAM(JAVACOMMAND java )
  33. FIND_PROGRAM(PURIFYCOMMAND purify )
  34. # find a tcl shell command
  35. IF (UNIX)
  36. FIND_PROGRAM(TCL_TCLSH cygtclsh80 )
  37. ENDIF(UNIX)
  38. FIND_PROGRAM(TCL_TCLSH
  39. NAMES tclsh tclsh83 tclsh8.3 tclsh82 tclsh8.2 tclsh80 tclsh8.0
  40. )
  41. FIND_PROGRAM(HOSTNAME hostname /usr/bsd /usr/sbin /usr/bin /bin /sbin)
  42. FIND_PROGRAM(NSLOOKUP nslookup /usr/bin /usr/sbin /usr/local/bin)
  43. # set the site name
  44. SITE_NAME(SITE)
  45. # set the build name
  46. BUILD_NAME(BUILDNAME)
  47. # set the build command
  48. BUILD_COMMAND(MAKECOMMAND ${MAKEPROGRAM} )
  49. #
  50. # Section #2:
  51. #
  52. # Make necessary directories and configure testing scripts
  53. #
  54. # make directories in the binary tree
  55. MAKE_DIRECTORY(${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard)
  56. MAKE_DIRECTORY(${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME})
  57. # configure files
  58. CONFIGURE_FILE(
  59. ${DART_ROOT}/Source/Client/Utility.conf.in
  60. ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
  61. #
  62. # Section 3:
  63. #
  64. # Custom targets to perform dashboard builds and submissions.
  65. # These should NOT need to be modified from project to project.
  66. #
  67. # add testing targets
  68. IF(TCL_TCLSH)
  69. ADD_CUSTOM_TARGET(Experimental
  70. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Build Test)
  71. ADD_CUSTOM_TARGET(ExperimentalSubmit
  72. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Submit)
  73. ELSE(TCL_TCLSH)
  74. MESSAGE("Could not find TCL_TCLSH, disabling testing." "Error")
  75. ENDIF(TCL_TCLSH)
  76. ENABLE_TESTING()
  77. ENDIF (DART_ROOT)
  78. ENDIF(BUILD_TESTING)
  79. #
  80. # End of Dart.cmake
  81. #