[CMake] test depending on code compilation
Franck Houssen
franck.houssen at inria.fr
Thu Jan 11 12:03:15 EST 2018
----- Mail original -----
> De: "Mario Werner" <mario.werner at iaik.tugraz.at>
> À: cmake at cmake.org
> Envoyé: Jeudi 11 Janvier 2018 16:27:18
> Objet: Re: [CMake] test depending on code compilation
>
> On 2018-01-10 10:47, Franck Houssen wrote:
> > [snip]
> >
> > The 2 unexpected problems I have left are:
> > 1) mytestexe is compiled everytime I type "make" which is a solution but
> > is not really what I am looking for (also compiled when I type "make
> > check" which is expected).
> > => is there a way for make not to compile mytestexe (note I didn't
> > added ALL in add_custom_target so I am not sure to know why make builds
> > mytestexe)
>
> You have to excluded mytestexe from the ALL target if you do not want
> that it gets built by default [1]. (e.g., add EXCLUDE_FROM_ALL to
> add_executable [2])
>
OK !
> > 2) Also the verbosity is broken with check : make test ARGS="-V" is
> > verbose , but, make check ARGS="-V" is not.
> > => how to deal with that ?
> >
> >
>
> Can't help you there. I usually simply use `make check` to build and run
> the full test suite in order to get an overview. Afterwards, I directly
> call `ctest` with the desired arguments, for example when triaging a bug.
>
In travis a make check ARGS="-V" could be convenient to see output of tests while they run (understand what is wrong when if it fails - you can't get files from travis).
Anyway, that not so blocking.
> HTH,
> Mario
>
>
> [1] https://cmake.org/cmake/help/v3.0/prop_tgt/EXCLUDE_FROM_ALL.html
> [2]
> https://cmake.org/cmake/help/v3.0/command/add_executable.html?highlight=EXCLUDE_FROM_ALL
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
More information about the CMake
mailing list