Workaround for CMake "file(STRINGS ...)" weird behaviour
It turned out that there's a weird bug/feature of CMake file splitting:
$ cat good.cmake
# [comment]
no_comment
$ cat bad.cmake
# [comment
no_comment
$ cat test.cmake
message(STATUS "good.cmake:")
file(STRINGS good.cmake _lines)
foreach(_l IN LISTS _lines)
message(STATUS "> ${_l}")
endforeach()
message(STATUS "bad.cmake:")
file(STRINGS bad.cmake _lines)
foreach(_l IN LISTS _lines)
message(STATUS "> ${_l}")
endforeach()
$ cmake -P test.cmake
-- good.cmake:
-- > # [comment]
-- > no_comment
-- bad.cmake:
-- > # [comment;no_comment
This and the silly typo this MR fixes, interfere with the logic to detect of a project is new or old style configuration (https://gitlab.cern.ch/lhcb-core/LbDevTools/-/blob/2.0.4/LbDevTools/data/toolchain.cmake#L13) causing the failure reported in #48 (closed).
Closes #48 (closed)
Edited by Marco Clemencic