# This configuration assumes a macports toolchain with gcc as C # and gfortran as Fortran backend. set(CMAKE_Fortran_COMPILER /opt/local/bin/gfortran CACHE PATH "Path to serial Fortran compiler") set(CMAKE_C_COMPILER /opt/local/bin/gcc CACHE PATH "Path to serial C compiler") set(CMAKE_CXX_COMPILER /opt/local/bin/g++ CACHE PATH "Path to serial C++ compiler") set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -ffree-line-length-none -static-libgfortran -finit-local-zero" CACHE STRING "Fortran flags" FORCE) set(NetCDF_FORTRAN_DIR /opt/local CACHE PATH "Path to NetCDF Fortran library") set(NetCDF_C_DIR /opt/local CACHE PATH "Path to NetCDF C library") set(CMAKE_C_PREPROCESS_FLAG "-cpp" CACHE PATH "Preprocess flag") set(CMAKE_Fortran_PREPROCESS_FLAG "-cpp" CACHE PATH "Preprocess flag") set_source_files_properties( *.F90 *.fpp *.ftn PROPERTIES Fortran_PREPROCESS ON )