I've tried `geany -g -P` and other methods. no way can do it.
I guess you already read the docs about tags generation? https://www.geany.org/manual/current/index.html#generating-a-global-tags-fil...
But you might also find the following two plugins useful: https://github.com/geany/geany-plugins/tree/master/geanyctags
https://github.com/geany/geany-plugins/tree/master/projectorganizer
Probably projectorganizer solves your problem best.