title: Using cmake variable in execute_process command in cmake file
body: <p>I am using <code>execute_process()</code> function in <code>cmake</code>. </p>
  
  <pre><code>message(" FLAGS = ${FLAGS}")
  message(" SCATTERFILE = ${SCATTERFILE}")
  set ( EXECUTE_COMMAND "arm-none-eabi-gcc ${FLAGS}  -E -P -x c-header ${SCATTERFILE} -o ~/ttt.ld" )
  message("EXECUTE_COMMAND = ${EXECUTE_COMMAND}")
  execute_process(COMMAND  ${EXECUTE_COMMAND} RESULT_VARIABLE rv )
  </code></pre>
  
  <p>Everything is displayed perfectly as a result of <code>message()</code> command, but it causes errors when it is run while parsing <code>cmake</code>. I think the <code>FLAGS</code> variable is not expanding as expected  while parsing. When I run the same <code>EXECUTE_COMMAND</code> which is displayed as a result of <code>message</code> command in the terminal it runs perfectly. what could be the issue ?</p>
  
  <p>Edit:
  I have removed <code>${FLAGS}</code> from </p>
  
  <pre><code>set ( EXECUTE_COMMAND "arm-none-eabi-gcc ${FLAGS}  -E -P -x c-header ${SCATTERFILE} -o ~/ttt.ld" )`
  </code></pre>
  
  <p>now I am using </p>
  
  <pre><code>set ( EXECUTE_COMMAND "arm-none-eabi-gcc   -E -P -x c-header ${SCATTERFILE} " )
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>EXECUTE_COMMAND arm-none-eabi-gcc   -E -P -x c-header ~/scatterFile.scatter rv: No such File or directory. 
  </code></pre>
  
  <p>If I simply enter this command on the terminal,</p>
  
  <blockquote>
    <p>arm-none-eabi-gcc   -E -P -x c-header ~/scatterFile.scatter</p>
  </blockquote>
  
  <p>it executes and gives the expected results.</p>