title: How to compile additional source files in cmake after the build process
body: <p>I have a project in cmake for windows which contains a Pro*C source file called database.proc, my goal is to generate a C source file from the .proc file and add it to the project to be linked along the other source files, I've tried to add a custom command to achieve this without success</p>
  
  <pre><code>add_custom_command(TARGET myproj OUTPUT PRE_LINK
      COMMAND ${PROC} iname=${PROJECT_SOURCE_DIR}/connection.proc SQLCHECK=SYNTAX
          MODE=ANSI IRECLEN=255 ORECLEN=255
          ONAME=${PROJECT_SOURCE_DIR}/connection.c
      COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS}
              ${PROJECT_SOURCE_DIR}/connection.c )
  </code></pre>
  
  <p>Is there some way to do this? </p>