title: Overriding a default option(...) value in CMake from a parent CMakeLists.txt
body: <p>I am trying to include several third-party libraries in my source tree with minimal changes to their build system for ease of upgrading. They all use CMake, as do I, so in my own CMakeLists.txt I can use <code>add_subdirectory(extern/foo)</code> for libfoo.</p>
  
  <p>But the foo CMakeLists.txt compiles a test harness, builds documentation, a shared library which I don't need, and so on. The libfoo authors had the foresight to control these via options - <code>option(FOO_BUILD_SHARED "Build libfoo shared library" ON)</code> for example - which means I can set them via the CMake command line. But I would like to make that off by default and overridable via the command line.</p>
  
  <p>I have tried doing <code>set(FOO_BUILD_SHARED OFF)</code> before <code>add_subdirectory(extern/foo)</code>. That has the effect of not trying to build the shared library during the second and subsequent build attempts, but not during the first one, which is the one I really need to speed up.</p>
  
  <p>Is this possible, or do I need to maintain forked CMakeLists.txt for these projects?</p>