title: Generate preprocessor definitions based on CMAKE_CONFIGURATION_TYPES
body: <p>I want to generate a Visual Studio project with two configurations using cmake. I want cmake to define different preprocessor symbols for these configurations.</p>
  <p>I generate the project with the following command</p>
  <pre><code>cmake -B intermediate/cmake -G &quot;Visual Studio 16 2019&quot; -T v142 -DCMAKE_GENERATOR_PLATFORM=x64
  </code></pre>
  <p>In my CMakeLists.txt I define configurations:</p>
  <pre><code>if(CMAKE_CONFIGURATION_TYPES)
    set(CMAKE_CONFIGURATION_TYPES Debug Release)
  endif()
  </code></pre>
  <p>Now, how do I define the preprocessor definitions per configuration? The quick search advises against using <code>if(CMAKE_BUILD_TYPE STREQUAL &quot;Release&quot;)</code> because it doesn't work for multiconfiguration generators.</p>