ctkAppVeyorDashboardScript.cmake 4.1 KB

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