1 ##############################################################################
5 # Copyright 2010 Kitware Inc. 28 Corporate Drive,
6 # Clifton Park, NY, 12065, USA.
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
14 # http://www.apache.org/licenses/LICENSE-2.0
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.
22 ##############################################################################
24 if( NOT "${CTK_QT_VERSION}" MATCHES "4|5" )
25 message( FATAL_ERROR "CTK_QT_VERSION should be set to either 4 or 5" )
28 set( CTK_SOURCE_DIR "/usr/src/CTK" )
29 set( CTK_BINARY_DIR "/usr/src/CTK-build" )
31 set( CTEST_SOURCE_DIRECTORY "${CTK_SOURCE_DIR}" )
32 set( CTEST_BINARY_DIRECTORY "${CTK_BINARY_DIR}/CTK-build" )
36 set( SITE_CTEST_MODE "Experimental" ) # Experimental, Continuous, or Nightly
38 set( CTEST_CMAKE_GENERATOR "Unix Makefiles" ) # Ninja or Unix Makefiles
40 set( CTK_GIT_REPOSITORY "https://github.com/commontk/CTK.git" )
42 # Follow format for caps and components as given on CTK dashboard
43 set( CTEST_SITE "CircleCI_CTK" )
45 # Follow format for caps and components as given on CTK dashboard
46 set( SITE_PLATFORM "Ubuntu-64" )
48 # Use SITE_BUILD_TYPE specified by circle.yml
49 set( SITE_BUILD_TYPE "$ENV{SITE_BUILD_TYPE}" )
50 if( NOT( (SITE_BUILD_TYPE MATCHES "Debug") OR (SITE_BUILD_TYPE MATCHES "Release") ) )
51 set( SITE_BUILD_TYPE "Debug" ) # Release, Debug
54 # Named SITE_BUILD_NAME
55 string( SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit )
56 set( what $ENV{CIRCLE_BRANCH} )
57 set( SITE_BUILD_NAME_SUFFIX _${commit}_${what} )
59 set( SITE_BUILD_NAME "CircleCI-${SITE_PLATFORM}-${SITE_BUILD_TYPE}${SITE_BUILD_NAME_SUFFIX}" )
61 set( CTEST_BUILD_NAME "${SITE_BUILD_NAME}-BuildTest-Qt${CTK_QT_VERSION}-${SITE_CTEST_MODE}" )
65 set( CTEST_CONFIGURATION_TYPE "${SITE_BUILD_TYPE}")
66 set( CMAKE_BUILD_TYPE "${SITE_BUILD_TYPE}")
67 set( BUILD_TESTING ON )
68 set( CTK_BUILD_EXAMPLES OFF )
70 # Disable MIT_SHM X11 extension
71 set( ENV{QT_X11_NO_MITSHM} 1 )
75 set(ctk_configure_options
76 -DCTK_QT_VERSION:STRING=${CTK_QT_VERSION}
77 -DCTK_ENABLE_Widgets:BOOL=ON
80 ctest_start( "${SITE_CTEST_MODE}" )
83 BUILD "${CTK_BINARY_DIR}"
84 SOURCE "${CTK_SOURCE_DIR}"
85 OPTIONS "${ctk_configure_options}"
88 ctest_build( BUILD ${CTK_BINARY_DIR} )
91 BUILD ${CTEST_BINARY_DIRECTORY}
92 EXCLUDE "ctkWidgetsUtilsTestGrabWidget" # See https://github.com/commontk/CTK/issues/764
99 message(FATAL_ERROR "ERROR: Tests failed")