]> git.lyx.org Git - features.git/commit
Cmake tests: Make foreach() command robust
authorKornel Benko <kornel@lyx.org>
Sun, 15 Dec 2019 12:38:23 +0000 (13:38 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:47 +0000 (15:48 +0200)
commitea5fb345e8f3d2b2398aeef659196dbee727cd04
tree641fe8cd8de6c8c0bd1e8eee9b7f720dd56569f6
parent12af558e3b9bf49612c7ba965ed3932d5251c5bc
Cmake tests: Make foreach() command robust

Cmake's foreach command includes forms
  foreach(<loop_var> IN LISTS <lists>)
  foreach(<loop_var> IN ITEMS <items>)
  foreach(<loop_var> RANGE ...)
We get the lines to be parsed by
  file(STRINGS "${filepath}" lines)
If in the parsed lyx-file there is a line
containing only the single word 'IN',  or 'RANGE', then
the command
  foreach(_l ${lines})
can create a syntax error (at least with cmake1.16)

In fact, in file pl_Additional.lyx:12913 happens to have
such a beast.
development/autotests/ExportTests.cmake