and passed it to my library in .cpp file as following;
The extern keyword does NOT pass a value. It makes a variable declared in another file available in the file containing the extern keyword.
Preprocessor directives are evaluated at compile time, NOT at run time.
It really is not clear what you are trying to do. Explain that in English, not code.