Ok, to fully answer your question, you need to read a book on introductory programing in C and Tanenbaum and the dragon book. Start with learning C.
Some of the basic pieces to get you started: when compiling a C program there are traditionally several distinct phases. (modern compilers may do cross phase optimization) These phases are:
prepossessor. This ...

You don't have to do anything as these are warnings not errors.
What you could do is notify the maintainers of the package and let them know that warnings are confusing to the non-initiated and if they can get rid of them. If you do make sure to provide them with your setup information, as they might not see the warning in theirs.

There is no real general answer. If some tool insists on some tool it will do so.
If setting environment variables works for you, there is no need to reboot. You can simply call your command like this:
CXX=g++ cmake ...
This will run cmake with the CXX environment variable set to g++.
If you really want to do what you asked for you could replace ...