
Library is expected to be in the runtime package, and the headers and This option is typically used for package managers that have separate

Only the library will be installed, without the headers and namelink. Will have build errors.) If you install only the Libraries component, Namelink will be a dangling symlink, and projects that link to the library

(If you don't also install the Libraries component, the In this scenario, if you choose to install only the DevelopmentĬomponent, both the headers and namelink will be installed without the Install( TARGETS mylib LIBRARY COMPONENT Libraries NAMELINK_COMPONENT Development PUBLIC_HEADER COMPONENT Development ) GNUInstallDirs, but with its headers installed to a project-specific The following example shows a static libraryīeing installed to the default destination provided by This allows package maintainers to control the install destination by setting Path that begins with the appropriate GNUInstallDirs variable. Projects must specify a DESTINATION, it is recommended that they use a To make packages compliant with distribution filesystem layout policies, if Instead of being able to rely on the above (see next example below). Otherwise, they must provide a DESTINATION Project-specific subdirectory may prefer using file sets with appropriate Projects wishing to follow the common practice of installing headers into a The following table shows the target types with their associated variables andīuilt-in defaults that apply when no destination is given: Object libraries, but they are handled differently (see the discussion of this A destination can be omitted for interface and A destination must always be provided for module libraries,Īpple bundles and frameworks. Targets through the PUBLIC_HEADER and PRIVATE_HEADER Sets, and the public and private headers associated with the installed

For these target types, whenĭESTINATION is omitted, a default destination will be taken from theĪppropriate variable from GNUInstallDirs, or set to a built-inĭefault value if that variable is not defined. Only targets of that type will be installed (which can be used to installįor regular executables, static libraries and shared libraries, theĭESTINATION argument is not required. Installation properties apply to all target types. To the target or file type specified in the argument. Would be installed to myproj/here.h below the destination.įor each of these arguments given, the arguments following them only apply blah/include/myproj/here.h with a base directory /blah/include For example, a file added to the file set as The directory structure relative to the file set's base directories is If the file set exists and is PUBLIC or INTERFACE, anyįiles in the set are installed under the destination (see below). (except on macOS when marked as MACOSX_BUNDLE, see BUNDLE below) ĭLLs (on all Windows-based systems including Cygwin note that theĪccompanying import libraries are of kind ARCHIVE).įile sets are defined by the target_sources(FILE_SET) command. On macOS when marked as FRAMEWORK (see below). On AIX, the linker import file created for executables with (on all Windows-based systems including Cygwin they have extension (except on macOS when marked as FRAMEWORK, see below) There are several kinds of target Output Artifacts The TARGETS form specifies rules for installing targets from a Release configurations, do the following: For example, to set separate install paths for the Debug and This option only apply to options listed AFTER the CONFIGURATIONS Specify a list of build configurations for which the install ruleĪpplies (Debug, Release, etc.). Not make sense on certain platforms are ignored on those platforms. GROUP_WRITE, GROUP_EXECUTE, WORLD_READ, WORLD_WRITE, OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, GROUP_READ, In particular, there is no need to make paths absolute by prependingĬMAKE_INSTALL_PREFIX this prefix is used by default if Generators, it is preferable to use relative paths throughout. If an absolute path (with a leading slash or drive letter) is givenĪs absolute paths are not supported by cpack installer Mechanism explained in the CMAKE_INSTALL_PREFIX variable The prefix can be relocated at install time using the DESTDIR If a relative path is given it is interpreted relative to the value

Specify the directory on disk to which a file will be installed.Īrguments can be relative or absolute paths. Multiple signatures are covered here but they are valid only for Installation options for files and targets. There are multiple signatures for this command. Changed in version 3.22: The environment variable CMAKE_INSTALL_MODE can override the
