[CMake] making Nightly builds easier to setup

clinton at elemtech.com clinton at elemtech.com
Mon Nov 10 11:51:42 EST 2008


If you don't want to overwrite the CMakeCache.txt file, you can do the 
following instead of a FILE(WRITE...).  This also works if you don't have an 
initial CMakeCache.txt file.

SET(FORCED_CACHE_VALUES
  \"-DCMAKE_OSX_ARCHITECTURES:STRING=i386;ppc\"
  \"-DCMAKE_BUILD_TYPE:STRING=Release\"
 )
STRING(REGEX REPLACE "\";" "\" " FORCED_CACHE_VALUES "${FORCED_CACHE_VALUES}")
SET(CTEST_CONFIGURE_COMMAND "\"${CTEST_CMAKE_COMMAND}\" ${FORCED_CACHE_VALUES} 
\"${CTEST_SOURCE_DIRECTORY}\"")
CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE config_result)

Clint

On Monday 10 November 2008 9:44:43 am David Cole wrote:
> The variable CTEST_INITIAL_CACHE is ignored in new-style (CTEST_BUILD()
> command based) ctest scripts.
> Instead, you should use:
>
> FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
> MAKECOMMAND:STRING=nmake -i
> CMAKE_MAKE_PROGRAM:FILEPATH=nmake
> CMAKE_GENERATOR:INTERNAL=NMake Makefiles
> BUILDNAME:STRING=Win32-nmake71
> SITE:STRING=VOGON.kitware
> CVSCOMMAND:FILEPATH=C:/cygwin/bin/cvs.exe
> ")
>
> (But only on a clean build, after calling
> CTEST_EMPTY_BINARY_DIRECTORY("${CTEST_BINARY_DIRECTORY}"), or perhaps only
> if the CMakeCache.txt does not exist in the first place...)
>
> HTH,
> David
>
> On Mon, Nov 10, 2008 at 5:33 AM, Martin Apel <martin.apel at simpack.de> wrote:
> > Eric Noulard wrote:
> > > 2008/11/9 Alexander Neundorf <a.neundorf-work at gmx.net>:
> > > [...]
> > >
> > >> commands can be executed.
> > >>
> > >> IMO this can make setting up Nightly builds much easier.
> > >
> > > Looks interesting, I didn't ever thought ctest scripting was done for
> >
> > that.
> >
> > > I did shell scripts for that and was wondering how to do it on Windows
> > >
> > :-)
> > :
> > > Now I know.
> > >
> > >> What do you think ?
> > >> One thing which is still missing is a way how to get variables
> >
> > predefined into
> >
> > >> the cmake-configure run during ctest_configure().
> > >> Does this have to be done by writing an initial CMakeCache.txt ?
> > >
> > > This seems possible using "CTEST_INITIAL_CACHE"
> > > as shown here:
> > > http://www.vtk.org/Wiki/CMake_Scripting_Of_CTest
> > >
> > > # this is the initial cache to use for the binary tree, be careful to
> >
> > escape
> >
> > > # any quotes inside of this string if you use it
> > > SET (CTEST_INITIAL_CACHE "
> > > MAKECOMMAND:STRING=nmake -i
> > > CMAKE_MAKE_PROGRAM:FILEPATH=nmake
> > > CMAKE_GENERATOR:INTERNAL=NMake Makefiles
> > > BUILDNAME:STRING=Win32-nmake71
> > > SITE:STRING=VOGON.kitware
> > > CVSCOMMAND:FILEPATH=C:/cygwin/bin/cvs.exe
> > > ")
> >
> > I recently played around with nightly builds as well. I used to have a
> > setup for experimental builds, but never could get the svn checkout to
> > run. With the approach described above, I was finally able
> > to run checkout from svn from within ctest. Unfortunately it seems that
> > some variables are not used anymore with this approach of generating
> > builds.
> > I found that CTEST_INITIAL_CACHE as well as CTEST_ENVIRONMENT seem to be
> > ignored, when using CTEST_BUILD etc. For the environment variables I
> > could get it to work by setting
> > the environment variables explicitly, e.g. 'SET (ENV{CC} "gcc-4.2")'.
> > That means that the approach proposed above does not work, at least not
> > for me.
> >
> > After all I'm somewhat confused about this new approach ignoring some of
> > the variables. Maybe someone with a deeper knowledge of ctest could
> > explain, what's going on here.
> >
> > Regards,
> >
> > Martin
> > ____________
> > Virus checked by G DATA AntiVirus
> > Version: AVF 19.138 from 09.11.2008
> >
> >
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake




More information about the CMake mailing list