[CMake] grep at build time?

Micha Hergarden micha.hergarden at gmail.com
Tue Jul 21 13:11:36 EDT 2015


On 07/18/2015 08:17 AM, Alexandre GOUAILLARD wrote:
> dear all,
>
> I'm trying to use cmake as a super build script for another library
> build system.
>
> Using add_custom_command and add_custom_target I have managed to
> handle most of the steps so far. My libraries and executable are being
> built as requested across platform.
>
> Now I'm trying to import the generated tests. Some of the generated
> executables during the build step are self-contained tests that I
> would like to run using ctest and send to a dashboard. So far I have
> hardcoded the revision of the code i'm fetching, and the corresponding
> list of tests. However those tests change pretty often, and I would
> like to have something more flexible there.
>
> How could I grep the list of tests (knowing that they all end up with
> ".isolated" a grep would do), and loop through the resulting list
> "add_test"ing them one by one AT CMAKE BUILD TIME, after a previous
> target has been built?
>
> I googled around, tried a few things, but couldn't figure out a way to
> make it happen.
>
> thanks in advance for all advice.
>
> Alex.
>
> -- 
> Alex. Gouaillard, PhD, PhD, MBA
> ------------------------------------------------------------------------------------
> CTO - Temasys Communications, S'pore / Mountain View
> President - CoSMo Software, Cambridge, MA
> ------------------------------------------------------------------------------------
> sg.linkedin.com/agouaillard <http://sg.linkedin.com/agouaillard>
>
>  *
>
>
>
>
Hello Alex,

Do you mean grepping or globbing? Both can be done at configuration time
using the FILE command. You could perform a file(glob) followed by a
file(strings) in a loop. I'm not sure what you mean by cmake build time.
Cmake will generate a buildsystem (configuration time) and the
buildsystem will do the actual building (build time).

Regards,
Micha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150721/26570010/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150721/26570010/attachment-0001.sig>


More information about the CMake mailing list