# How to create reliable command-line configured argument dependencies for custom commands?

**URL:** https://discourse.cmake.org/t/how-to-create-reliable-command-line-configured-argument-dependencies-for-custom-commands/842
**Category:** Code
**Created:** [March 22, 2020, 3:54am UTC](https://discourse.cmake.org/t/how-to-create-reliable-command-line-configured-argument-dependencies-for-custom-commands/842 "2020-03-22T03:54:15Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![airwin](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@airwin](https://discourse.cmake.org/u/airwin)
#### Post date: [March 25, 2020, 11:49am UTC](https://discourse.cmake.org/t/how-to-create-reliable-command-line-configured-argument-dependencies-for-custom-commands/842/4 "2020-03-25T11:49:24Z")

</div>

Hi Frank:

Thanks for your thoughts on this topic.

For at least my use case, CMake (version 3.13.4 is what I am testing  
since that is the minimum CMake version I allow for this project)  
appears to be doing exactly the right thing (once I implemented the  
file and target dependency chains properly but with no special  
provisions for argument dependencies). That is all commands previous  
in the dependency chain to commands whose arguments are changed are  
_not_ rebuilt while the commands whose arguments changed as well as  
all commands that depend on those changed argument commands _are_  
rebuilt.

I am happy with that correct result for how argument changes  
automatically (with no special provisions) propagate through existing  
file and target dependency chains since it makes a big practical  
difference for my particular use case. There it takes 13 minutes of  
real time and ~80 minutes of cpu time to rebuild the papers from  
scratch with virtually all that time spend on generating data files to  
be plotted. But to just to rebuild the plots whose command-line  
arguments changed, and papers that depend on those plots without  
rebuilding those data files takes only ~10 seconds or so. Which  
allows quick comparisons of the quality of the figures generated by  
various combinations of PLplot options. So thanks to CMake knowing  
exactly what to do with changed custom command arguments and their  
associated dependency chains, those ~60 plot comparisons for different  
sets of PLplot options are a near-interactive experience.

---

_[View the full topic](https://discourse.cmake.org/t/how-to-create-reliable-command-line-configured-argument-dependencies-for-custom-commands/842)._
