title: Find libraries in Windows(MSVC) with CMake
body: <p>im having an issue trying to link libraries in MSVC. I have some  external dependencies i have compiled for release and debug and set them in different folder (${PROJECT_SOURCE_DIR}/External/Debug/lib and ${PROJECT_SOURCE_DIR}/External/Release/lib). I have written some FindFoo.cmake modules which have as a HINT for the find_library command a ${EXTERNAL_LIB_DIR} which is set depending on the ${CMAKE_BUILD_TYPE}.</p>
  
  <p>This work perfects on Linux but fails in Windows (it always set the EXTERNAL_LIB_DIR path to the Debug path) and fails to link because of _ITERATOR_DEBUG_LEVEL. </p>
  
  <p>Here is an example of the FindFoo.cmake I'm using. </p>
  
  <pre><code>FIND_PATH(SOIL_INCLUDE_DIR                                                                                    
  NAMES SOIL/SOIL.h                                                                                         
  PATHS                                                                                                     
  ${EXTERNAL_DIR}/soil/inc                                                                                  
  NO_DEFAULT_PATH                                                                                           
  )                                                                                                         
  
  
  find_library(                                                                                                 
  SOIL_LIBRARY                                                                                              
      NAMES SOIL soil soil_debug                                                                            
  PATHS                                                                                                     
      ${EXTERNAL_LIB_DIR}                                                                                   
      NO_DEFAULT_PATH                                                                                       
  )                                                                                                         
  
  
  INCLUDE(FindPackageHandleStandardArgs)                                                                        
  
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(SOIL DEFAULT_MSG SOIL_LIBRARY S 
  SOIL_INCLUDE_DIR)                             
  
  
  if (${SOIL_FOUND})                                                                                            
  SET(SOIL_INCLUDE_DIRS ${SOIL_INCLUDE_DIR})                                                                
  SET(SOIL_LIBRARIES    ${SOIL_LIBRARY})                                                                    
  endif()                                                                                                       
  
  
  MARK_AS_ADVANCED( SOIL_LIBRARY SOIL_INCLUDE_DIR ) 
  </code></pre>
  
  <p>And here the creation of EXTERNAL_LIB_DIR
      # Set external libraries                                                                                      </p>
  
  <pre><code>set(EXTERNAL_DIR ${PROJECT_SOURCE_DIR}/External)                                                              
  
  if (${CMAKE_BUILD_TYPE} MATCHES Debug)                                                                        
  set(EXTERNAL_LIB_DIR ${PROJECT_SOURCE_DIR}/External/lib/Debug)                                            
  else()                                                                                                        
  set(EXTERNAL_LIB_DIR ${PROJECT_SOURCE_DIR}/External/lib/Release)                                          
  
  endif()                                                                                                       
  message(STATUS "Using libraries in ${EXTERNAL_LIB_DIR}") 
  </code></pre>
  
  <p>How should I modify the FindFoo.cmake of the creation of the EXTERNAL_LIB_DIR variable to make it work with MSVC?</p>
  
  <p>Thanks</p>