[CMake] ADD_CUSTOM_TARGET USES_TERMINAL not printing out stuff

Brad King brad.king at kitware.com
Wed Jun 5 10:51:14 EDT 2019


On 6/5/19 8:27 AM, Gonzalo Garramuño wrote:
> This used to print out all that cpack was doing while it was doing it.  
> Now with v3.15.0-rc1 it just sits there and outputs all the text at the 
> end when it finishes, which sucks as it looks like it has hung.

Thanks for trying the release candidate!

However, I cannot reproduce this in a simple example:


```
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(UsesTerminal NONE)
add_custom_target(UseTerminal ALL
  COMMAND sh "${CMAKE_CURRENT_SOURCE_DIR}/custom.sh"
  USES_TERMINAL
  )

$ cat ../custom.sh
echo first
sleep 1
echo second
sleep 1
echo third

$ cmake --version
cmake version 3.15.0-rc1
...

$ cmake .. -GNinja

$ ninja UseTerminal
...
first
second
third
```

While ninja is running I can see one line print at a time separated
by one second each.

Please try to provide a more complete standalone example.  Also please
open an issue for this at https://gitlab.kitware.com/cmake/cmake/issues

Does `pool = console` appear in the `build.ninja` rule for your custom target?

Thanks,
-Brad


More information about the CMake mailing list