Cmake Mac Os X

Configure generators for binary installers and source packages.

Cannot install CMake for Mac OS X 10.8. How to discover number of.logical. cores on Mac OS X? Find (and kill) process locking port 3000 on Mac. Who is listening on a given TCP port on Mac OS X? Bash: pip: command not found. How do I activate C 11 in CMake?


The CPack module generates the configuration files CPackConfig.cmakeand CPackSourceConfig.cmake. They are intended for use in a subsequentrun of the cpack program where they steer the generationof installers or/and source packages.

Depending on the CMake generator, the CPack module may also add two new buildtargets, package and package_source. See the packaging targetssection below for details.

The generated binary installers will contain all files that have been installedvia CMake's install() command (and the deprecated commandsinstall_files(), install_programs(), andinstall_targets()). Note that the DESTINATION option of theinstall() command must be a relative path; otherwise installed filesare ignored by CPack.

FontForge is a free (libre) font editor for Windows, Mac OS X and GNU+Linux. Use it to create, edit and convert fonts in OpenType, TrueType, UFO, CID-keyed, Multiple Master, and many other formats. — homepage. — font creation manual. The bug tracker is for reporting bugs, not for asking. The Mac OS X operating system also appears to come with a version of LAPACK, and the BLAS library upon which it depends. Neither the operating system nor XCode provide cmake, gfortran, or FFTW.

Certain kinds of binary installers can be configured such that users can selectindividual application components to install. See the CPackComponentmodule for further details.

Source packages (configured through CPackSourceConfig.cmake and generatedby the CPackArchiveGenerator) will contain all source files inthe project directory except those specified inCPACK_SOURCE_IGNORE_FILES.

CPack Generators¶

The CPACK_GENERATOR variable has different meanings in differentcontexts. In a CMakeLists.txt file, CPACK_GENERATOR is alist of generators: and when cpack is run with no otherarguments, it will iterate over that list and produce one package for eachgenerator. In a CPACK_PROJECT_CONFIG_FILE,CPACK_GENERATOR is a string naming a single generator. If youneed per-cpack-generator logic to control other cpack settings, then youneed a CPACK_PROJECT_CONFIG_FILE.If set, the CPACK_PROJECT_CONFIG_FILE is included automaticallyon a per-generator basis. It only need contain overrides.

Here's how it works:

Cmake Mac Os X
  • cpack runs

  • it includes CPackConfig.cmake

  • it iterates over the generators given by the -G command line option,or if no such option was specified, over the list of generators given bythe CPACK_GENERATOR variable set in the CPackConfig.cmakeinput file.

  • foreach generator, it then

    • sets CPACK_GENERATOR to the one currently being iterated

    • includes the CPACK_PROJECT_CONFIG_FILE

    • produces the package for that generator

This is the key: For each generator listed in CPACK_GENERATOR inCPackConfig.cmake, cpack will resetCPACK_GENERATORinternally to the one currently being used and then include theCPACK_PROJECT_CONFIG_FILE.

For a list of available generators, see cpack-generators(7).

Targets package and package_source¶

If CMake is run with the Makefile, Ninja, or Xcode generator, theninclude(CPack) generates a target package. This makes it possibleto build a binary installer from CMake, Make, or Ninja: Instead of cpack,one may call cmake--build.--targetpackage or makepackage orninjapackage. The VS generator creates an uppercase target PACKAGE.

If CMake is run with the Makefile or Ninja generator, then include(CPack)also generates a target package_source. To build a source package,instead of cpack-GTGZ--configCPackSourceConfig.cmake one may callcmake--build.--targetpackage_source, makepackage_source,or ninjapackage_source.

Variables common to all CPack Generators¶

Before including this CPack module in your CMakeLists.txt file, thereare a variety of variables that can be set to customize the resultinginstallers. The most commonly-used variables are:


The name of the package (or application). If not specified, it defaults tothe project name.


The name of the package vendor. (e.g., 'Kitware'). The default is 'Humanity'.


The directory in which CPack is doing its packaging. If it is not setthen this will default (internally) to the build dir. This variable maybe defined in a CPack config file or from the cpackcommand line option -B. If set, the command line option overrides thevalue found in the config file.


Package major version. This variable will always be set, but its defaultvalue depends on whether or not version details were given to theproject() command in the top level CMakeLists.txt file. If versiondetails were given, the default value will beCMAKE_PROJECT_VERSION_MAJOR. If no version details were given,a default version of 0.1.1 will be assumed, leading toCPACK_PACKAGE_VERSION_MAJOR having a default value of 0.


