Can I tell CMake to pipe all stderr output from the compiler and/or linker through an external program and showing the output of that on the terminal instead?
相关问题
- Avoid cmake to add the flags -search_paths_first a
- CMakeList file to generate LLVM bitcode file from
- How to fix NDK build error for HelloCardboard samp
- Linking against GLEW with CMake
- Linking libavcodec in Cmake, find_library won'
相关文章
- Target requires the language dialect “CXX17” (with
- How do I tell cmake not to create a console window
- Do something for all targets
- CMake: Replace compile flags of an INTERFACE targe
- Generate Web Assembly from CMake Project with a Sp
- Integrate ITK (Insight Toolkit) into own project
- Is there a way to disallow “experimental” C++17 in
- CMake properties and expanding generator expressio
For Makefile generators you can apply a filter to the compiler output by setting a custom launcher for compile rules. The following CMake list file sketches the necessary steps:
In the project root directory add the following shell script template file
gcc_filter.sh.in
:The actual shell script invoked by the custom launcher rule is first copied to the project binary directory with the
configure_file
call in the CMake list file. The executable bit of the filegcc_filter.sh.in
must be set. The shell script forwards all arguments to the compiler and then pipes the compiler output to another shell scriptmyfilter.sh
in the project root directory:The example
myfilter.sh
just invokeswc
but more elaborate output filtering can be easily done using the above recipe.