ctkTravisDashboardScript.cmake 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. set(MY_QT_VERSION ${QT${CTK_QT_VERSION}_VERSION})
  26. #
  27. # Dashboard options
  28. #
  29. set(WITH_KWSTYLE FALSE)
  30. set(WITH_MEMCHECK FALSE)
  31. set(WITH_COVERAGE TRUE)
  32. set(WITH_DOCUMENTATION FALSE)
  33. #set(DOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY ) # for example: $ENV{HOME}/Projects/Doxygen
  34. set(CTEST_BUILD_CONFIGURATION "Release")
  35. set(CTEST_TEST_TIMEOUT 500)
  36. set(CTEST_BUILD_FLAGS "-j4") # Use multiple CPU cores to build
  37. set(CTEST_PARALLEL_LEVEL 4) # Number of tests running in parallel
  38. # experimental:
  39. # - run_ctest() macro will be called *ONE* time
  40. # - binary directory will *NOT* be cleaned
  41. # continuous:
  42. # - run_ctest() macro will be called EVERY 5 minutes ...
  43. # - binary directory will *NOT* be cleaned
  44. # - configure/build will be executed *ONLY* if the repository has been updated
  45. # nightly:
  46. # - run_ctest() macro will be called *ONE* time
  47. # - binary directory *WILL BE* cleaned
  48. set(SCRIPT_MODE "experimental") # "experimental", "continuous", "nightly"
  49. #
  50. # Project specific properties
  51. #
  52. set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CTK")
  53. set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CTK-Superbuild-${CTEST_BUILD_CONFIGURATION}-${SCRIPT_MODE}")
  54. # Additional CMakeCache options - For example:
  55. # CTK_LIB_Widgets:BOOL=ON
  56. # CTK_APP_ctkDICOM:BOOL=ON
  57. set(ADDITIONNAL_CMAKECACHE_OPTION "
  58. CTK_QT_VERSION:STRING=${CTK_QT_VERSION}
  59. CTK_BUILD_ALL:BOOL=ON
  60. CTK_BUILD_EXAMPLES:BOOL=ON
  61. CTK_USE_SYSTEM_VTK:BOOL=ON
  62. ")
  63. # List of test that should be explicitly disabled on this machine
  64. set(TEST_TO_EXCLUDE_REGEX "")
  65. # set any extra environment variables here
  66. #set(ENV{DISPLAY} ":9")
  67. find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
  68. find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
  69. find_program(CTEST_GIT_COMMAND NAMES git)
  70. #
  71. # Git repository - Overwrite the default value provided by the driver script
  72. #
  73. # set(GIT_REPOSITORY http://github.com/YOURUSERNAME/CTK.git)
  74. ##########################################
  75. # WARNING: DO NOT EDIT BEYOND THIS POINT #
  76. ##########################################
  77. set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
  78. #
  79. # Project specific properties
  80. #
  81. set(CTEST_PROJECT_NAME "CTK")
  82. set(CTEST_BUILD_NAME "${MY_OPERATING_SYSTEM}-${MY_COMPILER}-QT${MY_QT_VERSION}-${CTEST_BUILD_CONFIGURATION}")
  83. #
  84. # Display build info
  85. #
  86. message("site name: ${CTEST_SITE}")
  87. message("build name: ${CTEST_BUILD_NAME}")
  88. message("script mode: ${SCRIPT_MODE}")
  89. message("coverage: ${WITH_COVERAGE}, memcheck: ${WITH_MEMCHECK}")
  90. #
  91. # Convenient macro allowing to download a file
  92. #
  93. macro(downloadFile url dest)
  94. file(DOWNLOAD ${url} ${dest} STATUS status)
  95. list(GET status 0 error_code)
  96. list(GET status 1 error_msg)
  97. if(error_code)
  98. message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}")
  99. endif()
  100. endmacro()
  101. #
  102. # Download and include dashboard driver script
  103. #
  104. set(url http://commontk.org/ctkDashboardDriverScript.cmake)
  105. set(dest ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}.driver)
  106. downloadfile(${url} ${dest})
  107. include(${dest})
  108. set(travis_url "/tmp/travis.url")
  109. file(WRITE ${travis_url} "https://travis-ci.org/commontk/CTK/builds/$ENV{TRAVIS_BUILD_ID}")
  110. ctest_upload(FILES ${travis_url})
  111. file(REMOVE ${travis_url})