Apologies for the noobish question, but even a seasoned CMake user can get lost from time to time.
I want to demonstrate the feasability of automating an article creation proces with CMake. Ultimately I want to issue commands as such on the CLI:
These commands would:
compile a C/C++ application (no problem)
invoke that app with some args (provided by CMake) to create a data file (only if the app or the args have changed)
invoke a gnuplot script on the data file to create a plot (only if the the data file or the plotting script have changed)
invoke latex to create a document that references the plot (only if either the latex file or the plot changed)
Because any of the steps may take fairly lone, I would like each pass to do something only if any of the preceding steps are out of date. I sort of got lost in the custom_target and custom_command functions and how and when to use them to setup a chain of custom tool invocation that have well defined input and output files.