i am terribly late but in case it helps you or anyone else: it seems to me that you are correctly setting the CMAKE_Fortran_FLAGS BUT it is not used as the actual source being built is downloaded and build without this option. Take a look in the CMakeLists.txt in the ExternalProject_Add command, this is where you need to set it