Preset code
Actually, install(CODE)
they install(SCRIPT)
are executed in the order in which they appear among other commands install()
, so if your call install(CODE)
is the first call install()
, it will be executed before all other installation commands.
Note that the above order ( install()
commands executed in order of appearance) applies to commands within one install component and one CMakeList file (thanks to @John for pointing this out in the comments). However, for the intended "pre-install" step, setting the command to the first position in the first CMakeList should work.
source to share