Thanks to John's comment, this is a workaround. If you just put __BASE_FILE__=%(Filename) , it will not make a literal string. So put it between double quotes; I also added the extension since% (Filename) does not have it.
__BASE_FILE__="%(Filename)%(Extension)"
This line should be written on the preprocessor page of the project properties page.
source share