]> 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)
committerKornel Benko <kornel@lyx.org>
Tue, 31 Dec 2019 10:35:54 +0000 (11:35 +0100)
commita99dc05e18018db28f4a485e4c9c31dd905681a0
tree76b7ce461ae6eec7e5d8cd7ef90e98705456b56a
parent440271540f1d79b0c4d27a94debca10f782d9fb9
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.

(cherry picked from commit 7b44280da4fc015a4a930c311cc6073cebacf738)
development/autotests/ExportTests.cmake