CMake has a built-in install
target, so that you can use make install
if you're generating Makefiles, or build an INSTALL
project in Visual Studio, etc.
The behavior of this target is defined by various install()
commands in your CMake files, e.g. copying files or products of existing CMake targets to specific installation directories.
The install()
command also allows you to specify a component. If you then call CMake specifying a component, then the install
target will install only products associated with that particular component.
What I haven't found, though, is: What targets does the install
target depend on?
- If one of my targets does not compile, will this cause
make install
to fail, even if that target doesn't produce anything for installation? - If I'm building one specific component, and I've specified it in my original CMake call, will
make install
build all the targets in my source tree (but only install the one component)? Or will it build only the targets necessary for the installation of the specific component?