ctkTravisDashboardScript.cmake 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #
  2. # OS: Travis CI Linux
  3. # Hardware: x86_64 GNU/Linux VM
  4. # GPU: NA
  5. #
  6. # Note: The specific version and processor type of this machine should be reported in the
  7. # header above. Indeed, this file will be send to the dashboard as a NOTE file.
  8. cmake_minimum_required(VERSION 2.8)
  9. #
  10. # For additional information, see http://www.commontk.org/index.php/Dashboard_setup
  11. #
  12. set(CTK_QT_VERSION $ENV{CTK_QT_VERSION})
  13. if(NOT CTK_QT_VERSION)
  14. set(CTK_QT_VERSION 4)
  15. endif()
  16. #
  17. # Dashboard properties
  18. #
  19. set(MY_OPERATING_SYSTEM "Ubuntu-12.04")
  20. set(MY_COMPILER "g++4.6.3")
  21. set(CTEST_SITE "travis-ci") # for example: mymachine.kitware, mymachine.dkfz, ...
  22. set(CTEST_DASHBOARD_ROOT "$ENV{HOME}/build/commontk")
  23. set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
  24. find_package(Qt${CTK_QT_VERSION} REQUIRED)
  25. if(NOT Qt${CTK_QT_VERSION}_FOUND)
  26. message(SEND_ERROR "Qt${CTK_QT_VERSION} not found.")
  27. set(MY_QT_VERSION ${QTVERSION})
  28. #
  29. # Dashboard options
  30. #
  31. set(WITH_KWSTYLE FALSE)
  32. set(WITH_MEMCHECK FALSE)
  33. set(WITH_COVERAGE TRUE)
  34. set(WITH_DOCUMENTATION FALSE)
  35. #set(DOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY ) # for example: $ENV{HOME}/Projects/Doxygen
  36. set(CTEST_BUILD_CONFIGURATION "Release")
  37. set(CTEST_TEST_TIMEOUT 500)
  38. set(CTEST_BUILD_FLAGS "-j4") # Use multiple CPU cores to build
  39. set(CTEST_PARALLEL_LEVEL 4) # Number of tests running in parallel
  40. # experimental:
  41. # - run_ctest() macro will be called *ONE* time
  42. # - binary directory will *NOT* be cleaned
  43. # continuous:
  44. # - run_ctest() macro will be called EVERY 5 minutes ...
  45. # - binary directory will *NOT* be cleaned
  46. # - configure/build will be executed *ONLY* if the repository has been updated
  47. # nightly:
  48. # - run_ctest() macro will be called *ONE* time
  49. # - binary directory *WILL BE* cleaned
  50. set(SCRIPT_MODE "experimental") # "experimental", "continuous", "nightly"
  51. #
  52. # Project specific properties
  53. #
  54. set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CTK")
  55. set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CTK-Superbuild-${CTEST_BUILD_CONFIGURATION}-${SCRIPT_MODE}")
  56. # Additional CMakeCache options - For example:
  57. # CTK_LIB_Widgets:BOOL=ON
  58. # CTK_APP_ctkDICOM:BOOL=ON
  59. set(ADDITIONNAL_CMAKECACHE_OPTION "
  60. CTK_QT_VERSION:STRING=${CTK_QT_VERSION}
  61. CTK_BUILD_ALL:BOOL=ON
  62. CTK_BUILD_EXAMPLES:BOOL=ON
  63. CTK_USE_SYSTEM_VTK:BOOL=ON
  64. ")
  65. # List of test that should be explicitly disabled on this machine
  66. set(TEST_TO_EXCLUDE_REGEX "")
  67. # set any extra environment variables here
  68. #set(ENV{DISPLAY} ":9")
  69. find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
  70. find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
  71. find_program(CTEST_GIT_COMMAND NAMES git)
  72. #
  73. # Git repository - Overwrite the default value provided by the driver script
  74. #
  75. # set(GIT_REPOSITORY http://github.com/YOURUSERNAME/CTK.git)
  76. ##########################################
  77. # WARNING: DO NOT EDIT BEYOND THIS POINT #
  78. ##########################################
  79. set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
  80. #
  81. # Project specific properties
  82. #
  83. set(CTEST_PROJECT_NAME "CTK")
  84. set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM}-${MY_COMPILER}-QT${MY_QT_VERSION}-${CTEST_BUILD_CONFIGURATION}")
  85. #
  86. # Display build info
  87. #
  88. message("site name: ${CTEST_SITE}")
  89. message("build name: ${CTEST_BUILD_NAME}")
  90. message("script mode: ${SCRIPT_MODE}")
  91. message("coverage: ${WITH_COVERAGE}, memcheck: ${WITH_MEMCHECK}")
  92. #
  93. # Convenient macro allowing to download a file
  94. #
  95. macro(downloadFile url dest)
  96. file(DOWNLOAD ${url} ${dest} STATUS status)
  97. list(GET status 0 error_code)
  98. list(GET status 1 error_msg)
  99. if(error_code)
  100. message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}")
  101. endif()
  102. endmacro()
  103. #
  104. # Download and include dashboard driver script
  105. #
  106. set(url http://commontk.org/ctkDashboardDriverScript.cmake)
  107. set(dest ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}.driver)
  108. downloadfile(${url} ${dest})
  109. include(${dest})
  110. set(travis_url "/tmp/travis.url")
  111. file(WRITE ${travis_url} "https://travis-ci.org/commontk/CTK/builds/$ENV{TRAVIS_BUILD_ID}")
  112. ctest_upload(FILES ${travis_url})
  113. file(REMOVE ${travis_url})