title: Invoke MIDL compiler from CMAKE
body: <p>I am going to use MIDL compiler with CMAKE but unable to invoke MIDL compiler from CmakeList</p>
  
  <p>That is command which I use to achieve my goal</p>
  
  <pre><code>add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/IFace.h ${CMAKE_CURRENT_BINARY_DIR}/GUIDS.c ${CMAKE_CURRENT_BINARY_DIR}/Proxy.c ${CMAKE_CURRENT_BINARY_DIR}/ProxyDll.c
  COMMAND midl /h IFace.h /iid GUIDS.c /proxy Proxy.c /dlldata ProxyDll.c ${CMAKE_CURRENT_LIST_DIR}/include/Server.idl
  )
  </code></pre>
  
  <p>When I build my project there are no files produced by MIDL compiler in <code>${CMAKE_CURRENT_BINARY_DIR}</code></p>
  
  <p>But with this signature files generates well</p>
  
  <pre><code>add_custom_command(
  PRE_BUILD
  TARGET ${PROJECT_NAME}
  COMMAND midl /h IFace.h /iid GUIDS.c /proxy Proxy.c /dlldata ProxyDll.c ${CMAKE_CURRENT_LIST_DIR}/include/Server.idl
  )
  </code></pre>
  
  <p>What am I doing wrong?</p>