[CMake] With gcc is __FILE__ with full path. Is there a workaround?

Manfred Rebentisch mrebentisch at comparat.de
Mon Apr 2 15:40:26 EDT 2007


Thank you Filipe,

Am Sonntag, 1. April 2007 23:20 schrieb Filipe Sousa:
>
> what about using basename()?
>
I do use a Macro:

#define CP_PREFIX(varname, functionname)      \
	static const char* varname  = __FILE__ ":" functionname

and use it:

int func(void)
{
   CP_PREFIX(prefix, "func");
   return printf("%s: error msg x\n", prefix);
}

The line with return and printf is only the example of use. I use other 
functions.
With this macro you cannot use a function.

Another idea?

Manfred


More information about the CMake mailing list