[CMake] cmake -E remove /path/*.txt

Alexandre Gramfort alexandre.gramfort at inria.fr
Fri Mar 12 12:26:18 EST 2010


thanks it works.

I've add to use EXECUTE_PROCESS in my  remove_some_file.cmake file.

Alexandre

On Fri, Mar 12, 2010 at 1:53 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2010/3/12 Alexandre Gramfort <alexandre.gramfort at inria.fr>:
>> Hi,
>>
>> is there a way to have cmake do something like :
>>
>> cmake -E remove /path/*.txt
>>
>> I need to clear tests outputs before running new tests. I have a
>> solution with a GLOB but the list of files is set during cmake
>> configure
>> so it does not work if I run "make test" twice without reconfiguring.
>
> When you want build time evaluation you may write a CMake script
>
> remove_some_file.cmake which:
>   1) does the GLOB for building the LIST_OF_FILE
>   2) execute_process cmake -E remove ${LIST_OF_FILE}
>
> then in your CMakeLists.txt you add a custom_command/target which
> executes:
>
> cmake -P remove_some_file.cmake.
>
> That way the list of file will be built at "build" time.
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
>


More information about the CMake mailing list