Answers
The following are the answers to the preceding questions:
- It can be achieved via the
install(TARGETS <
target_name>)
command. - The output artifacts of the specified targets.
- No, because header files are not classified as output artifacts of a target. They must be installed separately via the
install(DIRECTORY)
command. - The
GNUInstallDirs
CMake module provides system-specific default paths for installation, such asbin
,lib
, andinclude
. - With the help of the
PATTERN
andFILES_MATCHING
parameters of theinstall(DIRECTORY)
command. - To make the installation relocatable so that the user can change the installation directory by specifying an installation prefix.
- The
<package-name>-config.cmake
or<package-name>Config.cmake
file, and optionally the<package-name>-config-version.cmake
or<
package-name>ConfigVersion.cmake
file. - Exporting a target means creating the required CMake code so that you can import it into another...