title: How do I configure a CMake build non-interactively?
body: <p>My current CMake workflow for a new debug build is:</p>
  
  <pre><code>mkdir debug-build
  cd debug-build
  ccmake /path/to/sources
  </code></pre>
  
  <p>I see this: <a href="https://i.stack.imgur.com/EZ5sv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EZ5sv.png" alt="enter image description here"></a></p>
  
  <p>I press <code>c</code> to configure, then <code>t</code> to toggle advanced mode. It now looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/BA3yG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BA3yG.png" alt="enter image description here"></a></p>
  
  <p>I can now change, e.g. <code>CMAKE_BUILD_TYPE</code> to <code>Debug</code> or enable warnings by setting <code>CMAKE_CXX_FLAGS</code>, etc.</p>
  
  <p>How do I do all this non-interactively, from a shell script?</p>