]> git.lyx.org Git - lyx.git/blob - development/autotests/CheckLoadErrors.cmake
b7d37fc256f77e2565bc41988562a4e8f8885d8e
[lyx.git] / development / autotests / CheckLoadErrors.cmake
1
2 macro(CheckLoadErrors lyxerrx PARAMS_DIR res_erg)
3   set(lyxerr ${${lyxerrx}})
4   set(_erg 0)
5   if(lyxerr)
6     set(ConfigureOutput 0)
7     file(STRINGS "${PARAMS_DIR}/filterCheckWarnings" ignoreRegexp)
8     # Split lyxerr into lines
9     string(REGEX REPLACE "[\n]+" ";" foundErrors ${lyxerr})
10     foreach(_l ${foundErrors})
11       if(ConfigureOutput)
12         if(_l MATCHES "LyX: Done!")
13           set(ConfigureOutput 0)
14         endif()
15       else()
16         if(_l MATCHES "reconfiguring user directory")
17           set(ConfigureOutput 1)
18         endif()
19       endif()
20       if(NOT ConfigureOutput)
21         set(found 0)
22         foreach(_r ${ignoreRegexp})
23           if(_l MATCHES "${_r}")
24             set(found 1)
25             break()
26           endif()
27         endforeach()
28         if(NOT found)
29           message(STATUS "Error line = ${_l}")
30           # It is error, because the error-line does not match
31           # any ignoring expression
32           set(_erg 1)
33         endif()
34       endif()
35     endforeach()
36   endif()
37   set(${res_erg} ${_erg})
38 endmacro()