title: Use CMake to run a C++ program post-build
body: <p>I have an application that is written in C++ that I use CMake to build and release binaries.</p>
  
  <p>I'd like to have the CMakeLists.txt script compile and run a CPP file that is used to timestamp and encrypt a license file after it has built the binaries for the application. I've seen examples of running the <code>execute_process</code> command such as this:</p>
  
  <pre><code>execute_process(COMMAND "gcc -o foo foo.cpp"
                  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
  execute_process(COMMAND "./foo"
                  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                  RESULT_VARIABLE MY_FOO_VAR)
  </code></pre>
  
  <p>I am using Visual Studio 2010 to do the build on Windows. The problem is that I'm not sure how to get CMake to run a program during VS's build process. I want the last thing in the build operation to be the license file timestamp, but I don't really know enough about VS or CMake to get this set up.</p>