[CMake] Removing C-style comments from fortran include file?

Bill Hoffman bill.hoffman at kitware.com
Mon Oct 3 13:45:48 EDT 2011


On 10/3/2011 1:39 PM, John R. Cary wrote:
> I am using the cmakedefine mechanism for a fortran include file.
>
> If the variable is not defined, rather than
>
> /* #undef HAVE_PLASMASTATE */
>
>
> I need
>
> ! #undef HAVE_PLASMASTATE
>
> Are there existing solutions?
>
> Thx...John Cary
>
You could do something like this:

In CMake code, make sure HAVE_PLASMASTATE is set to 0 when it is not 
found.  Then put this in the configured file:


#define HAVE_PLASMASTATE @HAVE_PLASMASTATE@
#if HAVE_PLASMASTATE == 0
#undef HAVE_PLASMASTATE
#endif


-Bill



More information about the CMake mailing list