Package minor version. The default value is determined based on whether ornot version details were given to the project() command in the toplevel CMakeLists.txt file. If version details were given, the defaultvalue will be CMAKE_PROJECT_VERSION_MINOR, but if no minorversion component was specified then CPACK_PACKAGE_VERSION_MINOR will beleft unset. If no project version was given at all, a default version of0.1.1 will be assumed, leading to CPACK_PACKAGE_VERSION_MINOR having adefault value of 1.


Package patch version. The default value is determined based on whether ornot version details were given to the project() command in the toplevel CMakeLists.txt file. If version details were given, the defaultvalue will be CMAKE_PROJECT_VERSION_PATCH, but if no patchversion component was specified then CPACK_PACKAGE_VERSION_PATCH will beleft unset. If no project version was given at all, a default version of0.1.1 will be assumed, leading to CPACK_PACKAGE_VERSION_PATCH having adefault value of 1.


A description of the project, used in places such as the introductionscreen of CPack-generated Windows installers. If not set, the value ofthis variable is populated from the file named byCPACK_PACKAGE_DESCRIPTION_FILE.


A text file used to describe the project whenCPACK_PACKAGE_DESCRIPTION is not explicitly set. The defaultvalue for CPACK_PACKAGE_DESCRIPTION_FILE points to a built-in templatefile Templates/CPack.GenericDescription.txt.


Short description of the project (only a few words). If theCMAKE_PROJECT_DESCRIPTION variable is set, it is used as thedefault value, otherwise the default will be a string generated by CMakebased on CMAKE_PROJECT_NAME.


Project homepage URL. The default value is taken from theCMAKE_PROJECT_HOMEPAGE_URL variable, which is set by the toplevel project() command, or else the default will be empty if noURL was provided to project().


The name of the package file to generate, not including theextension. For example, cmake-2.6.1-Linux-i686. The default valueis:


Installation directory on the target system. This may be used by someCPack generators like NSIS to create an installation directory e.g.,'CMake 2.5' below the installation prefix. All installed elements will beput inside this directory.


A branding image that will be displayed inside the installer (used by GUIinstallers).


New in version 3.7.

An algorithm that will be used to generate an additional file with thechecksum of the package. The output file name will be:

Supported algorithms are those listed by thestring(<HASH>) command.


CPack-time project CPack configuration file. This file is included at cpacktime, once per generator after CPack has set CPACK_GENERATORto the actual generator being used. It allows per-generator setting ofCPACK_* variables at cpack time.


License to be embedded in the installer. It will typically be displayedto the user by the produced installer (often with an explicit 'Accept'button, for graphical installers) prior to installation. This licensefile is NOT added to the installed files but is used by some CPack generatorslike NSIS. If you want to install a license file (may be the same as thisone) along with your project, you must add an appropriate CMakeinstall() command in your CMakeLists.txt.


ReadMe file to be embedded in the installer. It typically describes insome detail the purpose of the project during the installation. Not allCPack generators use this file.


Welcome file to be embedded in the installer. It welcomes users to thisinstaller. Typically used in the graphical installers on Windows and MacOS X.


Disables the component-based installation mechanism. When set, thecomponent specification is ignored and all installed items are put in asingle 'MONOLITHIC' package. Some CPack generators do monolithicpackaging by default and may be asked to do component packaging bysetting CPACK_<GENNAME>_COMPONENT_INSTALL to TRUE.


List of CPack generators to use. If not specified, CPack will create aset of options following the naming pattern'>CPACK_BINARY_<GENNAME> (e.g. CPACK_BINARY_NSIS) allowingthe user to enable/disable individual generators. If the -G option isgiven on the cpack command line, it will override thisvariable and any CPACK_BINARY_<GENNAME> options.


The name of the CPack binary configuration file. This file is the CPackconfiguration generated by the CPack module for binary installers.Defaults to CPackConfig.cmake.


Lists each of the executables and associated text label to be used tocreate Start Menu shortcuts. For example, setting this to the listccmake;CMake will create a shortcut named 'CMake' that will execute theinstalled executable ccmake. Not all CPack generators use it (at leastNSIS, WIX and OSXX11 do).


List of files to be stripped. Starting with CMake 2.6.0,CPACK_STRIP_FILES will be a boolean variable which enablesstripping of all files (a list of files evaluates to TRUE in CMake,so this change is compatible).


New in version 3.4.

If set to TRUE, values of variables prefixed with CPACK_ will beescaped before being written to the configuration files, so that the cpackprogram receives them exactly as they were specified. If not, characterslike quotes and backslashes can cause parsing errors or alter the valuereceived by the cpack program. Defaults to FALSE for backwardscompatibility.


