Invoking Scripts During Installation
Let's learn how to invoke scripts during the installation process.
We'll cover the following...
If you have ever installed a shared library on a Unix-like system, you may remember that before you can use it, you'll likely need to tell the dynamic linker to scan trusted directories and build its cache by calling ldconfig
.
Command install(SCRIPT|CODE)
If we'd like to make our installation fully automatic, CMake offers the install(SCRIPT|CODE)
command to support such cases. Here's the full command's signature:
install([[SCRIPT <file>] [CODE <code>]][ALL_COMPONENTS | COMPONENT <component>][EXCLUDE_FROM_ALL] [...])
...