Dashboard.cmake.in 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # This "ctest -S" script may be configured to drive a nightly dashboard on any
  2. # Linux machine.
  3. #
  4. set(CTEST_BINARY_DIRECTORY "@binary_dir@")
  5. set(CTEST_BUILD_NAME "@BUILDNAME@")
  6. set(CTEST_SITE "@SITE@")
  7. set(CTEST_SOURCE_DIRECTORY "@source_dir@")
  8. set(PROCESSOR_COUNT "@PROCESSOR_COUNT@")
  9. # Assume a Linux build, with a make that supports -j. Modify this script if
  10. # assumption is ever invalid.
  11. #
  12. if(PROCESSOR_COUNT)
  13. set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
  14. endif()
  15. set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
  16. set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
  17. message("Cleaning binary dir '${CTEST_BINARY_DIRECTORY}'")
  18. ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")
  19. # Intentionally no ctest_update step in this script. This script is run as a
  20. # "Contract" test on a CMake dashboard submission using the just-built ctest
  21. # as the driver. The download step in the Contract CMakeLists file takes care
  22. # of setting up the source tree before calling this ctest -S script. The idea
  23. # is that the source tree will be the same every day, so there should not be
  24. # an "update" step for this build.
  25. message("Configuring CSE in binary dir '${CTEST_BINARY_DIRECTORY}'")
  26. set_property(GLOBAL PROPERTY SubProject "CSE-toplevel")
  27. set_property(GLOBAL PROPERTY Label "CSE-toplevel")
  28. ctest_start("Experimental")
  29. set(CSE_TOPLEVEL_OPTIONS
  30. -DEXTERNAL_PROJECT_DASHBOARD_BUILD:BOOL=ON
  31. -DEXTERNAL_PROJECT_TESTS:BOOL=ON
  32. -DCSE_INSTALL_PREFIX:PATH=${CTEST_BINARY_DIRECTORY}/built
  33. -DCSE_SUBSET:STRING=ALL
  34. -DCTEST_SITE:STRING=${CTEST_SITE}
  35. )
  36. ctest_configure(OPTIONS "${CSE_TOPLEVEL_OPTIONS}")
  37. # The configure step produces a file listing the CSE packages and dependencies.
  38. # This file also generates Project.xml and stores it in ${PROJECT_XML}.
  39. #
  40. set(subprojects "")
  41. if(EXISTS "${CTEST_BINARY_DIRECTORY}/CSEBuildtimeDepends.cmake")
  42. message("Including CSEBuildtimeDepends.cmake")
  43. include("${CTEST_BINARY_DIRECTORY}/CSEBuildtimeDepends.cmake")
  44. set(subprojects ${CSE_ALL_SORTED})
  45. message("Submitting Project.xml")
  46. ctest_submit(FILES ${PROJECT_XML})
  47. endif()
  48. message("Submitting CSE configure results")
  49. ctest_submit()
  50. if(subprojects)
  51. message("Building by looping over subprojects...")
  52. foreach(subproject ${subprojects})
  53. message("########## ${subproject} ##########")
  54. set_property(GLOBAL PROPERTY SubProject "${subproject}")
  55. set_property(GLOBAL PROPERTY Label "${subproject}")
  56. ctest_build(TARGET "${subproject}" APPEND)
  57. message("Submitting ${subproject} build results")
  58. ctest_submit(PARTS build)
  59. endforeach()
  60. else()
  61. message("Building all...")
  62. ctest_build(APPEND)
  63. message("Submitting build results")
  64. ctest_submit(PARTS build)
  65. endif()