[CMake] Setting CTEST_BUILD_NAME from cmake config

Michele Dolfi dolfimeth at gmail.com
Fri Aug 24 09:45:46 EDT 2012


On Fri, Aug 24, 2012 at 3:24 PM, David Cole <david.cole at kitware.com> wrote:

>
>> On Aug 24, 2012, at 9:01, Michele Dolfi <dolfimeth at gmail.com> wrote:
>>
>> > Hi all,
>> >
>> > I started using CMake, CTest and CDash, with the simple targets
>> Nightly, Continuous and Experimental: it works very well.
>> > Now I would like to divide my project in subproject, so that a failure
>> in compiling one small test is not affecting the full dashboard report. I
>> read that ctest driver files are the way to go.
>> >
>> > I quickly realized that include(CTest) was automatically setting many
>> variables that are not there in a ctest driver script, i.e. CTEST_SITE,
>> CTEST_BUILD_NAME. Specially for the latter one, I go used to tune the
>> default naming, by looking at my cmake options and some library info (e.g.
>> Boost version).
>> >
>> > In the ctest script I use ctest_empty_binary_directory(), and I create
>> a basic CMakeCache.txt to start the ctest_configure() afterwards. How can I
>> read cmake options before ctest_start() (at this point I need BUILDNAME to
>> be set!).
>> >
>>
>
> You should set those variables in the ctest -S script. A ctest -S script
> is typically coupled to the specific machine and build that it represents,
> so it's the right place to set those variables.
>


So, since the basic config option (e.g. compiler, in case I want to test
more) has to be set in the ctest -S script, I can just use this info to
generate the name from there?
In my case I would like to put some library version number in the
BUILDNAME, in order to easily filter the results in the dashboard. Doing it
in the ctest -S means invoking find_library(), i.e. perming the config in
two different places.


Michele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120824/a178ba4b/attachment.htm>


More information about the CMake mailing list