title: What is the difference between "option" and "set CACHE BOOL" for a CMake variable?
body: <p>Is there any difference between the following two?</p>
  
  <pre><code>set(FOO true CACHE BOOL "description")
  
  option(FOO "description" ON)
  </code></pre>
  
  <p>Documentation: <a href="https://cmake.org/cmake/help/latest/command/set.html" rel="noreferrer">set</a> - <a href="https://cmake.org/cmake/help/latest/command/option.html" rel="noreferrer">option</a></p>
  
  <p>Background: Even if I have been using CMake for a while, I only noticed the <code>option</code> command today and I have therefore always been using <code>set</code>: I was wondering if it is safe/worth to replace the first with the second.</p>