cmake_minimum_required(VERSION 3.5) project(Imp3D-CMake) enable_language(Fortran) if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(dialect "-ffree-form -std=f2008 -fimplicit-none") set(bounds "-fbounds-check") endif() if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") set(dialect "-stand f08 -free -implicitnone") set(bounds "-check bounds") endif() # Have the .mod files placed in the lib folder SET(CMAKE_Fortran_MODULE_DIRECTORY modules) set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${bounds}") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialect}") # # Compile. # file(GLOB_RECURSE sources src/*.f90) add_executable(Imp3D ${sources})