I need to build a Fortran compiler written in C++ then its libraries written in Fortran. I would like said libraries to be compiled with my just built compiler. The problem is that the compiler binary doesn’t exist while CMake is configuring the project and thus I get an error. I’ve tried:
set(CMAKE_Fortran_COMPILER_WORKS TRUE)
set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
set(CMAKE_Fortran_COMPILER_FORCED TRUE)
set(CMAKE_Fortran_COMPILER_WORKS TRUE)
set(CMAKE_Fortran_COMPILER "path/to/non/exiting/compiler")
Is there anyway I can tell CMake to not test the compiler path and just trust me it’s there? Is the correct way to make a two stages build?
I tried to look at the clang code and they seem to do a two stages build where CMake invokes itself again to build the libraries (runtimes in clang speak). If this is the “correct” way, is there documentation on it?