cmake doesn't work with LFortran on Windows
When trying to compile a cmake projects using LFortran as the Fortran compiler on Windows, one gets:
$ cd integration_tests
$ export FC="C:\\projects\\lfortran-ts83e\\src\\bin\\lfortran.exe"
$ cmake -G ninja -DCMAKE_Fortran_PREPROCESS=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DLFORTRAN_BACKEND=llvm .
CMake suite maintained and supported by Kitware (kitware.com/cmake).
-- The C compiler identification is MSVC 19.16.27035.0
-- The Fortran compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_Fortran_PREPROCESS_SOURCE
CMake Error at C:/Miniconda37-x64/Library/share/cmake-3.21/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
C:/Miniconda37-x64/Library/share/cmake-3.21/Modules/CMakeTestFortranCompiler.cmake:20 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
See also "C:/projects/lfortran-ts83e/integration_tests/build-lfortran-llvm/CMakeFiles/CMakeOutput.log".
See also "C:/projects/lfortran-ts83e/integration_tests/build-lfortran-llvm/CMakeFiles/CMakeError.log".
This is using CMake 3.21.1 and Ninja 1.10.2. This seems like a bug in CMake.
We might need to switch to just use fpm
.