Number of threads to use when performing parallelized operations, suchas compressing the installer package.

Some compression methods used by CPack generators such as Debian or Archivemay take advantage of multiple CPU cores to speed up compression.CPACK_THREADS can be set to positive integer to specify how many threadswill be used for compression. If it is set to 0, CPack will set it so thatall available CPU cores are used.By default CPACK_THREADS is set to 1.

Currently only xz compression may take advantage of multiple cores. Othercompression methods ignore this value and use only one thread.


How To Make Mac Os X Into Windows 10

Official CMake binaries available on ship with a liblzmathat does not support parallel compression.

Variables for Source Package Generators¶

The following CPack variables are specific to source packages, andwill not affect binary packages:


The name of the source package. For example cmake-2.6.1.


List of files in the source tree that will be stripped. Starting withCMake 2.6.0, CPACK_SOURCE_STRIP_FILES will be a booleanvariable which enables stripping of all files (a list of files evaluatesto TRUE in CMake, so this change is compatible).


List of generators used for the source packages. As withCPACK_GENERATOR, if this is not specified then CPack willcreate a set of options (e.g. CPACK_SOURCE_ZIP) allowingusers to select which packages will be generated.


The name of the CPack source configuration file. This file is the CPackconfiguration generated by the CPack module for source installers.Defaults to CPackSourceConfig.cmake.


Cmake Mac Os X

Pattern of files in the source tree that won't be packaged when buildinga source package. This is a list of regular expression patterns (thatmust be properly escaped), e.g.,/CVS/;/.svn/;.swp$;.#;/#;.*~;cscope.*

Variables for Advanced Use¶

The following variables are for advanced uses of CPack:


What CMake generator should be used if the project is a CMakeproject. Defaults to the value of CMAKE_GENERATOR. Few userswill want to change this setting.


List of four values that specify what project to install. The four valuesare: Build directory, Project Name, Project Component, Directory. Ifomitted, CPack will build an installer that installs everything.


System name, defaults to the value of CMAKE_SYSTEM_NAME,except on Windows where it will be win32 or win64.


Package full version, used internally. By default, this is built fromCPACK_PACKAGE_VERSION_MAJOR,CPACK_PACKAGE_VERSION_MINOR, andCPACK_PACKAGE_VERSION_PATCH.


Directory for the installed files.


Extra commands to install components. The environment variableCMAKE_INSTALL_PREFIX is set to the temporary install directoryduring execution.


Extra CMake scripts executed by CPack during its local staginginstallation. They are executed before installing the files to be packaged.The scripts are not called by a standalone install (e.g.: makeinstall).For every script, the following variables will be set:CMAKE_CURRENT_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIRand CMAKE_INSTALL_PREFIX (which is set to the staging installdirectory). The singular form CMAKE_INSTALL_SCRIPT is supported asan alternative variable for historical reasons, but its value is ignored ifCMAKE_INSTALL_SCRIPTS is set and a warning will be issued.

See also CPACK_PRE_BUILD_SCRIPTS andCPACK_POST_BUILD_SCRIPTS which can be used to specify scriptsto be executed later in the packaging process.


New in version 3.19.

List of CMake scripts to execute after CPack has installed the files tobe packaged into a staging directory and before producing the package(s)from those files. See also CPACK_INSTALL_SCRIPTS andCPACK_POST_BUILD_SCRIPTS.


List of CMake scripts to execute after CPack has produced the resultantpackages and before copying them back to the build directory.See also CPACK_INSTALL_SCRIPTS,CPACK_PRE_BUILD_SCRIPTS and CPACK_PACKAGE_FILES.


New in version 3.19.

List of package files created in the staging directory, with each fileprovided as a full absolute path. This variable is populated by CPackjust before invoking the post-build scripts listed inCPACK_POST_BUILD_SCRIPTS. It is the preferred way for thepost-build scripts to know the set of package files to operate on.Projects should not try to set this variable themselves.


Extra directories to install.


Registry key used when installing this project. This is only used byinstallers for Windows. The default value is based on the installationdirectory.


List of desktop links to create. Each desktop link requires acorresponding start menu shortcut as created byCPACK_PACKAGE_EXECUTABLES.


CPack generated options for binary generators. The CPack.cmake modulegenerates (when CPACK_GENERATOR is not set) a set of CMakeoptions (see CMake option() command) which may then be used toselect the CPack generator(s) to be used when building the packagetarget or when running cpack without the -G option.