title: Passing variables down to subdirectory only
body: <p>How do I pass project specific variables down to subdirectory? I wonder if there is a "official" way of doing this:</p>
  
  <pre><code># (CMAKE_BUILD_TYPE is one of None, Debug, Release, RelWithDebInfo)
  
  # ...
  
  # set specific build type for 'my_library'
  set( CMAKE_BUILD_TYPE_COPY "${CMAKE_BUILD_TYPE}" )
  set( CMAKE_BUILD_TYPE "Release" )
  add_subdirectory( "my_library" )
  set( CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_COPY} )
  
  # continue with original build type
  # ...
  </code></pre>
  
  <p>The library/subdirectory <code>my_library</code> should always be buildt with type <code>"Release"</code>, main project and other subdirectories should be buildt with type defined by configuration. I am not able to modify the <code>CMakeLists.txt</code>of <code>my_library</code>.</p>