Thanks to πάντα ῥεῖ
His solution works for my first question, and I've could do that :
CMakeLists.txt:
ADD_DEFINITIONS( -D_VAR=\"myValue\" )
main.cpp:
#include
#ifdef _VAR
#define TXT _VAR
#else
#define TXT "nobody"
#endif
int main(){
std::cout << "hello " << TXT << " !" << std::endl;
return 0;
}