[CMake] Determine Verbosity in Custom Language Scripts

David Zemon david at zemon.name
Mon Jan 11 19:15:21 EST 2016


I've defined a custom language for my project which is simply a wrapper
around GCC. The "compiler" for this language is a CMake script which
invokes g++ followed by objcopy. I would like to use CMake's standard
verbosity system - either VERBOSE=1 for Unix Makefiles or -v or Ninja
(maybe there are others too?) but I don't know how. I was previously doing
something like

```
if (ENV{VERBOSE})
  message("g++ ${SOURCE}")
endif ()
execute_process(COMMAND g++ ${SOURCE})
```

but Ninja doesn't set an environment variable. Is it possible do this?

Thank you,
David Zemon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160112/fb89b2a5/attachment.html>


More information about the CMake mailing list