title: How to capture CMake command line arguments?
body: <p>I want to record the arguments passed to cmake in my generated scripts. E.g., "my-config.in" will be processed by cmake, it has definition like this:</p>
  
  <blockquote>
    <p>config="@CMAKE_ARGS@"</p>
  </blockquote>
  
  <p>After <code>cmake</code>, <code>my-config</code> will contain a line something like this:</p>
  
  <blockquote>
    <p>config="-DLINUX -DUSE_FOO=y -DCMAKE_INSTALL_PREFIX=/usr"</p>
  </blockquote>
  
  <p>I tried <code>CMAKE_ARGS</code>, <code>CMAKE_OPTIONS</code>, but failed. No documents mention this. :-(</p>