title: How do you exclude a CMake target from just one configuration?
body: <p>I've recently added a module to a CMake project that depends on a library that I only have compiled against the release CRT. It looks like this in CMakeLists.txt:</p>
  
  <pre><code>IF(WIN32)
      ADD_LIBRARY(mymodule MODULE ${MY_LIBRARY_FILES})
      TARGET_LINK_LIBRARIES(mymodule libVendor)
      INSTALL(TARGETS mymodule LIBRARY)
  ENDIF(WIN32)
  </code></pre>
  
  <p>If I try to compile this module in MSVC with debug settings, the compile fails. So what I want to do is exclude it from being compiled and installed in the debug configuration. In the release configuration, it would be used as normal. Is it possible to do this with CMake?</p>