I'd like to include a flag such as -DMY_FLAG=ONETWOTHREE
in the CMake call, i.e. make .. -DMY_FLAG=ONETWOTHREE
, and get the value of MY_FLAG
in the fortran code. I'm using add_definitions("-DMY_FLAG=${MY_FLAG}")
to pass MY_FLAG
to make
.
Currently, when I do something like
write(*,*) MY_FLAG
I get this compiler error:
Error: Symbol 'ONETWOTHREE' at (1) has no IMPLICIT type
Can the -D
flags be cast to a type in fortran? It looks like MY_FLAG
is somehow defined at compile time, but it has no type.