title: Running a custom command in Cmake
body: <p>I am very new to Cmake and need to generate some files at compile time. once generated i need to compile and link the files. I ve created the cmake makefile to compile the already generated files like</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.6)
  project(demo)
  set(CMAKE_CXX_FLAGS "-DWITH_COOKIES")
  add_library(soapC soapC.cpp soapVimBindingProxy.cpp)
  add_library(stdsoap2  /home/abdullah/installs/gsoap-shah_edits/gsoap/stdsoap2.cpp)
  add_executable(demo test_file.cc test_app.cc)
  target_link_libraries(demo soapC stdsoap2 gsoap++)
  </code></pre>
  
  <p>This successfully compiles the project. However the files <code>soapC.cpp soapVimBindingProxy.cpp</code> needs to be generated first. And I want to generate these files at runtime using the gsoap tool.</p>
  
  <p>following is the command that needs to be run to generate the header file</p>
  
  <pre><code>wsdl2h -o outfile.h infile.wsdl
  </code></pre>
  
  <p>This takes an input wsdl file and creates a corresponding outfile.h.
  Now I tried doing this in cmake like this</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.6)
  add_custom_command(
  OUTPUT vsphere.h
  COMMAND wsdl2h -o vsphere.h vim25/vim.wsdl
  ) 
  </code></pre>
  
  <p>But something goes wrong here. No error pops up but no file is created either. Am I missing something ? All help much appreciated.
  Thanks.</p>