Commit a4c9fe53 authored by promayon's avatar promayon

NEW SDK CEP start (be patient, it will take longer than expected, complete...

NEW SDK CEP start (be patient, it will take longer than expected, complete macro reorganization under work)


git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@723 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 119eee45
#--------------------------------------------
# CEP description file
#
# Please update/edit this file
#--------------------------------------------
# A non-white space unique name for the CEP
set(CEP_NAME "CAMITKSDK")
# Description of this CEP in few lines
set(CEP_DESCRIPTION "CamiTK SDK (Software Development Kit) is the base of all CEP.
This CEP is the base of CamiTK and is required to do any development in CamiTK. It provides the CamiTK core library, some essential component and action extensions to support the basic mesh and medical image formats, as well camitk-imp, camitk-wizard and camitk-asm (the action state machine application). The SDK is based on VTK and Qt, and that's all. Additionally to CamiTK core, it provides three useful libraries: coreschema (the CamiTK Core XML data-binding library), qtpropertybrowser (to build GUI for Qt's meta-property) and qcustomplot (simple but powerful plot widget for Qt).")
# Default application to run (change this if this cep provide an application extensions you want to run by default on MSVC)
set(CEP_DEFAULT_APPLICATION "camitk-imp")
#--------------------------------------------
# CamiTK Extension Project
#
# You should probably NOT modify this file...
# Please edit CEPDescription.cmake instead
#--------------------------------------------
cmake_minimum_required(VERSION 2.6)
include(CEPDescription.cmake)
include(SDKVersion.cmake)
# Please add your project name inside the project() brackets, e.g. project(myProject)
project(${CEP_NAME})
# update module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/macros)
# set CamiTK environment
find_package(CamiTK REQUIRED)
# include CamiTK auto-documentation generation
include(CamiTKApiDoc)
# initialize subproject management
camitk_sub_project_init()
# add all subprojects
camitk_add_subdirectory(libraries)
camitk_add_subdirectory(components)
camitk_add_subdirectory(actions)
camitk_add_subdirectory(viewers)
camitk_add_subdirectory(applications)
# CEP packaging (only works if this is a stand-alone CEP
camitk_sub_project_validate(${CMAKE_BINARY_DIR})
camitk_sdk_packaging(DESCRIPTION ${CEP_DESCRIPTION})
# For Microsoft Visual C++, sets the default application for the "ALL_BUILD" project
# (i.e. launches imp when we you click on "Debug" or "Start Without Debugging" button on Visual)
# In addition, but not the least, sets the environment to the debug dll directory for VTK (and ITK)
# to solve the dll incompatibility between debug and relase version of QVTK.dll and ITKCommon.dll
if ( MSVC )
create_default_target_launcher_special(
${CEP_DEFAULT_APPLICATION}
EXTERNAL_COMMAND "${CAMITK_BIN_DIR}$(OutDir)/${CEP_DEFAULT_APPLICATION}.exe"
RUNTIME_LIBRARY_DIRS "${CAMITK_BIN_DIR}$(OutDir)" "%VTK_DIR%/bin/$(OutDir)" "%ITK_DIR%/bin/$(OutDir)"
)
endif()
$CAMITK_LICENCE_BEGIN$
CamiTK - Computer Assisted Medical Intervention ToolKit
(c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
Visit http://camitk.imag.fr for more information
This file is part of CamiTK.
CamiTK is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
CamiTK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
You should have received a copy of the GNU Lesser General Public License
version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
$CAMITK_LICENCE_END$
\ No newline at end of file
TODO write this README file
# Save the compiler settings so another project can import them.
include(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake)
cmake_export_build_settings(${CMAKE_CURRENT_BINARY_DIR}/../CamiTKBuildSettings.cmake)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../CamiTKBuildSettings.cmake"
DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}/cmake
COMPONENT cmake-modules)
# install the cmake files
file(GLOB CAMITK_CMAKE_FILES "modules/*.cmake")
set(SHARE_CMAKE_PATH)
if ( MSVC )
# Do NOT add ${CAMITK_SHORT_VERSION_STRING} to the share/cmake path for Win32 MSVC !
set (SHARE_CMAKE_PATH share/cmake)
else ()
set (SHARE_CMAKE_PATH share/${CAMITK_SHORT_VERSION_STRING}/cmake)
endif ()
install(FILES ${CAMITK_CMAKE_FILES}
DESTINATION ${SHARE_CMAKE_PATH}
COMPONENT cmake-modules)
file(GLOB CAMITK_CMAKE_FILES "modules/launcher-templates/*.in")
install(FILES ${CAMITK_CMAKE_FILES}
DESTINATION ${SHARE_CMAKE_PATH}/launcher-templates
COMPONENT cmake-modules)
# To run this script independently use
# cd . && ctest -S CamiTKTestBuild.cmake -O /tmp/ctest.log -VV
# Directory that will be used as top directory for src, build, and install dir (/opt/build, /tmp...)
set(CAMITK_TEST_BUILD_ROOT "/opt/camitkbuild" CACHE PATH "top directory for src, build, and install dir")
# svn repository root
set(CAMITK_SVN_TRUNK "svn+ssh://svn-timc.imag.fr/svn/gmcao/camitk/trunk" CACHE STRING "")
# root of mingw crosscompile environment installation
set(MINGW32_CROSS_ENV "/opt/mingw" CACHE PATH "")
# the macro is defined somewhere else
include(./CamiTKTestBuildMacros.cmake)
#-- build option for a as nearly as possible full camitk compilation
set(CAMITK_FLAGS_BASE "-DAPPLICATION_BASIC:BOOL=ON
-DAPPLICATION_SIMPLE:BOOL=ON
-DAPPLICATION_FANCY:BOOL=ON
-DAPPLICATION_OBJECTCONTROLLER:BOOL=ON
-DCOMPONENT_PHYSICALMODEL:BOOL=ON
-DMODULES_ANIMATION_MOTOR_INCOMPRESSIBILITY:BOOL=ON
-DCOMPONENT_PHYSICALMODEL_SOFA_SUPPORT:BOOL=OFF "
)
# TODO solve problem with camera (compilation under mingw32) and then add this to CAMITK_FLAGS_BASE:
# -DCOMPONENT_CAMERA:BOOL=ON \
# TODO solve problem with SOFA or remove SOFA support in PML
# depends on xerces
set(CAMITK_FLAGS_XERCES_DEP "-DCOMPONENT_MML:BOOL=ON ")
set(CAMITK_FLAGS_XSDCXX_DEP "-DMML_GENERATE_XSD_LIB:BOOL=ON ")
# depends on itk
set(CAMITK_FLAGS_ITK_DEP "-DCOMPONENT_DICOM:BOOL=ON
-DCOMPONENT_ITKIMAGE:BOOL=ON
-DMODULES_ITK_IMAGE_FILTERS:BOOL=ON "
)
# depends on opencv (libcv-dev libhighgui-dev libcvaux-dev)
set(CAMITK_FLAGS_OPENCV_DEP "-DCOMPONENT_DISTRIBUTEDENDOSCOPY:BOOL=ON ")
# TODO add cameracalibration module OpenCV Addon
set(CAMITK_NATIVE_FLAGS "${CAMITK_FLAGS_BASE} ${CAMITK_FLAGS_ITK_DEP} ${CAMITK_FLAGS_XERCES_DEP} ${CAMITK_FLAGS_XSDCXX_DEP} ${CAMITK_FLAGS_OPENCV_DEP}")
# TODO win32 compile ITK and add CAMITK_FLAGS_ITK_DEP to the crosscompilation
# TODO win32 install code synthesis xsd and add this to CAMITK_CROSSCOMPILE_FLAGS
# $CAMITK_FLAGS_XERCES_DEP \
# -DMML_GENERATE_XSD_LIB:BOOL=OFF
set(CAMITK_WIN32_FLAGS "-DVTK_DIR=${CAMITK_TEST_BUILD_ROOT}/install-win32/lib/vtk-5.6 ${CAMITK_FLAGS_BASE} ")
#-- test the native build
##camitk_test_build(camitk-svn native camitk/src "${CAMITK_NATIVE_FLAGS}" )
##camitk_test_build(myextension-svn native myextension "") # no specific flags needed
#-- test the win32 build
camitk_test_build(camitk-svn win32 camitk/src "${CAMITK_WIN32_FLAGS}" )
camitk_test_build(myextension-svn win32 myextension "") # no specific flags needed
# Test build for native linux and win32
# MACRO camitk_test_build
#
# usage:
# camitk_test_build(Name BuildRoot Plateform SvnSubDir)
#
# Name Name of the project (camitk, myextension...)
# Plateform Either "native" to compile for linux on linux or "win32" to compile using crosscompiling environment
# SvnSubDir source subdirectory to use (starting from CAMITK_SVN_TRUNK
# BuildOptions All the build options (independantly from the crosscompilation option and generator)
macro(camitk_test_build Name Plateform SvnSubDir BuildOptions)
set(CTEST_PROJECT_NAME ${Name})
set(CAMITK_TEST_PLATEFORM ${Plateform})
set(CAMITK_SVN_SUBDIR ${SvnSubDir})
set(CAMITK_BUILD_OPTIONS ${BuildOptions})
set(CTEST_SOURCE_DIRECTORY ${CAMITK_TEST_BUILD_ROOT}/src/${CTEST_PROJECT_NAME})
set(CTEST_BINARY_DIRECTORY ${CAMITK_TEST_BUILD_ROOT}/build-${CAMITK_TEST_PLATEFORM}/${CTEST_PROJECT_NAME})
# which ctest command to use for running the dashboard
set(CTEST_COMMAND "${CTEST_EXECUTABLE_NAME} -D Nightly")
# what cmake command to use for configuring this dashboard
set(CTEST_CMAKE_COMMAND "${CMAKE_EXECUTABLE_NAME}")
# should ctest wipe the binary tree before running
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )
# Output anything outputted by the test program if the test should fail
set(CTEST_OUTPUT_ON_FAILURE ON)
find_program(CTEST_SVN_COMMAND NAMES svn)
if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
set(CTEST_CHECKOUT_COMMAND "${CTEST_SVN_COMMAND} co ${CAMITK_SVN_TRUNK}/${CAMITK_SVN_SUBDIR} ${CTEST_SOURCE_DIRECTORY}")
endif()
set(CTEST_UPDATE_COMMAND "${CTEST_SVN_COMMAND}")
if (CAMITK_TEST_PLATEFORM STREQUAL "native")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CAMITK_CROSSCOMPILATION_FLAGS "")
else()
if (CAMITK_TEST_PLATEFORM STREQUAL "win32")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
# specific cross compilation flags
set(CAMITK_CROSSCOMPILATION_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${MINGW32_CROSS_ENV}/usr/i686-pc-mingw32/share/cmake/mingw-cross-env-conf.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=${MINGW32_CROSS_ENV}/usr/bin/i686-pc-mingw32-qmake
-DXML2_CONFIG=${MINGW32_CROSS_ENV}/usr/i686-pc-mingw32/bin/xml2-config ")
endif()
endif()
#set(CTEST_BUILD_CONFIGURATION "Profiling")
# NOTE beware of CAMITK_INSTALL_ROOT, do not leave it on its own line (but joined it with ${CAMITK_FLAGS_BASE})
set(CTEST_BUILD_OPTIONS "-DCMAKE_BUILD_TYPE=Release -DCAMITK_INSTALL_ROOT=${CAMITK_TEST_BUILD_ROOT}/install-${CAMITK_TEST_PLATEFORM} ${CAMITK_CROSSCOMPILATION_FLAGS} ${CAMITK_BUILD_OPTIONS}")
set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} \"-G${CTEST_CMAKE_GENERATOR}\" ${CTEST_BUILD_OPTIONS} ${CTEST_SOURCE_DIRECTORY}")
#-DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}")
# set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DWITH_TESTING:BOOL=ON ${CTEST_BUILD_OPTIONS}")
# set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-G${CTEST_CMAKE_GENERATOR}\"")
# set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"")
ctest_start("Experimental") # or ctest_start("Nightly")
ctest_update()
ctest_configure()
ctest_configure() # 2nd time to make sure all parameters discovered during the previous configure are set properly)
ctest_configure() # 3rd time to make sure all parameters discovered during the previous configure are set properly)
ctest_configure() # 4th time to make sure all parameters discovered during the previous configure are set properly)
ctest_configure() # 5th time to make sure all parameters discovered during the previous configure are set properly)
ctest_build()
ctest_build(TARGET install)
#TODO add a ctest_test()
#TODO add a ctest_submit()
endmacro()
Cross compiling CamiTK for win32 on linux
Cross compiling CamiTK is based on mingw-cross-env:
http://mingw-cross-env.nongnu.org/
These is a step by step that should work out of the box:
- STEP #1
setup the mingw environment: follow step 1 and 2 of the mingw-cross-env tutorial
to have a system-wide mingw installation:
http://www.nongnu.org/mingw-cross-env/#tutorial
Note for ubuntu, this should do the trick for the requirements:
sshall sudo apt-get -y install autoconf automake bash bison bzip2 \
cmake flex g++ intltool make sed \
libtool libltdl-dev openssl libssl-dev \
libxml-parser-perl patch perl \
pkg-config scons unzip wget \
xz-utils yasm
Also, because there is a bug in the kwsys utilities (VTK 5.6.1), it does not use VTKCompileTools,
therefore you need to install wine as well:
sshall sudo apt-get -y install wine
- STEP #2
Build the suitable mingw32 environment.
The main difference concerns Qt, that cannot be built in static mode because
we need the plugin facilities.
- rm -f /opt/mingw/src/qt.mk # you need to be quite radical here
- cp qt.mk /opt/mingw/src # to compile qt as shared libs
- cd /opt/mingw
- make libxml2 xerces qt
- STEP #3
update crosscompile.sh with your own variable (if you changed anything from
the default in STEP#1 )
comment the first line of /opt/mingw/usr/i686-pc-mingw32/share/cmake/mingw-cross-env-conf.cmake
(to allow building VTK shared lib)
- STEP #4
Crosscompile!
Setup the crosscompilation directory and run crosscompile.sh to crosscompile
all dependencies (mainly VTK) and CamiTK.
- mkdir /opt/crosscompile
- ln -s crosscompile.sh /opt/crosscompile
- ln -s VTK-TryRunResults.cmake /opt/crosscompile
- cd /opt/crosscompile
- ./crosscompile.sh
WARNING this can takes a long long times (up to a day!)
-------
TODO install mingw-cross-env in contrib
TODO try using fresh install of ubuntu (32bits, 64bits), debian, fedora and suse through virtual machine,
for a detailed step-by-step, see http://www.scribd.com/doc/35945131/Using-QEMU-to-Build-and-Deploy-Virtual-Machines-VMs-from-Scratch-on-Ubuntu-10-04-LTS-v1-2
TODO open a ppa account and put everything there!
TODO add automatic building of ITK dependencies (native and cross-compile)
TODO write a cmake sript for windows to facilitate VTK, libxml2 and ITK compilation
# This file was generated by CMake because it detected TRY_RUN() commands
# in crosscompiling mode. It will be overwritten by the next CMake run.
# Copy it to a safe location, set the variables to appropriate values
# and use it then to preset the CMake cache (using -C).
# VTK_TYPE_CHAR_IS_SIGNED
# indicates whether the executable would have been able to run on its
# target platform. If so, set VTK_TYPE_CHAR_IS_SIGNED to
# the exit code (in many cases 0 for success), otherwise enter "FAILED_TO_RUN".
# The VTK_TYPE_CHAR_IS_SIGNED_COMPILED variable holds the build result for this TRY_RUN().
#
# Source file : /home/promayon/Projets/camitk/src/crosscompile/VTK/CMake/vtkTestCharSignedness.cxx
# Executable : /home/promayon/Projets/camitk/src/crosscompile/buildwin32/VTK/CMakeFiles/cmTryCompileExec-VTK_TYPE_CHAR_IS_SIGNED.exe
# Run arguments :
# Called from: [2] /home/promayon/Projets/camitk/src/crosscompile/VTK/CMake/vtkTestTypes.cmake
# [1] /home/promayon/Projets/camitk/src/crosscompile/VTK/CMakeLists.txt
SET( VTK_TYPE_CHAR_IS_SIGNED
"0"
CACHE STRING "Result from TRY_RUN" FORCE)
# VTK_ANSI_STREAM_EOF_RESULT
# indicates whether the executable would have been able to run on its
# target platform. If so, set VTK_ANSI_STREAM_EOF_RESULT to
# the exit code (in many cases 0 for success), otherwise enter "FAILED_TO_RUN".
# The VTK_ANSI_STREAM_EOF_COMPILED variable holds the build result for this TRY_RUN().
#
# Source file : /home/promayon/Projets/camitk/src/crosscompile/buildwin32/VTK/VTK/CMake/vtkTestStreamEOF.cxx
# Executable : /home/promayon/Projets/camitk/src/crosscompile/buildwin32/VTK/CMakeFiles/cmTryCompileExec-VTK_ANSI_STREAM_EOF_RESULT.exe
# Run arguments :
# Called from: [2] /home/promayon/Projets/camitk/src/crosscompile/VTK/CMake/vtkTestStreamsLibrary.cmake
# [1] /home/promayon/Projets/camitk/src/crosscompile/VTK/CMakeLists.txt
SET( VTK_ANSI_STREAM_EOF_RESULT
"0"
CACHE STRING "Result from TRY_RUN" FORCE)
# KWSYS_CHAR_IS_SIGNED
# indicates whether the executable would have been able to run on its
# target platform. If so, set KWSYS_CHAR_IS_SIGNED to
# the exit code (in many cases 0 for success), otherwise enter "FAILED_TO_RUN".
# KWSYS_CHAR_IS_SIGNED__TRYRUN_OUTPUT
# contains the text the executable would have printed on stdout and stderr.
# If the executable would not have been able to run, set KWSYS_CHAR_IS_SIGNED__TRYRUN_OUTPUT empty.
# Otherwise check if the output is evaluated by the calling CMake code. If so,
# check what the source file would have printed when called with the given arguments.
# The KWSYS_CHAR_IS_SIGNED_COMPILED variable holds the build result for this TRY_RUN().
#
# Source file : /home/promayon/Projets/camitk/src/crosscompile/VTK/Utilities/kwsys/kwsysPlatformTestsCXX.cxx
# Executable : /home/promayon/Projets/camitk/src/crosscompile/buildwin32/VTK/CMakeFiles/cmTryCompileExec-KWSYS_CHAR_IS_SIGNED.exe
# Run arguments :
# Called from: [1] /home/promayon/Projets/camitk/src/crosscompile/VTK/Utilities/kwsys/CMakeLists.txt
SET( KWSYS_CHAR_IS_SIGNED
"0"
CACHE STRING "Result from TRY_RUN" FORCE)
SET( KWSYS_CHAR_IS_SIGNED__TRYRUN_OUTPUT
"0"
CACHE STRING "Output from TRY_RUN" FORCE)
# This file is part of mingw-cross-env.
# See doc/index.html for further information.
# Qt
PKG := qt
$(PKG)_IGNORE :=
$(PKG)_VERSION := 4.7.2
$(PKG)_CHECKSUM := 84414f82bbc9e8d356b986d5d1ebee89d06e4f2e
$(PKG)_SUBDIR := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION).tar.gz
$(PKG)_WEBSITE := http://qt.nokia.com/
$(PKG)_URL := http://get.qt.nokia.com/qt/source/$($(PKG)_FILE)
$(PKG)_DEPS := gcc libodbc++ postgresql freetds openssl zlib libpng jpeg libmng tiff sqlite libiconv dbus
define $(PKG)_UPDATE
wget -q -O- 'http://qt.gitorious.org/qt/qt/commits' | \
grep '<li><a href="/qt/qt/commit/' | \
$(SED) -n 's,.*<a[^>]*>v\([0-9][^<-]*\)<.*,\1,p' | \
tail -1
endef
define $(PKG)_BUILD
# We prefer static mingw-cross-env system libs for static build:
# -system-zlib -system-libpng -system-libjpeg -system-libtiff -system-libmng -system-sqlite
# There is no -system-gif option.
#
# For shared Qt with qt-zlib, add -lQtCore4 to end of OPENSSL_LIBS to satisfy zlib dependency.
# changed -static for -shared
# removed:
# -qt-sql-tds -D Q_USE_SYBASE
# -system-zlib
# -system-libpng
# -system-libjpeg
# -system-libtiff
# -system-libmng
# -system-sqlite
# -qt-sql-sqlite
# -qt-sql-odbc
# -qt-sql-psql
cd '$(1)' && \
OPENSSL_LIBS="`'$(TARGET)-pkg-config' --libs-only-l openssl` -lQtCore4" \
PSQL_LIBS="-lpq -lsecur32 `'$(TARGET)-pkg-config' --libs-only-l openssl` -lws2_32" \
SYBASE_LIBS="-lsybdb -liconv -lws2_32" \
./configure \
-opensource \
-confirm-license \
-fast \
-xplatform unsupported/win32-g++-cross \
-force-pkg-config \
-release \
-exceptions \
-shared \
-prefix '$(PREFIX)/$(TARGET)' \
-prefix-install \
-script \
-opengl desktop \
-webkit \
-no-glib \
-no-gstreamer \
-no-phonon \
-no-phonon-backend \
-no-qt3support \
-accessibility \
-no-reduce-exports \
-no-rpath \
-make libs \
-nomake demos \
-nomake docs \
-nomake examples \
-openssl-linked \
-dbus-linked \
-v
$(MAKE) -C '$(1)' -j '$(JOBS)'
rm -rf '$(PREFIX)/$(TARGET)/mkspecs'
$(MAKE) -C '$(1)' -j 1 install
$(INSTALL) -m755 '$(1)/bin/moc' '$(PREFIX)/bin/$(TARGET)-moc'
$(INSTALL) -m755 '$(1)/bin/rcc' '$(PREFIX)/bin/$(TARGET)-rcc'
$(INSTALL) -m755 '$(1)/bin/uic' '$(PREFIX)/bin/$(TARGET)-uic'
$(INSTALL) -m755 '$(1)/bin/qmake' '$(PREFIX)/bin/$(TARGET)-qmake'
# at least some of the qdbus tools are useful on target
cd '$(1)/tools/qdbus' && '$(1)/bin/qmake' qdbus.pro
$(MAKE) -C '$(1)/tools/qdbus' -j '$(JOBS)' install
# same for QtDesigner
cd '$(1)/tools/designer' && '$(1)/bin/qmake' designer.pro
$(MAKE) -C '$(1)/tools/designer' -j '$(JOBS)' install
mkdir '$(1)/test-qt'
cp '$(2)'* '$(1)/test-qt/'
cd '$(1)/test-qt' && '$(TARGET)-qmake'
$(MAKE) -C '$(1)/test-qt' -j '$(JOBS)'
$(INSTALL) -m755 '$(1)/test-qt/release/test-qt.exe' '$(PREFIX)/$(TARGET)/bin/'
endef
# CTest instructions to make a continuous build on a computer (Linux / Windows / MacOSX)
# Schedule a task running this script with ctest and launch it using the following command
# "ctest -S build-continuous-debug.cmake -V"
# What this script does ?
# * INFORMATION STEP
# Configure SITE and BUILD information to be correctly display on dashboard
# Loads information from the CTestConfig.cmake file.
# * UPDATE STEP
# use svn to udpdate source code to the latest revision BEFORE Nightly start time, which is defined in the CTestConfig.cmake file.
# * CONFIGURE STEP
# configure the whole CamiTK project and create a new build directory
# * BUILD STEP
# build each subproject of CamiTK
# For each step a report is sent to the dashboard. This allows any developer to be informed (mailing list) of any problem, even BEFORE the script ends !
# Need to be defined, for the build to run.
set(CTEST_SOURCE_DIRECTORY "C:/dev/CamiTK/trunk_debug/")
set(CTEST_BINARY_DIRECTORY "C:/dev/CamiTK/builds_continuous/debug")
# Script configuration, depending of the build, computer running the script
# Update to feat each computer which runs this script
set( CTEST_SITE "MANNONI-WIN7-32")
set( CTEST_BUILD_NAME "Win7-32-MinGW-Debug")
set( CTEST_CMAKE_GENERATOR "MinGW Makefiles" )
set( CTEST_BUILD_CONFIGURATION "Debug")
# Update source code and send reports
# set( CTEST_UPDATE_COMMAND "svn")
find_program(CTEST_SVN_COMMAND svn)
set( CTEST_UPDATE_COMMAND ${CTEST_SVN_COMMAND})
# CMake configuration (put here all the configure flags)
set( CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} -G \"${CTEST_CMAKE_GENERATOR}\"")
set( CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}")
set( CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_SKIP_RPATH=TRUE -DTOOL_CORESCHEMA=TRUE -DTOOL_LML=TRUE -DTOOL_PML=TRUE -DMML_GENERATE_GUI=TRUE -DTOOL_MML=TRUE -DMML_GENERATE_XSD_LIB=TRUE -DACTION_MML=TRUE -DACTION_ITKSEGMENTATION=TRUE -DACTION_ITKFILTERS=TRUE -DAPPLICATION_WIZARD=TRUE -DCOMPONENT_VTKMESH=TRUE -DCOMPONENT_DICOM=TRUE -DCOMPONENT_ITKIMAGE=TRUE -DCOMPONENT_PHYSICALMODEL=TRUE -DCOMPONENT_MML=TRUE ${CTEST_SOURCE_DIRECTORY}")
# -DCAMITK_INSTALL_ROOT=${CTEST_BINARY_DIRECTORY}
# to get CDash server configuration :
include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake")
# Continuous build parameters
# Update them regarding your project's compilation time
set(CONTINUOUS_BUILD_DURATION 43200) # Duration time of the main loop of the continuous build in seconds, here 12 hours.
set(CONTINUOUS_BUILD_SLEEP 600) # Step to perform each build <=> maximum time for the script to sleep between 2 builds.
# Clean binary directory at the beginning of the day
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
# Main loop
# During 10 hours from starting this script, CTest will continuously build every 10 min.
while (${CTEST_ELAPSED_TIME} LESS ${CONTINUOUS_BUILD_DURATION})
# Get start time of the build
set(START_TIME ${CTEST_ELAPSED_TIME})
# Start CTest in Continuous mode
ctest_start(Continuous)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
# Update source code and get update command result
ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY} RETURN_VALUE count)
ctest_submit(PARTS Update Notes)
if (count GREATER 0) # We have updated source code, thus configure and build modified files
# Configure the whole camitk project and send configure report on the server
ctest_configure()
ctest_submit(PARTS Configure)
# Get subprojects listing (automatically created at confituration step)
include("${CTEST_BINARY_DIRECTORY}/Subprojects.cmake")
# Update CDash configuration to the server
# Project.xml file is automatically generated. If someone added an extension to CamiTK, CDash will automatically be updated according to it.
# To do this, send this file to the server
ctest_submit(FILES "${CTEST_BINARY_DIRECTORY}/Project.xml")
# Build each subprojects
foreach(subproject ${CAMITK_SUBPROJECTS})
# tag sub project, tag are used to sort projects according to tests
set_property(GLOBAL PROPERTY SubProject ${subproject})
set_property(GLOBAL PROPERTY Label ${subproject})
# build each sub project
set(CTEST_BUILD_TARGET ${subproject})
ctest_build()
ctest_submit(PARTS Build)
# build binary for testing
set(CTEST_BUILD_TARGET ${subproject}test)
ctest_build()
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "${subproject}")
ctest_submit(PARTS Test)
endforeach(subproject)
endif ()
# Wait maximum the CONTINUOUS_BUILD_SLEEP time (in seconds) to loop again and launch next build
ctest_sleep( ${START_TIME} ${CONTINUOUS_BUILD_SLEEP} ${CTEST_ELAPSED_TIME})
endwhile()
# CTest instructions to make a continuous build on a computer (Linux / Windows / MacOSX)
# Schedule a task running this script with ctest and launch it using the following command
# "ctest -S build-continuous-release.cmake -V"
# What this script does ?
# * INFORMATION STEP
# Configure SITE and BUILD information to be correctly display on dashboard
# Loads information from the CTestConfig.cmake file.
# * UPDATE STEP
# use svn to udpdate source code to the latest revision BEFORE Nightly start time, which is defined in the CTestConfig.cmake file.
# * CONFIGURE STEP
# configure the whole CamiTK project and create a new build directory
# * BUILD STEP
# build each subproject of CamiTK
# For each step a report is sent to the dashboard. This allows any developer to be informed (mailing list) of any problem, even BEFORE the script ends !
# Need to be defined, for the build to run.
set(CTEST_SOURCE_DIRECTORY "C:/dev/CamiTK/trunk/")
set(CTEST_BINARY_DIRECTORY "C:/dev/CamiTK/builds_continuous/release")
# Script configuration, depending of the build, computer running the script
# Update to feat each computer which runs this script
set( CTEST_SITE "MANNONI-WIN7-32")
set( CTEST_BUILD_NAME "Win7-32-Release")
set( CTEST_CMAKE_GENERATOR "MinGW Makefiles" )
set( CTEST_BUILD_CONFIGURATION "Release")
# Update source code and send reports
# set( CTEST_UPDATE_COMMAND "svn")
find_program(CTEST_SVN_COMMAND svn)
set( CTEST_UPDATE_COMMAND ${CTEST_SVN_COMMAND})
# CMake configuration (put here all the configure flags)
set( CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} -G \"${CTEST_CMAKE_GENERATOR}\"")
set( CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}")
set( CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_SKIP_RPATH=TRUE -DTOOL_CORESCHEMA=TRUE -DTOOL_LML=TRUE -DTOOL_PML=TRUE -DMML_GENERATE_GUI=TRUE -DTOOL_MML=TRUE -DMML_GENERATE_XSD_LIB=TRUE -DACTION_MML=TRUE -DACTION_ITKSEGMENTATION=TRUE -DACTION_ITKFILTERS=TRUE -DAPPLICATION_WIZARD=TRUE -DCOMPONENT_VTKMESH=TRUE -DCOMPONENT_DICOM=TRUE -DCOMPONENT_ITKIMAGE=TRUE -DCOMPONENT_PHYSICALMODEL=TRUE -DCOMPONENT_MML=TRUE ${CTEST_SOURCE_DIRECTORY}")
# -DCAMITK_INSTALL_ROOT=${CTEST_BINARY_DIRECTORY}
# to get CDash server configuration :
include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake")
# Continuous build parameters