cmake_minimum_required(VERSION 2.6) ################################################################# # LG+SV 30/01/08 # To use it : # > ctest -S creatools-linux.ctest,PROJECT [-V|-VV] # where PROJECT is the name of the project to build and test # e.g. crea, bbtk, creaImageIO, etc. # add -V or -VV tu run in verbose or extra-verbose mode ################################################################# ################################################################# if(NOT CTEST_SCRIPT_ARG) message(FATAL_ERROR "You must pass the name of the project to test !") endif(NOT CTEST_SCRIPT_ARG) set(project_name ${CTEST_SCRIPT_ARG}) ################################################################# ################################################################# ## MANDATORY ## You MUST modify the following lines, according to what you use. # The name of your machine set(CTEST_SITE "IV-SV-268") # The architecture of your system set(arch "ubuntu-8.10-gcc4.3.2") # The type of build (as specified in the CMakeCache created) set(buildtype "release") ################################################################# ################################################################# ## MAY BE CHANGED : set(CTEST_DASHBOARD_ROOT "$ENV{HOME}/dashboards") set(MODEL Experimental) set(NUMBER_OF_CPU 4) set(CMakeCacheFile "${project_name}-${buildtype}-CMakeCache.txt") ################################################################# ################################################################# ## The following lines must NOT be modified! ## NOTHING FOR USER BELOW ## NO RATS ALLOWED! ## HANDS OFF! ## ;-) #set(CTEST_SITE "$ENV{HOSTNAME}") #MESSAGE(FATAL_ERROR $ENV{HOSTNAME}) set(CTEST_BUILD_NAME "${project_name}-${CTEST_SITE}-${arch}-${buildtype}") set(source_dir ${project_name}) #set(extra_source_dir "VTKData") set(build_dir "${project_name}-${buildtype}") set(CTEST_TEST_TIMEOUT 140) # 70 seconds. 70 seconds is probably not enough when coverage is ON. set(CTEST_CMAKE_GENERATOR "Unix Makefiles") set(CTEST_BUILD_COMMAND "make -j${NUMBER_OF_CPU}") set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${source_dir}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${build_dir}") set(CTEST_COVERAGE_COMMAND "/usr/bin/gcov") # REQUIRED with new ctest script style. # --coverage: -fprofile-arcs -ftest-coverage (when compiling) # --coverage: -lgcov (when linking) ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) # Common C/C++ flags: set(advanced_flags) #set(advanced_flags"-Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -fstack-protector-all -D_FORTIFY_SOURCE=2 -Wconversion") set(cov_options "-fprofile-arcs -ftest-coverage") set(common_flags "-fdiagnostics-show-option -Wall -Wextra -Wshadow ${advanced_flags} ${cov_options}") # C specific flags: set(advanced_c_flags) #set(advanced_c_flags "-Wtraditional-conversion") # C++ specific flags: set(advanced_cxx_flags) #set(advanced_cxx_flags "-Wstrict-null-sentinel -Wsign-conversion -Wsign-promo") #MESSAGE(STATUS ${CTEST_SCRIPT_DIRECTORY}) configure_file( ${CTEST_SCRIPT_DIRECTORY}/${CMakeCacheFile} ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt COPY_ONLY) # Write initial cache. #file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " #MAKECOMMAND:STRING=make -j3 -k #CMAKE_CXX_FLAGS:STRING=${common_flags} ${advanced_cxx_flags} -Woverloaded-virtual #CMAKE_CXX_FLAGS_DEBUG:STRING=-O0 -ggdb #CMAKE_C_FLAGS:STRING=${common_flags} ${advanced_c_flags} #CMAKE_C_FLAGS_DEBUG:STRING=-O0 -ggdb #CMAKE_EXE_LINKER_FLAGS:STRING=${cov_options} #CMAKE_SHARED_LINKER_FLAGS:STRING=${cov_options} #CMAKE_BUILD_TYPE:STRING=Debug #BUILD_SHARED_LIBS:BOOL=ON #VTK_DEBUG_LEAKS:BOOL=ON #BUILD_DOCUMENTATION:BOOL=ON #BUILD_EXAMPLES:BOOL=ON #JAVA_AWT_INCLUDE_PATH:PATH=/usr/lib/jvm/java-6-sun/include #JAVA_AWT_LIBRARY:FILEPATH=/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so #JAVA_INCLUDE_PATH:PATH=/usr/lib/jvm/java-6-sun/include #JAVA_INCLUDE_PATH2:PATH=/usr/lib/jvm/java-6-sun/include/linux #VTK_USE_BOOST:BOOL=ON # GL2PS test broken #VTK_USE_GL2PS:BOOL=OFF #VTK_WRAP_JAVA:BOOL=ON #VTK_WRAP_PYTHON:BOOL=ON #VTK_WRAP_TCL:BOOL=ON #VTK_USE_GUISUPPORT:BOOL=ON #VTK_USE_QVTK:BOOL=ON #DESIRED_QT_VERSION:STRING=4 #VTK_USE_ODBC:BOOL=ON #ODBC_INCLUDE_DIRECTORIES:PATH=/usr/include #ODBC_LIBRARY:FILEPATH=/usr/lib/libodbc.so #VTK_USE_MYSQL:BOOL=ON #VTK_USE_POSTGRES:BOOL=ON #VTK_LEGACY_REMOVE:BOOL=ON #") set(CTEST_UPDATE_COMMAND "cvs") # set any extra directories to do an update on if(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${source_dir}") message("Initial checkout of ${project_name}") execute_process( COMMAND "${CTEST_UPDATE_COMMAND}" -q -z3 co ${project_name} WORKING_DIRECTORY "${CTEST_DASHBOARD_ROOT}" ) else(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${source_dir}") execute_process( COMMAND "${CTEST_UPDATE_COMMAND}" -q -z3 up "-PdA" WORKING_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${source_dir}" ) endif(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${source_dir}") ctest_start(${MODEL}) ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}") ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}") ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}") ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}") # save LD_LIBRARY_PATH #set(saved_ld_library_path "$ENV{LD_LIBRARY_PATH}") # Change it so that JavaRegression test can pass. #set(ENV{LD_LIBRARY_PATH} "/usr/lib/jvm/java-6-sun/jre/lib/i386/xawt:${saved_ld_libray_path}") #ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}") #ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}") # restore LD_LIBRARY_PATH #set(ENV{LD_LIBRARY_PATH} "${saved_ld_library_path}") #ctest_memcheck(BUILD "${CTEST_BINARY_DIRECTORY}") ctest_submit()