I'm trying to run a variable as a command on Linux. But this variable also has variables inside. Basically, I have the following:
CMAKE=cmake
GENERATOR="Unix Makefiles"
CMAKE_CONFIGURE_="$CMAKE -G \"$GENERATOR\""
when I echo it, it seems that I have what I want:
cmake -G "Unix Makefiles"
However, when I try to run CMAKE_CONFIGURE_ as a command like so:
$CMAKE_CONFIGURE_
I have the following error:
CMake Error: Could not create named generator "Unix
It seems the string $GENERATOR is passed as two arguments because of the space. How could I solve this issue?