CircleCI_CTK_Docker.cmake 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ##############################################################################
  2. #
  3. # Library: CTK
  4. #
  5. # Copyright 2010 Kitware Inc. 28 Corporate Drive,
  6. # Clifton Park, NY, 12065, USA.
  7. #
  8. # All rights reserved.
  9. #
  10. # Licensed under the Apache License, Version 2.0 (the "License");
  11. # you may not use this file except in compliance with the License.
  12. # You may obtain a copy of the License at
  13. #
  14. # http://www.apache.org/licenses/LICENSE-2.0
  15. #
  16. # Unless required by applicable law or agreed to in writing, software
  17. # distributed under the License is distributed on an "AS IS" BASIS,
  18. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. # See the License for the specific language governing permissions and
  20. # limitations under the License.
  21. #
  22. ##############################################################################
  23. set( CTK_SOURCE_DIR "/usr/src/CTK" )
  24. set( CTK_BINARY_DIR "/usr/src/CTK-build" )
  25. set( CTEST_SOURCE_DIRECTORY "${CTK_SOURCE_DIR}" )
  26. set( CTEST_BINARY_DIRECTORY "${CTK_BINARY_DIR}/CTK-build" )
  27. #############
  28. set( SITE_CTEST_MODE "Experimental" ) # Experimental, Continuous, or Nightly
  29. set( CTEST_CMAKE_GENERATOR "Unix Makefiles" ) # Ninja or Unix Makefiles
  30. set( CTK_GIT_REPOSITORY "https://github.com/commontk/CTK.git" )
  31. # Follow format for caps and components as given on CTK dashboard
  32. set( CTEST_SITE "CircleCI_CTK" )
  33. # Follow format for caps and components as given on CTK dashboard
  34. set( SITE_PLATFORM "Ubuntu-64" )
  35. # Use SITE_BUILD_TYPE specified by circle.yml
  36. set( SITE_BUILD_TYPE "$ENV{SITE_BUILD_TYPE}" )
  37. if( NOT( (SITE_BUILD_TYPE MATCHES "Debug") OR (SITE_BUILD_TYPE MATCHES "Release") ) )
  38. set( SITE_BUILD_TYPE "Debug" ) # Release, Debug
  39. endif( NOT( (SITE_BUILD_TYPE MATCHES "Debug") OR (SITE_BUILD_TYPE MATCHES "Release") ) )
  40. # Named SITE_BUILD_NAME
  41. string( SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit )
  42. set( what $ENV{CIRCLE_BRANCH} )
  43. set( SITE_BUILD_NAME_SUFFIX _${commit}_${what} )
  44. set( SITE_BUILD_NAME "CircleCI-${SITE_PLATFORM}-${SITE_BUILD_TYPE}${SITE_BUILD_NAME_SUFFIX}" )
  45. set( CTEST_BUILD_NAME "${SITE_BUILD_NAME}-BuildTest-${SITE_CTEST_MODE}" )
  46. ###################
  47. set( CTEST_CONFIGURATION_TYPE "${SITE_BUILD_TYPE}")
  48. set( CMAKE_BUILD_TYPE "${SITE_BUILD_TYPE}")
  49. set( BUILD_TESTING ON )
  50. set( CTK_BUILD_EXAMPLES OFF )
  51. ###################
  52. ctest_start( "${SITE_CTEST_MODE}" )
  53. ctest_configure( BUILD "${CTK_BINARY_DIR}"
  54. SOURCE "${CTK_SOURCE_DIR}" )
  55. ctest_build( BUILD ${CTK_BINARY_DIR} )
  56. ctest_test( BUILD ${CTEST_BINARY_DIRECTORY} )
  57. ctest_submit()