title: Why my CMake does not add CMAKE_CXX_FLAGS_DEBUG to CMAKE_CXX_FLAGS?
body: <p>I suppose that using cmake with <code>CMAKE_BUILD_TYPE</code> adds appropriate compiler flag to <code>CMAKE_CXX_FLAGS</code>.
  However, once I typed the following command and then see the content of <code>CMAKE_CXX_FLAGS</code>, nothing expected was added.</p>
  
  <pre><code>mkdir build
  cd build
  cmake .. -DCMAKE_BUILD_TYPE=DEBUG
  </code></pre>
  
  <p>Below is the snippet of my CMakeLists.txt.</p>
  
  <pre><code>... #version and project name
  set(CMAKE_CXX_FLAGS "-Wall")
  set(CMAKE_CXX_FLAGS_DEBUG "-g3")
  message(${CMAKE_CXX_FLAGS})
  </code></pre>
  
  <p>From the message, I expected it to show <code>-Wall -g3</code>.</p>
  
  <p>But what was shown was only <code>-Wall</code>, seeming that <code>CMAKE_CXX_FLAGS_DEBUG</code> was not added to <code>CMAKE_CXX_FLAGS</code> as opposed to the explanation given in <a href="https://cmake.org/cmake/help/v3.0/variable/CMAKE_BUILD_TYPE.html" rel="nofollow noreferrer">https://cmake.org/cmake/help/v3.0/variable/CMAKE_BUILD_TYPE.html</a>.
  It says that 
  <code>
  For example, in a build tree configured to build type Debug, CMake will see to having CMAKE_C_FLAGS_DEBUG settings get added to the CMAKE_C_FLAGS settings. See also CMAKE_CONFIGURATION_TYPES.</code></p>
  
  <p>In my case, which one was indeed used, <code>CMAKE_CXX_FLAGS</code> or <code>CMAKE_CXX_FLAGS_DEBUG</code>?</p>