Subject: Re: [PATCH 5/8] cmake: support for testing git when building out of the source tree

From: Danh Doan <[email-masked]>
Date: Sat, 25 Apr 2020 06:09:54 +0700

On 2020-04-25 03:02:49+0530, Sibi Siddharthan <[email-masked]> wrote:
> > >  file(GLOB test_scipts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh")
> >
> > Remember cmake won't be re-run if nothing was changed in CMakeList.txt
> > If I only change some code, and I decided the change I make should be
> > tested by a-new-and-independent-test-script.
> > I need to re-run cmake manually! I don't like it, at all.
> >
> 
> No you don't have re-run CMake.

Yes, you have to re-run CMake.
https://cmake.org/cmake/help/v3.14/command/file.html#glob

> Note
>
> We do not recommend using GLOB to collect a list of source files
> from your source tree. If no CMakeLists.txt file changes when
> a source is added or removed then the generated build system cannot
> know when to ask CMake to regenerate. The CONFIGURE_DEPENDS flag may
> not work reliably on all generators, or if a new generator is added
> in the future that cannot support it, projects using it will be
> stuck. Even if CONFIGURE_DEPENDS works reliably, there is still
> a cost to perform the check on every rebuild. 

* Run CMake now.
* Don't touch anything
* Create new test-script, let's say t9904-just-for-cmake.sh

* Check if it's run or not, I bet the answer is not

Anyway, Junio said NO, I don't need to be a CMake hater here, anymore.

-- 
Danh