I have a set of an environment variable which is in bash, I want to add those all environment variable in my executable in CMakeLists.txt.
I have an exec-cluster.bash file having
EXPORTS+=" export DICE_USE_ALT_LICENSE=${DICE_USE_ALT_LICENSE};"
EXPORTS+=" export DICE_VENDOR_KEY=\"${DICE_VENDOR_KEY}\";"
Now I want to add these all variable in my executable in CMakeLists.txt.
bashin your case). The only exception might be to change one of the start scripts (e.g.~/.bashrc) but even then the changes won't become effective beforebashis started next time. Btw. how do you know that user of your executable runs this frombash? Although it's probably very common - it's not the only existing shell.tcshandzshmight be in use as well and there are (much?) more...get_envonly applies when your program runs, not when is being built? How would CMake come into the picture here? Do you want to hard-code these variables into your program somehow?