Setting up basic outomated Nightly cDash client
###############################################

This manual shows how to set up a simple basic cDash client which runs every 
night the tests. This is based on sources and structure of MeteoIO 
(http://slfsmm.indefero.net/p/meteoio/) and a Linux host.


1. Needs
--------
1. 	First need a host, best if it runs 24/24 with internet connection. (no 
	matter if virtual machine, or own hardware)
	
2.	Make sure following things are installed
	- cmake (version 2.8.0 or greater) and cmake-curses-gui
	- subversion
	- c++ compiler
	
3.	You need also that on your cDash server you want to use your project where 
	you show the test results is allready set up and given correct svn 
	connection information. (In this example, the free cDash host server from
	Kitware, http://my.cdash.org/ )
	
2. Get files
------------
1. Make direcotry and checkout svn files:
	- mkdir -p ${HOME}/cdash_clients/meteoio
	- cd ${HOME}/cdash_clients/
	- svn co http://slfsmm.indefero.net/svn/slfsmm/meteoio/YOUR_BRANCH_OR_TRUNK meteoio
	
2. Get cDash connection configuration
	- Login in the cDash site -> myCDash
	- [Action] Edit Project which should show the results
	- Miscellanceous -> rigth click on CTestConfig.cmake -> Save Link As
	- Save CTestConfig.cmake directly in the root direcory of your 
	source files (here cdash_clients/meteoio/) or move it 
	there avter download
	
3. 	First Test if connection works:
	- cd ${HOME}/cdash_clients/meteoio/
	- ccmake . [configure and generate with all default, but activate the tests !! (Key BUILD_TESTING=ON)]
	- make
	- ctest -D Experimental
	
3. Make CTest Script which is run daily
---------------------------------------
1.	Make a new file "startScriptNighty.cmake" in the root of the source files 
	(here ${HOME}/cdash_clients/meteoio/)
	
2. But following content in te startScriptNighty.cmake file:

	# simple Script that makes Nighty build with cTest and publie it on CDash. 
	# This script need to be started be cron. The command for the cron is :
	# "ctest -S startScripNighty.cmake"
	
	# set for the thest source and binary directories
	SET(CTEST_SOURCE_DIRECTORY .)
	SET(CTEST_BINARY_DIRECTORY .)
	
	# set cTest commands to be used
	SET(CTEST_COMMAND "\"${CTEST_EXECUTABLE_NAME}\" -D Nightly")
	
	#set cMake command to be used
	SET(CTEST_CMAKE_COMMAND "\"${CMAKE_EXECUTABLE_NAME}\"")
	
	#also possible to set initial cache values for config to set that the test are build
	# BUILD NAME SET HERE DROUG CACHE.. OLD WAY TO OD BUT ONLY WORKING WAY
	SET(CTEST_INITIAL_CACHE "
		BUILD_TESTING:BOOL=ON
		BUILD_TESTING_WITH_COVERAGE:BOOL=OFF
		BUILDNAME:STRING=Linux_Standart
	")

3.	Test script with command "ctest -S startScriptNighty.cmake -V"
	
4. set up Cron jop to run test every night at 01:05
---------------------------------------------------
1.	crontab -e
2.	chose your editor ( me 8. vim.basic)
3.	Add follwoing two line :
	1 1 * * * cd ${HOME}/cdash_clients/meteoio/ && make distclean
	5 1 * * * cd ${HOME}/cdash_clients/meteoio/ && /usr/bin/ctest -S ${HOME}/cdash_clients/meteoio/startScriptNighty.cmake -V >${HOME}/cdash_clients/meteoio/startScriptNighty.log 2>&1
4.	write and quit ( vim command ":wq")
	
If error on test, you have the log in file startScriptNighty.log


5. Annexes: For more information about CTest scripting
------------------------------------------------------
http://www.cmake.org/Wiki/CMake_Scripting_Of_CTest
