My tricks are implemented also for CodeBlocks IDE just use gcc (Not gfortran)
as your compiler and put the gfortran.pp under codeblocks directory and
on the project declarations put under Build Options->Other Options
@$(CODEBLOCKS)\gfortran.pp

$(CODEBLOCKS) is a Codeblocks symbol of the codeblocks directory

and Build Options->Linker Settings put the gfortran as library to add
That's all

On Mingw/gcc compiler will try to look for gfortran.dll,gfortran.a,libgfortran.a etc...
By using this it will work on cross platform Windows & Linux