Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pre-install code

Tags:

cmake

Is there any analogy

install(CODE ...) # this code is executing AFTER install step

for pre-install step in cmake?

I suppose code execution in POST_BUILD step, but how to run this code?

like image 456
DEgITx Avatar asked Jan 19 '26 21:01

DEgITx


1 Answers

Actually, install(CODE) and install(SCRIPT) are executed in the order in which they appear among other install() commands, so if your call to install(CODE) is the first install() call, it will be executed before all other installation commands.

Note that the ordering mentioned above (install() commands executed in order of appearance) applies for commands within one install component and one CMakeList file (thanks to @John for pointing this out in comments) . Nevertheless, for the intended "pre-install" step, putting the command on the first place in the first CMakeList should still work.

like image 137
Angew is no longer proud of SO Avatar answered Jan 22 '26 21:01

Angew is no longer proud of SO