[CMake] Empty ERROR_VARIABLE in execute_process
Roman Wüger
roman.wueger at gmx.at
Mon May 23 03:25:52 EDT 2016
Hello,
when I run qmllint from the command line to test an error I get:
C:\Tests>C:\Qt\5.6\msvc2015\bin\qmllint.exe test.qml
test.qml:1 : Syntax error
C:\Tests>echo %ERRORLEVEL%
-1
C:\Tests>
If I call this from a CMake script
execute_process(COMMAND C:/Qt/5.6/msvc2015/bin/qmllint.exe C:/Tests/test.qml
RESULT_VARIABLE _resVar
OUTPUT_VARIABLE _outVar
ERROR_VARIABLE _errVar
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
message("_resVar: ${_resVar}")
message("_outVar: ${_outVar}")
message("_errVar: ${_errVar}")
The output is:
1> _resVar: -1
1> _outVar:
1> _errVar:
It seems that the error pipe isn’t read correctly, because _errVar is empty.
And hints?
Regards
Roman
More information about the CMake
mailing list