blob: bdbe251380599ef265832df8c40c863b61831323 [file] [log] [blame]
.\" Man page generated from reStructuredText.
.
.TH "CMAKE-MODULES" "7" "May 31, 2017" "3.8.2" "CMake"
.SH NAME
cmake-modules \- CMake Modules Reference
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH ALL MODULES
.SS AddFileDependencies
.sp
ADD_FILE_DEPENDENCIES(source_file depend_files...)
.sp
Adds the given files as dependencies to source_file
.SS AndroidTestUtilities
.sp
Create a test that automatically loads specified data onto an Android device.
.SS Introduction
.sp
Use this module to push data needed for testing an Android device behavior
onto a connected Android device. The module will accept files and libraries as
well as separate destinations for each. It will create a test that loads the
files into a device object store and link to them from the specified
destination. The files are only uploaded if they are not already in the object
store.
.sp
For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include(AndroidTestUtilities)
android_add_test_data(
example_setup_test
FILES <files>...
LIBS <libs>...
DEVICE_TEST_DIR "/data/local/tests/example"
DEVICE_OBJECT_STORE "/sdcard/.ExternalData/SHA"
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
At build time a test named "example_setup_test" will be created. Run this test
on the command line with \fBctest(1)\fP to load the data onto the Android
device.
.SS Module Functions
.INDENT 0.0
.TP
.B android_add_test_data
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
android_add_test_data(<test\-name>
[FILES <files>...] [FILES_DEST <device\-dir>]
[LIBS <libs>...] [LIBS_DEST <device\-dir>]
[DEVICE_OBJECT_STORE <device\-dir>]
[DEVICE_TEST_DIR <device\-dir>]
[NO_LINK_REGEX <strings>...]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBandroid_add_test_data\fP function is used to copy files and libraries
needed to run project\-specific tests. On the host operating system, this is
done at build time. For on\-device testing, the files are loaded onto the
device by the manufactured test at run time.
.sp
This function accepts the following named parameters:
.INDENT 7.0
.TP
.B \fBFILES <files>...\fP
zero or more files needed for testing
.TP
.B \fBLIBS <libs>...\fP
zero or more libraries needed for testing
.TP
.B \fBFILES_DEST <device\-dir>\fP
absolute path where the data files are expected to be
.TP
.B \fBLIBS_DEST <device\-dir>\fP
absolute path where the libraries are expected to be
.TP
.B \fBDEVICE_OBJECT_STORE <device\-dir>\fP
absolute path to the location where the data is stored on\-device
.TP
.B \fBDEVICE_TEST_DIR <device\-dir>\fP
absolute path to the root directory of the on\-device test location
.TP
.B \fBNO_LINK_REGEX <strings>...\fP
list of regex strings matching the names of files that should be
copied from the object store to the testing directory
.UNINDENT
.UNINDENT
.SS BundleUtilities
.sp
Functions to help assemble a standalone bundle application.
.sp
A collection of CMake utility functions useful for dealing with .app
bundles on the Mac and bundle\-like directories on any OS.
.sp
The following functions are provided by this module:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
fixup_bundle
copy_and_fixup_bundle
verify_app
get_bundle_main_executable
get_dotapp_dir
get_bundle_and_executable
get_bundle_all_executables
get_item_key
get_item_rpaths
clear_bundle_keys
set_bundle_key_values
get_bundle_keys
copy_resolved_item_into_bundle
copy_resolved_framework_into_bundle
fixup_bundle_item
verify_bundle_prerequisites
verify_bundle_symlinks
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Requires CMake 2.6 or greater because it uses function, break and
PARENT_SCOPE. Also depends on GetPrerequisites.cmake.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FIXUP_BUNDLE(<app> <libs> <dirs>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Fix up a bundle in\-place and make it standalone, such that it can be
drag\-n\-drop copied to another machine and run on that machine as long
as all of the system libraries are compatible.
.sp
If you pass plugins to fixup_bundle as the libs parameter, you should
install them or copy them into the bundle before calling fixup_bundle.
The "libs" parameter is a list of libraries that must be fixed up, but
that cannot be determined by otool output analysis. (i.e., plugins)
.sp
Gather all the keys for all the executables and libraries in a bundle,
and then, for each key, copy each prerequisite into the bundle. Then
fix each one up according to its own list of prerequisites.
.sp
Then clear all the keys and call verify_app on the final bundle to
ensure that it is truly standalone.
.sp
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Makes a copy of the bundle <src> at location <dst> and then fixes up
the new copied bundle in\-place at <dst>...
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
VERIFY_APP(<app>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Verifies that an application <app> appears valid based on running
analysis tools on it. Calls "message(FATAL_ERROR" if the application
is not verified.
.sp
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The result will be the full path name of the bundle\(aqs main executable
file or an "error:" prefixed string if it could not be determined.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Returns the nearest parent dir whose name ends with ".app" given the
full path to an executable. If there is no such parent dir, then
simply return the dir containing the executable.
.sp
The returned directory may or may not exist.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Takes either a ".app" directory name or the name of an executable
nested inside a ".app" directory and returns the path to the ".app"
directory in <bundle_var> and the path to its main executable in
<executable_var>
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Scans the given bundle recursively for all executable files and
accumulates them into a variable.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GET_ITEM_KEY(<item> <key_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Given a file (item) name, generate a key that should be unique
considering the set of libraries that need copying or fixing up to
make a bundle standalone. This is essentially the file name including
extension with "." replaced by "_"
.sp
This key is used as a prefix for CMake variables so that we can
associate a set of variables with a given item based on its key.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CLEAR_BUNDLE_KEYS(<keys_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Loop over the list of keys, clearing all the variables associated with
each key. After the loop, clear the list of keys itself.
.sp
Caller of get_bundle_keys should call clear_bundle_keys when done with
list of keys.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
<copyflag> [<rpaths>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Add a key to the list (if necessary) for the given item. If added,
also set all the variables associated with that key.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Loop over all the executable and library files within the bundle (and
given as extra <libs>) and accumulate a list of keys representing
them. Set values associated with each key such that we can loop over
all of them and copy prerequisite libs into the bundle and then do
appropriate install_name_tool fixups.
.sp
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Copy a resolved item into the bundle if necessary. Copy is not
necessary if the resolved_item is "the same as" the
resolved_embedded_item.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Copy a resolved framework into the bundle if necessary. Copy is not
necessary if the resolved_item is "the same as" the
resolved_embedded_item.
.sp
By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you want
full frameworks embedded in your bundles, set
BU_COPY_FULL_FRAMEWORK_CONTENTS to ON before calling fixup_bundle. By
default, COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the framework
dylib itself plus the framework Resources directory.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Get the direct/non\-system prerequisites of the resolved embedded item.
For each prerequisite, change the way it is referenced to the value of
the _EMBEDDED_ITEM keyed variable for that prerequisite. (Most likely
changing to an "@executable_path" style reference.)
.sp
This function requires that the resolved_embedded_item be "inside" the
bundle already. In other words, if you pass plugins to fixup_bundle
as the libs parameter, you should install them or copy them into the
bundle before calling fixup_bundle. The "libs" parameter is a list of
libraries that must be fixed up, but that cannot be determined by
otool output analysis. (i.e., plugins)
.sp
Also, change the id of the item being fixed up to its own
_EMBEDDED_ITEM value.
.sp
Accumulate changes in a local variable and make \fIone\fP call to
install_name_tool at the end of the function with all the changes at
once.
.sp
If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items will be
marked writable before install_name_tool tries to change them.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Verifies that the sum of all prerequisites of all files inside the
bundle are contained within the bundle or are "system" libraries,
presumed to exist everywhere.
.sp
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Verifies that any symlinks found in the bundle point to other files
that are already also in the bundle... Anything that points to an
external file causes this function to fail the verification.
.SS CheckCCompilerFlag
.sp
Check whether the C compiler supports a given flag.
.sp
CHECK_C_COMPILER_FLAG(<flag> <var>)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<flag> \- the compiler flag
<var> \- variable to store the result
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This internally calls the check_c_source_compiles macro and sets
CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for
CheckCSourceCompiles for a listing of variables that can otherwise
modify the build. The result only tells that the compiler does not
give an error message when it encounters the flag. If the flag has
any effect or even a specific one is beyond the scope of this module.
.SS CheckCSourceCompiles
.sp
Check if given C source compiles and links into an executable
.sp
CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail\-regex>])
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<code> \- source code to try to compile, must define \(aqmain\(aq
<var> \- variable to store whether the source code compiled
Will be created as an internal cache variable.
<fail\-regex> \- fail if test output matches this regex
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckCSourceRuns
.sp
Check if the given C source code compiles and runs.
.sp
CHECK_C_SOURCE_RUNS(<code> <var>)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<code> \- source code to try to compile
<var> \- variable to store the result
(1 for success, empty for failure)
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckCXXCompilerFlag
.sp
Check whether the CXX compiler supports a given flag.
.sp
CHECK_CXX_COMPILER_FLAG(<flag> <var>)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<flag> \- the compiler flag
<var> \- variable to store the result
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This internally calls the check_cxx_source_compiles macro and sets
CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for
CheckCXXSourceCompiles for a listing of variables that can otherwise
modify the build. The result only tells that the compiler does not
give an error message when it encounters the flag. If the flag has
any effect or even a specific one is beyond the scope of this module.
.SS CheckCXXSourceCompiles
.sp
Check if given C++ source compiles and links into an executable
.sp
CHECK_CXX_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail\-regex>])
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<code> \- source code to try to compile, must define \(aqmain\(aq
<var> \- variable to store whether the source code compiled
Will be created as an internal cache variable.
<fail\-regex> \- fail if test output matches this regex
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckCXXSourceRuns
.sp
Check if the given C++ source code compiles and runs.
.sp
CHECK_CXX_SOURCE_RUNS(<code> <var>)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<code> \- source code to try to compile
<var> \- variable to store the result
(1 for success, empty for failure)
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckCXXSymbolExists
.sp
Check if a symbol exists as a function, variable, or macro in C++
.sp
CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
.sp
Check that the <symbol> is available after including given header
<files> and store the result in a <variable>. Specify the list of
files in one argument as a semicolon\-separated list.
CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as
opposed to CHECK_SYMBOL_EXISTS(), which works only for C.
.sp
If the header files define the symbol as a macro it is considered
available and assumed to work. If the header files declare the symbol
as a function or variable then the symbol must also be available for
linking. If the symbol is a type or enum value it will not be
recognized (consider using CheckTypeSize or CheckCSourceCompiles).
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckFortranCompilerFlag
.sp
Check whether the Fortran compiler supports a given flag.
.sp
CHECK_Fortran_COMPILER_FLAG(<flag> <var>)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<flag> \- the compiler flag
<var> \- variable to store the result
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This internally calls the check_fortran_source_compiles macro and
sets CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for
CheckFortranSourceCompiles for a listing of variables that can
otherwise modify the build. The result only tells that the compiler
does not give an error message when it encounters the flag. If the
flag has any effect or even a specific one is beyond the scope of
this module.
.SS CheckFortranFunctionExists
.sp
macro which checks if the Fortran function exists
.sp
CHECK_FORTRAN_FUNCTION_EXISTS(FUNCTION VARIABLE)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FUNCTION \- the name of the Fortran function
VARIABLE \- variable to store the result
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckFortranSourceCompiles
.sp
Check if given Fortran source compiles and links into an executable:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_Fortran_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail\-regex>]
[SRC_EXT <ext>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The arguments are:
.INDENT 0.0
.TP
.B \fB<code>\fP
Source code to try to compile. It must define a PROGRAM entry point.
.TP
.B \fB<var>\fP
Variable to store whether the source code compiled.
Will be created as an internal cache variable.
.TP
.B \fBFAIL_REGEX <fail\-regex>\fP
Fail if test output matches this regex.
.TP
.B \fBSRC_EXT <ext>\fP
Use source extension \fB\&.<ext>\fP instead of the default \fB\&.F\fP\&.
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckFunctionExists
.sp
Check if a C function can be linked:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
check_function_exists(<function> <variable>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Check that the \fB<function>\fP is provided by libraries on the system and store
the result in a \fB<variable>\fP\&. \fB<variable>\fP will be created as an internal
cache variable.
.sp
The following variables may be set before calling this macro to modify the
way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Prefer using \fBCheckSymbolExists\fP instead of this module,
for the following reasons:
.INDENT 0.0
.IP \(bu 2
\fBcheck_function_exists()\fP can\(aqt detect functions that are inlined
in headers or specified as a macro.
.IP \(bu 2
\fBcheck_function_exists()\fP can\(aqt detect anything in the 32\-bit
versions of the Win32 API, because of a mismatch in calling conventions.
.IP \(bu 2
\fBcheck_function_exists()\fP only verifies linking, it does not verify
that the function is declared in system headers.
.UNINDENT
.UNINDENT
.UNINDENT
.SS CheckIncludeFileCXX
.sp
Provides a macro to check if a header file can be included in \fBCXX\fP\&.
.INDENT 0.0
.TP
.B CHECK_INCLUDE_FILE_CXX
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_INCLUDE_FILE_CXX(<include> <variable> [<flags>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Check if the given \fB<include>\fP file may be included in a \fBCXX\fP
source file and store the result in an internal cache entry named
\fB<variable>\fP\&. The optional third argument may be used to add
compilation flags to the check (or use \fBCMAKE_REQUIRED_FLAGS\fP below).
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.TP
.B \fBCMAKE_REQUIRED_FLAGS\fP
string of compile command line flags
.TP
.B \fBCMAKE_REQUIRED_DEFINITIONS\fP
list of macros to define (\-DFOO=bar)
.TP
.B \fBCMAKE_REQUIRED_INCLUDES\fP
list of include directories
.TP
.B \fBCMAKE_REQUIRED_QUIET\fP
execute quietly without messages
.UNINDENT
.sp
See modules \fBCheckIncludeFile\fP and \fBCheckIncludeFiles\fP
to check for one or more \fBC\fP headers.
.SS CheckIncludeFile
.sp
Provides a macro to check if a header file can be included in \fBC\fP\&.
.INDENT 0.0
.TP
.B CHECK_INCLUDE_FILE
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_INCLUDE_FILE(<include> <variable> [<flags>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Check if the given \fB<include>\fP file may be included in a \fBC\fP
source file and store the result in an internal cache entry named
\fB<variable>\fP\&. The optional third argument may be used to add
compilation flags to the check (or use \fBCMAKE_REQUIRED_FLAGS\fP below).
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.TP
.B \fBCMAKE_REQUIRED_FLAGS\fP
string of compile command line flags
.TP
.B \fBCMAKE_REQUIRED_DEFINITIONS\fP
list of macros to define (\-DFOO=bar)
.TP
.B \fBCMAKE_REQUIRED_INCLUDES\fP
list of include directories
.TP
.B \fBCMAKE_REQUIRED_QUIET\fP
execute quietly without messages
.UNINDENT
.sp
See the \fBCheckIncludeFiles\fP module to check for multiple headers
at once. See the \fBCheckIncludeFileCXX\fP module to check for headers
using the \fBCXX\fP language.
.SS CheckIncludeFiles
.sp
Provides a macro to check if a list of one or more header files can
be included together in \fBC\fP\&.
.INDENT 0.0
.TP
.B CHECK_INCLUDE_FILES
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_INCLUDE_FILES("<includes>" <variable>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Check if the given \fB<includes>\fP list may be included together
in a \fBC\fP source file and store the result in an internal cache
entry named \fB<variable>\fP\&. Specify the \fB<includes>\fP argument
as a ;\-list of header file names.
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.TP
.B \fBCMAKE_REQUIRED_FLAGS\fP
string of compile command line flags
.TP
.B \fBCMAKE_REQUIRED_DEFINITIONS\fP
list of macros to define (\-DFOO=bar)
.TP
.B \fBCMAKE_REQUIRED_INCLUDES\fP
list of include directories
.TP
.B \fBCMAKE_REQUIRED_QUIET\fP
execute quietly without messages
.UNINDENT
.sp
See modules \fBCheckIncludeFile\fP and \fBCheckIncludeFileCXX\fP
to check for a single header file in \fBC\fP or \fBCXX\fP languages.
.SS CheckLanguage
.sp
Check if a language can be enabled
.sp
Usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
check_language(<lang>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
where <lang> is a language that may be passed to enable_language()
such as "Fortran". If CMAKE_<lang>_COMPILER is already defined the
check does nothing. Otherwise it tries enabling the language in a
test project. The result is cached in CMAKE_<lang>_COMPILER as the
compiler that was found, or NOTFOUND if the language cannot be
enabled.
.sp
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
else()
message(STATUS "No Fortran support")
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckLibraryExists
.sp
Check if the function exists.
.sp
CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LIBRARY \- the name of the library you are looking for
FUNCTION \- the name of the function
LOCATION \- location where the library should be found
VARIABLE \- variable to store the result
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckPrototypeDefinition
.sp
Check if the protoype we expect is correct.
.sp
check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FUNCTION \- The name of the function (used to check if prototype exists)
PROTOTYPE\- The prototype to check.
RETURN \- The return value of the function.
HEADER \- The header files required.
VARIABLE \- The variable to store the result.
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
check_prototype_definition(getpwent_r
"struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
"NULL"
"unistd.h;pwd.h"
SOLARIS_GETPWENT_R)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckStructHasMember
.sp
Check if the given struct or class has the specified member variable
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable>
[LANGUAGE <language>])
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<struct> \- the name of the struct or class you are interested in
<member> \- the member which existence you want to check
<header> \- the header(s) where the prototype should be declared
<variable> \- variable to store the result
<language> \- the compiler to use (C or CXX)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec sys/select.h
HAVE_TIMEVAL_TV_SEC LANGUAGE C)
.SS CheckSymbolExists
.sp
Check if a symbol exists as a function, variable, or macro
.sp
CHECK_SYMBOL_EXISTS(<symbol> <files> <variable>)
.sp
Check that the <symbol> is available after including given header
<files> and store the result in a <variable>. Specify the list of
files in one argument as a semicolon\-separated list.
<variable> will be created as an internal cache variable.
.sp
If the header files define the symbol as a macro it is considered
available and assumed to work. If the header files declare the symbol
as a function or variable then the symbol must also be available for
linking. If the symbol is a type or enum value it will not be
recognized (consider using CheckTypeSize or CheckCSourceCompiles). If
the check needs to be done in C++, consider using
CHECK_CXX_SYMBOL_EXISTS(), which does the same as
CHECK_SYMBOL_EXISTS(), but in C++.
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckTypeSize
.sp
Check sizeof a type
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
[LANGUAGE <language>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Check if the type exists and determine its size. On return,
"HAVE_${VARIABLE}" holds the existence of the type, and "${VARIABLE}"
holds one of the following:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<size> = type has non\-zero size <size>
"0" = type has arch\-dependent size (see below)
"" = type does not exist
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Both \fBHAVE_${VARIABLE}\fP and \fB${VARIABLE}\fP will be created as internal
cache variables.
.sp
Furthermore, the variable "${VARIABLE}_CODE" holds C preprocessor code
to define the macro "${VARIABLE}" to the size of the type, or leave
the macro undefined if the type does not exist.
.sp
The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITECTURES has
multiple architectures for building OS X universal binaries. This
indicates that the type size varies across architectures. In this
case "${VARIABLE}_CODE" contains C preprocessor tests mapping from
each architecture macro to the corresponding type size. The list of
architecture macros is stored in "${VARIABLE}_KEYS", and the value for
each key is stored in "${VARIABLE}\-${KEY}".
.sp
If the BUILTIN_TYPES_ONLY option is not given, the macro checks for
headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves results
in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H. The type size
check automatically includes the available headers, thus supporting
checks of types defined in the headers.
.sp
If LANGUAGE is set, the specified compiler will be used to perform the
check. Acceptable values are C and CXX
.sp
Despite the name of the macro you may use it to check the size of more
complex expressions, too. To check e.g. for the size of a struct
member you can do something like this:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
check_type_size("((struct something*)0)\->member" SIZEOF_MEMBER)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CheckVariableExists
.sp
Check if the variable exists.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_VARIABLE_EXISTS(VAR VARIABLE)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
VAR \- the name of the variable
VARIABLE \- variable to store the result
Will be created as an internal cache variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This macro is only for C variables.
.sp
The following variables may be set before calling this macro to modify
the way the check is run:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (\-DFOO=bar)
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
CMAKE_REQUIRED_QUIET = execute quietly without messages
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeAddFortranSubdirectory
.sp
Use MinGW gfortran from VS if a fortran compiler is not found.
.sp
The \(aqadd_fortran_subdirectory\(aq function adds a subdirectory to a
project that contains a fortran only sub\-project. The module will
check the current compiler and see if it can support fortran. If no
fortran compiler is found and the compiler is MSVC, then this module
will find the MinGW gfortran. It will then use an external project to
build with the MinGW tools. It will also create imported targets for
the libraries created. This will only work if the fortran code is
built into a dll, so BUILD_SHARED_LIBS is turned on in the project.
In addition the CMAKE_GNUtoMS option is set to on, so that the MS .lib
files are created. Usage is as follows:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cmake_add_fortran_subdirectory(
<subdir> # name of subdirectory
PROJECT <project_name> # project name in subdir top CMakeLists.txt
ARCHIVE_DIR <dir> # dir where project places .lib files
RUNTIME_DIR <dir> # dir where project places .dll files
LIBRARIES <lib>... # names of library targets to import
LINK_LIBRARIES # link interface libraries for LIBRARIES
[LINK_LIBS <lib> <dep>...]...
CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
NO_EXTERNAL_INSTALL # skip installation of external project
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with
respect to the build directory corresponding to the source directory
in which the function is invoked.
.sp
Limitations:
.sp
NO_EXTERNAL_INSTALL is required for forward compatibility with a
future version that supports installation of the external project
binaries during "make install".
.SS CMakeBackwardCompatibilityCXX
.sp
define a bunch of backwards compatibility variables
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_ANSI_CXXFLAGS \- flag for ansi c++
CMAKE_HAS_ANSI_STRING_STREAM \- has <strstream>
include(TestForANSIStreamHeaders)
include(CheckIncludeFileCXX)
include(TestForSTDNamespace)
include(TestForANSIForScope)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeDependentOption
.sp
Macro to provide an option dependent on other options.
.sp
This macro presents an option to the user only if a set of other
conditions are true. When the option is not presented a default value
is used, but any value set by the user is preserved for when the
option is presented again. Example invocation:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
"USE_BAR;NOT USE_ZOT" OFF)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If USE_BAR is true and USE_ZOT is false, this provides an option
called USE_FOO that defaults to ON. Otherwise, it sets USE_FOO to
OFF. If the status of USE_BAR or USE_ZOT ever changes, any value for
the USE_FOO option is saved so that when the option is re\-enabled it
retains its old value.
.SS CMakeDetermineVSServicePack
.sp
Deprecated. Do not use.
.sp
The functionality of this module has been superseded by the
\fBCMAKE_<LANG>_COMPILER_VERSION\fP variable that contains
the compiler version number.
.sp
Determine the Visual Studio service pack of the \(aqcl\(aq in use.
.sp
Usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
if(MSVC)
include(CMakeDetermineVSServicePack)
DetermineVSServicePack( my_service_pack )
if( my_service_pack )
message(STATUS "Detected: ${my_service_pack}")
endif()
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Function DetermineVSServicePack sets the given variable to one of the
following values or an empty string if unknown:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
vc80, vc80sp1
vc90, vc90sp1
vc100, vc100sp1
vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeExpandImportedTargets
.sp
Deprecated. Do not use.
.sp
This module was once needed to expand imported targets to the underlying
libraries they reference on disk for use with the \fBtry_compile()\fP
and \fBtry_run()\fP commands. These commands now support imported
libraries in their \fBLINK_LIBRARIES\fP options (since CMake 2.8.11
for \fBtry_compile()\fP and since CMake 3.2 for \fBtry_run()\fP).
.sp
This module does not support the policy \fBCMP0022\fP \fBNEW\fP
behavior or use of the \fBINTERFACE_LINK_LIBRARIES\fP property
because \fBgenerator expressions\fP
cannot be evaluated during configuration.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
[CONFIGURATION <config>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
all imported targets contained in this list with their actual file
paths of the referenced libraries on disk, including the libraries
from their link interfaces. If a CONFIGURATION is given, it uses the
respective configuration of the imported targets if it exists. If no
CONFIGURATION is given, it uses the first configuration from
${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cmake_expand_imported_targets(expandedLibs
LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeFindDependencyMacro
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_dependency(<dep> [<version> [EXACT]])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBfind_dependency()\fP wraps a \fBfind_package()\fP call for a package
dependency. It is designed to be used in a <package>Config.cmake file, and it
forwards the correct parameters for EXACT, QUIET and REQUIRED which were
passed to the original \fBfind_package()\fP call. It also sets an
informative diagnostic message if the dependency could not be found.
.SS CMakeFindFrameworks
.sp
helper module to find OSX frameworks
.sp
This module reads hints about search locations from variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS \- Extra directories
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeFindPackageMode
.sp
This file is executed by cmake when invoked with \-\-find\-package. It
expects that the following variables are set using \-D:
.INDENT 0.0
.TP
.B \fBNAME\fP
name of the package
.TP
.B \fBCOMPILER_ID\fP
the CMake compiler ID for which the result is,
i.e. GNU/Intel/Clang/MSVC, etc.
.TP
.B \fBLANGUAGE\fP
language for which the result will be used,
i.e. C/CXX/Fortan/ASM
.TP
.B \fBMODE\fP
.INDENT 7.0
.TP
.B \fBEXIST\fP
only check for existence of the given package
.TP
.B \fBCOMPILE\fP
print the flags needed for compiling an object file which uses
the given package
.TP
.B \fBLINK\fP
print the flags needed for linking when using the given package
.UNINDENT
.TP
.B \fBQUIET\fP
if TRUE, don\(aqt print anything
.UNINDENT
.SS CMakeForceCompiler
.sp
Deprecated. Do not use.
.sp
The macros provided by this module were once intended for use by
cross\-compiling toolchain files when CMake was not able to automatically
detect the compiler identification. Since the introduction of this module,
CMake\(aqs compiler identification capabilities have improved and can now be
taught to recognize any compiler. Furthermore, the suite of information
CMake detects from a compiler is now too extensive to be provided by
toolchain files using these macros.
.sp
One common use case for this module was to skip CMake\(aqs checks for a
working compiler when using a cross\-compiler that cannot link binaries
without special flags or custom linker scripts. This case is now supported
by setting the \fBCMAKE_TRY_COMPILE_TARGET_TYPE\fP variable in the
toolchain file instead.
.sp
.ce
----
.ce 0
.sp
.sp
Macro CMAKE_FORCE_C_COMPILER has the following signature:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_FORCE_C_COMPILER(<compiler> <compiler\-id>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It sets CMAKE_C_COMPILER to the given compiler and the cmake internal
variable CMAKE_C_COMPILER_ID to the given compiler\-id. It also
bypasses the check for working compiler and basic compiler information
tests.
.sp
Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler\-id>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
internal variable CMAKE_CXX_COMPILER_ID to the given compiler\-id. It
also bypasses the check for working compiler and basic compiler
information tests.
.sp
Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler\-id>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It sets CMAKE_Fortran_COMPILER to the given compiler and the cmake
internal variable CMAKE_Fortran_COMPILER_ID to the given compiler\-id.
It also bypasses the check for working compiler and basic compiler
information tests.
.sp
So a simple toolchain file could look like this:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include (CMakeForceCompiler)
set(CMAKE_SYSTEM_NAME Generic)
CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeGraphVizOptions
.sp
The builtin graphviz support of CMake.
.SS Variables specific to the graphviz support
.sp
CMake
can generate graphviz files, showing the dependencies between the
targets in a project and also external libraries which are linked
against. When CMake is run with the \-\-graphviz=foo.dot option, it will
produce:
.INDENT 0.0
.IP \(bu 2
a foo.dot file showing all dependencies in the project
.IP \(bu 2
a foo.dot.<target> file for each target, file showing on which other targets the respective target depends
.IP \(bu 2
a foo.dot.<target>.dependers file, showing which other targets depend on the respective target
.UNINDENT
.sp
This can result in huge graphs. Using the file
CMakeGraphVizOptions.cmake the look and content of the generated
graphs can be influenced. This file is searched first in
${CMAKE_BINARY_DIR} and then in ${CMAKE_SOURCE_DIR}. If found, it is
read and the variables set in it are used to adjust options for the
generated graphviz files.
.INDENT 0.0
.TP
.B GRAPHVIZ_GRAPH_TYPE
The graph type.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : "digraph"
.UNINDENT
.sp
Valid graph types are:
.INDENT 7.0
.IP \(bu 2
"graph" : Nodes are joined with lines
.IP \(bu 2
"digraph" : Nodes are joined with arrows showing direction
.IP \(bu 2
"strict graph" : Like "graph" but max one line between each node
.IP \(bu 2
"strict digraph" : Like "graph" but max one line between each node in each direction
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_GRAPH_NAME
The graph name.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : "GG"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_GRAPH_HEADER
The header written at the top of the graphviz file.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : "node [n fontsize = "12"];"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_NODE_PREFIX
The prefix for each node in the graphviz file.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : "node"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_EXECUTABLES
Set this to FALSE to exclude executables from the generated graphs.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : TRUE
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_STATIC_LIBS
Set this to FALSE to exclude static libraries from the generated graphs.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : TRUE
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_SHARED_LIBS
Set this to FALSE to exclude shared libraries from the generated graphs.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : TRUE
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_MODULE_LIBS
Set this to FALSE to exclude module libraries from the generated graphs.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : TRUE
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_EXTERNAL_LIBS
Set this to FALSE to exclude external libraries from the generated graphs.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : TRUE
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_IGNORE_TARGETS
A list of regular expressions for ignoring targets.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : empty
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_GENERATE_PER_TARGET
Set this to FALSE to exclude per target graphs \fBfoo.dot.<target>\fP\&.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : TRUE
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B GRAPHVIZ_GENERATE_DEPENDERS
Set this to FALSE to exclude depender graphs \fBfoo.dot.<target>.dependers\fP\&.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : TRUE
.UNINDENT
.UNINDENT
.SS CMakePackageConfigHelpers
.sp
Helpers functions for creating config files that can be included by other
projects to find and use a package.
.sp
Adds the \fI\%configure_package_config_file()\fP and
\fI\%write_basic_package_version_file()\fP commands.
.SS Generating a Package Configuration File
.INDENT 0.0
.TP
.B configure_package_config_file
Create a config file for a project:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
configure_package_config_file(<input> <output>
INSTALL_DESTINATION <path>
[PATH_VARS <var1> <var2> ... <varN>]
[NO_SET_AND_CHECK_MACRO]
[NO_CHECK_REQUIRED_COMPONENTS_MACRO]
[INSTALL_PREFIX <path>]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.sp
\fBconfigure_package_config_file()\fP should be used instead of the plain
\fBconfigure_file()\fP command when creating the \fB<Name>Config.cmake\fP
or \fB<Name>\-config.cmake\fP file for installing a project or library. It helps
making the resulting package relocatable by avoiding hardcoded paths in the
installed \fBConfig.cmake\fP file.
.sp
In a \fBFooConfig.cmake\fP file there may be code like this to make the install
destinations know to the using project:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
#...logic to determine installedPrefix from the own location...
set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
All 4 options shown above are not sufficient, since the first 3 hardcode the
absolute directory locations, and the 4th case works only if the logic to
determine the \fBinstalledPrefix\fP is correct, and if \fBCONFIG_INSTALL_DIR\fP
contains a relative path, which in general cannot be guaranteed. This has the
effect that the resulting \fBFooConfig.cmake\fP file would work poorly under
Windows and OSX, where users are used to choose the install location of a
binary package at install time, independent from how
\fBCMAKE_INSTALL_PREFIX\fP was set at build/cmake time.
.sp
Using \fBconfigure_package_config_file\fP helps. If used correctly, it makes
the resulting \fBFooConfig.cmake\fP file relocatable. Usage:
.INDENT 0.0
.IP 1. 3
write a \fBFooConfig.cmake.in\fP file as you are used to
.IP 2. 3
insert a line containing only the string \fB@PACKAGE_INIT@\fP
.IP 3. 3
instead of \fBset(FOO_DIR "@SOME_INSTALL_DIR@")\fP, use
\fBset(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")\fP (this must be after the
\fB@PACKAGE_INIT@\fP line)
.IP 4. 3
instead of using the normal \fBconfigure_file()\fP, use
\fBconfigure_package_config_file()\fP
.UNINDENT
.sp
The \fB<input>\fP and \fB<output>\fP arguments are the input and output file, the
same way as in \fBconfigure_file()\fP\&.
.sp
The \fB<path>\fP given to \fBINSTALL_DESTINATION\fP must be the destination where
the \fBFooConfig.cmake\fP file will be installed to. This path can either be
absolute, or relative to the \fBINSTALL_PREFIX\fP path.
.sp
The variables \fB<var1>\fP to \fB<varN>\fP given as \fBPATH_VARS\fP are the
variables which contain install destinations. For each of them the macro will
create a helper variable \fBPACKAGE_<var...>\fP\&. These helper variables must be
used in the \fBFooConfig.cmake.in\fP file for setting the installed location.
They are calculated by \fBconfigure_package_config_file\fP so that they are
always relative to the installed location of the package. This works both for
relative and also for absolute locations. For absolute locations it works
only if the absolute location is a subdirectory of \fBINSTALL_PREFIX\fP\&.
.sp
If the \fBINSTALL_PREFIX\fP argument is passed, this is used as base path to
calculate all the relative paths. The \fB<path>\fP argument must be an absolute
path. If this argument is not passed, the \fBCMAKE_INSTALL_PREFIX\fP
variable will be used instead. The default value is good when generating a
FooConfig.cmake file to use your package from the install tree. When
generating a FooConfig.cmake file to use your package from the build tree this
option should be used.
.sp
By default \fBconfigure_package_config_file\fP also generates two helper macros,
\fBset_and_check()\fP and \fBcheck_required_components()\fP into the
\fBFooConfig.cmake\fP file.
.sp
\fBset_and_check()\fP should be used instead of the normal \fBset()\fP command for
setting directories and file locations. Additionally to setting the variable
it also checks that the referenced file or directory actually exists and fails
with a \fBFATAL_ERROR\fP otherwise. This makes sure that the created
\fBFooConfig.cmake\fP file does not contain wrong references.
When using the \fBNO_SET_AND_CHECK_MACRO\fP, this macro is not generated
into the \fBFooConfig.cmake\fP file.
.sp
\fBcheck_required_components(<package_name>)\fP should be called at the end of
the \fBFooConfig.cmake\fP file if the package supports components. This macro
checks whether all requested, non\-optional components have been found, and if
this is not the case, sets the \fBFoo_FOUND\fP variable to \fBFALSE\fP, so that
the package is considered to be not found. It does that by testing the
\fBFoo_<Component>_FOUND\fP variables for all requested required components.
When using the \fBNO_CHECK_REQUIRED_COMPONENTS_MACRO\fP option, this macro is
not generated into the \fBFooConfig.cmake\fP file.
.sp
For an example see below the documentation for
\fI\%write_basic_package_version_file()\fP\&.
.SS Generating a Package Version File
.INDENT 0.0
.TP
.B write_basic_package_version_file
Create a version file for a project:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
write_basic_package_version_file(<filename>
[VERSION <major.minor.patch>]
COMPATIBILITY <AnyNewerVersion|SameMajorVersion|ExactVersion> )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Writes a file for use as \fB<package>ConfigVersion.cmake\fP file to
\fB<filename>\fP\&. See the documentation of \fBfind_package()\fP for
details on this.
.sp
\fB<filename>\fP is the output filename, it should be in the build tree.
\fB<major.minor.patch>\fP is the version number of the project to be installed.
.sp
If no \fBVERSION\fP is given, the \fBPROJECT_VERSION\fP variable is used.
If this hasn\(aqt been set, it errors out.
.sp
The \fBCOMPATIBILITY\fP mode \fBAnyNewerVersion\fP means that the installed
package version will be considered compatible if it is newer or exactly the
same as the requested version. This mode should be used for packages which
are fully backward compatible, also across major versions.
If \fBSameMajorVersion\fP is used instead, then the behaviour differs from
\fBAnyNewerVersion\fP in that the major version number must be the same as
requested, e.g. version 2.0 will not be considered compatible if 1.0 is
requested. This mode should be used for packages which guarantee backward
compatibility within the same major version.
If \fBExactVersion\fP is used, then the package is only considered compatible if
the requested version matches exactly its own version number (not considering
the tweak version). For example, version 1.2.3 of a package is only
considered compatible to requested version 1.2.3. This mode is for packages
without compatibility guarantees.
If your project has more elaborated version matching rules, you will need to
write your own custom \fBConfigVersion.cmake\fP file instead of using this
macro.
.sp
Internally, this macro executes \fBconfigure_file()\fP to create the
resulting version file. Depending on the \fBCOMPATIBLITY\fP, either the file
\fBBasicConfigVersion\-SameMajorVersion.cmake.in\fP or
\fBBasicConfigVersion\-AnyNewerVersion.cmake.in\fP is used. Please note that
these two files are internal to CMake and you should not call
\fBconfigure_file()\fP on them yourself, but they can be used as starting
point to create more sophisticted custom \fBConfigVersion.cmake\fP files.
.SS Example Generating Package Files
.sp
Example using both \fI\%configure_package_config_file()\fP and
\fBwrite_basic_package_version_file()\fP:
.sp
\fBCMakeLists.txt\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(INCLUDE_INSTALL_DIR include/ ... CACHE )
set(LIB_INSTALL_DIR lib/ ... CACHE )
set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
#...
include(CMakePackageConfigHelpers)
configure_package_config_file(FooConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
VERSION 1.2.3
COMPATIBILITY SameMajorVersion )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBFooConfig.cmake.in\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(FOO_VERSION x.y.z)
\&...
@PACKAGE_INIT@
\&...
set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
check_required_components(Foo)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeParseArguments
.sp
This module once implemented the \fBcmake_parse_arguments()\fP command
that is now implemented natively by CMake. It is now an empty placeholder
for compatibility with projects that include it to get the command from
CMake 3.4 and lower.
.SS CMakePrintHelpers
.sp
Convenience macros for printing properties and variables, useful e.g. for debugging.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_PRINT_PROPERTIES([TARGETS target1 .. targetN]
[SOURCES source1 .. sourceN]
[DIRECTORIES dir1 .. dirN]
[TESTS test1 .. testN]
[CACHE_ENTRIES entry1 .. entryN]
PROPERTIES prop1 .. propN )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This macro prints the values of the properties of the given targets,
source files, directories, tests or cache entries. Exactly one of the
scope keywords must be used. Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cmake_print_properties(TARGETS foo bar PROPERTIES
LOCATION INTERFACE_INCLUDE_DIRS)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for
both targets foo and bar.
.sp
CMAKE_PRINT_VARIABLES(var1 var2 .. varN)
.sp
This macro will print the name of each variable followed by its value.
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION DOES_NOT_EXIST)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Gives:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
\-\- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; DOES_NOT_EXIST=""
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakePrintSystemInformation
.sp
print system information
.sp
This file can be used for diagnostic purposes just include it in a
project to see various internal CMake variables.
.SS CMakePushCheckState
.sp
This module defines three macros: CMAKE_PUSH_CHECK_STATE()
CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These macros can
be used to save, restore and reset (i.e., clear contents) the state of
the variables CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS,
CMAKE_REQUIRED_LIBRARIES, CMAKE_REQUIRED_INCLUDES and CMAKE_EXTRA_INCLUDE_FILES
used by the various Check\-files coming with CMake, like e.g.
check_function_exists() etc. The variable contents are pushed on a
stack, pushing multiple times is supported. This is useful e.g. when
executing such tests in a Find\-module, where they have to be set, but
after the Find\-module has been executed they should have the same
value as they had before.
.sp
CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET.
Whether it\(aqs specified, CMAKE_PUSH_CHECK_STATE() will set all
CMAKE_REQUIRED_* variables to empty values, same as
CMAKE_RESET_CHECK_STATE() call will do.
.sp
Usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_DEFINITIONS \-DSOME_MORE_DEF)
check_function_exists(...)
cmake_reset_check_state()
set(CMAKE_REQUIRED_DEFINITIONS \-DANOTHER_DEF)
check_function_exists(...)
cmake_pop_check_state()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS CMakeVerifyManifest
.sp
CMakeVerifyManifest.cmake
.sp
This script is used to verify that embedded manifests and side by side
manifests for a project match. To run this script, cd to a directory
and run the script with cmake \-P. On the command line you can pass in
versions that are OK even if not found in the .manifest files. For
example, cmake \-Dallow_versions=8.0.50608.0
\-PCmakeVerifyManifest.cmake could be used to allow an embedded manifest
of 8.0.50608.0 to be used in a project even if that version was not
found in the .manifest file.
.SS CPackBundle
.sp
CPack Bundle generator (Mac OS X) specific options
.SS Variables specific to CPack Bundle generator
.sp
Installers built on Mac OS X using the Bundle generator use the
aforementioned DragNDrop (CPACK_DMG_xxx) variables, plus the following
Bundle\-specific parameters (CPACK_BUNDLE_xxx).
.INDENT 0.0
.TP
.B CPACK_BUNDLE_NAME
The name of the generated bundle. This appears in the OSX finder as the
bundle name. Required.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUNDLE_PLIST
Path to an OSX plist file that will be used for the generated bundle. This
assumes that the caller has generated or specified their own Info.plist
file. Required.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUNDLE_ICON
Path to an OSX icon file that will be used as the icon for the generated
bundle. This is the icon that appears in the OSX finder for the bundle, and
in the OSX dock when the bundle is opened. Required.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUNDLE_STARTUP_COMMAND
Path to a startup script. This is a path to an executable or script that
will be run whenever an end\-user double\-clicks the generated bundle in the
OSX Finder. Optional.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUNDLE_APPLE_CERT_APP
The name of your Apple supplied code signing certificate for the application.
The name usually takes the form "Developer ID Application: [Name]" or
"3rd Party Mac Developer Application: [Name]". If this variable is not set
the application will not be signed.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUNDLE_APPLE_ENTITLEMENTS
The name of the plist file that contains your apple entitlements for sandboxing
your application. This file is required for submission to the Mac App Store.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUNDLE_APPLE_CODESIGN_FILES
A list of additional files that you wish to be signed. You do not need to
list the main application folder, or the main executable. You should
list any frameworks and plugins that are included in your app bundle.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER
Additional parameter that will passed to codesign.
Default value: "\-\-deep \-f"
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMMAND_CODESIGN
Path to the codesign(1) command used to sign applications with an
Apple cert. This variable can be used to override the automatically
detected command (or specify its location if the auto\-detection fails
to find it.)
.UNINDENT
.SS CPackComponent
.sp
Build binary and source package installers
.SS Variables concerning CPack Components
.sp
The CPackComponent module is the module which handles the component
part of CPack. See CPack module for general information about CPack.
.sp
For certain kinds of binary installers (including the graphical
installers on Mac OS X and Windows), CPack generates installers that
allow users to select individual application components to install.
The contents of each of the components are identified by the COMPONENT
argument of CMake\(aqs INSTALL command. These components can be
annotated with user\-friendly names and descriptions, inter\-component
dependencies, etc., and grouped in various ways to customize the
resulting installer. See the cpack_add_* commands, described below,
for more information about component\-specific installations.
.sp
Component\-specific installation allows users to select specific sets
of components to install during the install process. Installation
components are identified by the COMPONENT argument of CMake\(aqs INSTALL
commands, and should be further described by the following CPack
commands:
.INDENT 0.0
.TP
.B CPACK_COMPONENTS_ALL
The list of component to install.
.sp
The default value of this variable is computed by CPack and contains all
components defined by the project. The user may set it to only include the
specified components.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_<GENNAME>_COMPONENT_INSTALL
Enable/Disable component install for CPack generator <GENNAME>.
.sp
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds
component. One can change the default behavior by setting this variable to
0/1 or OFF/ON.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENTS_GROUPING
Specify how components are grouped for multi\-package component\-aware CPack
generators.
.sp
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates
several packages files when asked for component packaging. They group
the component differently depending on the value of this variable:
.INDENT 7.0
.IP \(bu 2
ONE_PER_GROUP (default): creates one package file per component group
.IP \(bu 2
ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
.IP \(bu 2
IGNORE : creates one package per component, i.e. IGNORE component group
.UNINDENT
.sp
One can specify different grouping for different CPack generator by
using a CPACK_PROJECT_CONFIG_FILE.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENT_<compName>_DISPLAY_NAME
The name to be displayed for a component.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENT_<compName>_DESCRIPTION
The description of a component.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENT_<compName>_GROUP
The group of a component.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENT_<compName>_DEPENDS
The dependencies (list of components) on which this component depends.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENT_<compName>_HIDDEN
True if this component is hidden from the user.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENT_<compName>_REQUIRED
True if this component is required.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMPONENT_<compName>_DISABLED
True if this component is not selected to be installed by default.
.UNINDENT
.INDENT 0.0
.TP
.B cpack_add_component
.UNINDENT
.sp
Describes a CPack installation
component named by the COMPONENT argument to a CMake INSTALL command.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The cmake_add_component command describes an installation component,
which the user can opt to install or remove as part of the graphical
installation process. compname is the name of the component, as
provided to the COMPONENT argument of one or more CMake INSTALL
commands.
.sp
DISPLAY_NAME is the displayed name of the component, used in graphical
installers to display the component name. This value can be any
string.
.sp
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about the
component. Descriptions can span multiple lines using \fB\en\fP as the
line separator. Typically, these descriptions should be no more than
a few lines long.
.sp
HIDDEN indicates that this component will be hidden in the graphical
installer, so that the user cannot directly change whether it is
installed or not.
.sp
REQUIRED indicates that this component is required, and therefore will
always be installed. It will be visible in the graphical installer,
but it cannot be unselected. (Typically, required components are
shown greyed out).
.sp
DISABLED indicates that this component should be disabled (unselected)
by default. The user is free to select this component for
installation, unless it is also HIDDEN.
.sp
DEPENDS lists the components on which this component depends. If this
component is selected, then each of the components listed must also be
selected. The dependency information is encoded within the installer
itself, so that users cannot install inconsistent sets of components.
.sp
GROUP names the component group of which this component is a part. If
not provided, the component will be a standalone component, not part
of any component group. Component groups are described with the
cpack_add_component_group command, detailed below.
.sp
INSTALL_TYPES lists the installation types of which this component is
a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
.sp
DOWNLOADED indicates that this component should be downloaded
on\-the\-fly by the installer, rather than packaged in with the
installer itself. For more information, see the
cpack_configure_downloads command.
.sp
ARCHIVE_FILE provides a name for the archive file created by CPack to
be used for downloaded components. If not supplied, CPack will create
a file with some name based on CPACK_PACKAGE_FILE_NAME and the name of
the component. See cpack_configure_downloads for more information.
.INDENT 0.0
.TP
.B cpack_add_component_group
.UNINDENT
.sp
Describes a group of related CPack installation components.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group\-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an arbitrary
name used to identify the group in the GROUP argument of the
cpack_add_component command, which is used to place a component in a
group. The name of the group must not conflict with the name of any
component.
.sp
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This value
can be any string.
.sp
DESCRIPTION is an extended description of the component group, used in
graphical installers to give the user additional information about the
components within that group. Descriptions can span multiple lines
using \fB\en\fP as the line separator. Typically, these descriptions
should be no more than a few lines long.
.sp
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups, providing
an arbitrary hierarchy of groups.
.sp
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the components
within the group. Otherwise, the group will initially show up as a
single entry.
.sp
BOLD_TITLE indicates that the group title should appear in bold, to
call the user\(aqs attention to the group.
.INDENT 0.0
.TP
.B cpack_add_install_type
.UNINDENT
.sp
Add a new installation type containing
a set of predefined component selections to the graphical installer.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_add_install_type(typename
[DISPLAY_NAME name])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an application. For
example, a "Developer" install type might include an application along
with its header and library files, while an "End user" install type
might just include the application\(aqs executable. Each component
identifies itself with one or more install types via the INSTALL_TYPES
argument to cpack_add_component.
.sp
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop\-down box within a graphical installer.
This value can be any string.
.INDENT 0.0
.TP
.B cpack_configure_downloads
.UNINDENT
.sp
Configure CPack to download
selected components on\-the\-fly as part of the installation process.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The cpack_configure_downloads command configures installation\-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the user
selects that component for installation, the installer will download
and extract the component in place. This feature is useful for
creating small installers that only download the requested components,
saving bandwidth. Additionally, the installers are small enough that
they will be installed as part of the normal installation process, and
the "Change" button in Windows Add/Remove Programs control panel will
allow one to add or remove parts of the application after the original
installation. On Windows, the downloaded\-components functionality
requires the ZipDLL plug\-in for NSIS, available at:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
http://nsis.sourceforge.net/ZipDLL_plug\-in
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
On Mac OS X, installers that download components on\-the\-fly can only
be built and installed on system using Mac OS X 10.5 or later.
.sp
The site argument is a URL where the archives for downloadable
components will reside, e.g.,
\fI\%https://cmake.org/files/2.6.1/installer/\fP All of the archives
produced by CPack should be uploaded to that location.
.sp
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
.sp
The ALL flag indicates that all components be downloaded. Otherwise,
only those components explicitly marked as DOWNLOADED or that have a
specified ARCHIVE_FILE will be downloaded. Additionally, the ALL
option implies ADD_REMOVE (unless NO_ADD_REMOVE is specified).
.sp
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows\(aq Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components.
NO_ADD_REMOVE turns off this behavior. This option is ignored on Mac
OS X.
.SS CPackCygwin
.sp
Cygwin CPack generator (Cygwin).
.SS Variables specific to CPack Cygwin generator
.sp
The
following variable is specific to installers build on and/or for
Cygwin:
.INDENT 0.0
.TP
.B CPACK_CYGWIN_PATCH_NUMBER
The Cygwin patch number. FIXME: This documentation is incomplete.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_CYGWIN_PATCH_FILE
The Cygwin patch file. FIXME: This documentation is incomplete.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_CYGWIN_BUILD_SCRIPT
The Cygwin build script. FIXME: This documentation is incomplete.
.UNINDENT
.SS CPackDeb
.sp
The built in (binary) CPack Deb generator (Unix only)
.SS Variables specific to CPack Debian (DEB) generator
.sp
CPackDeb may be used to create Deb package using \fBCPack\fP\&.
CPackDeb is a \fBCPack\fP generator thus it uses the \fBCPACK_XXX\fP
variables used by \fBCPack\fP\&.
.sp
CPackDeb generator should work on any Linux host but it will produce
better deb package when Debian specific tools \fBdpkg\-xxx\fP are usable on
the build system.
.sp
CPackDeb has specific features which are controlled by the specifics
\fBCPACK_DEBIAN_XXX\fP variables.
.sp
\fBCPACK_DEBIAN_<COMPONENT>_XXXX\fP variables may be used in order to have
\fBcomponent\fP specific values. Note however that \fB<COMPONENT>\fP refers to
the \fBgrouping name\fP written in upper case. It may be either a component name
or a component GROUP name.
.sp
Here are some CPackDeb wiki resources that are here for historic reasons and
are no longer maintained but may still prove useful:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%https://cmake.org/Wiki/CMake:CPackConfiguration\fP
.IP \(bu 2
\fI\%https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29\fP
.UNINDENT
.UNINDENT
.UNINDENT
.sp
List of CPackDEB specific variables:
.INDENT 0.0
.TP
.B CPACK_DEB_COMPONENT_INSTALL
Enable component packaging for CPackDEB
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : OFF
.UNINDENT
.sp
If enabled (ON) multiple packages are generated. By default a single package
containing files of all components is generated.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_NAME
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
Set Package control field (variable is automatically transformed to lower
case).
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
\fBCPACK_PACKAGE_NAME\fP for non\-component based
installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_NAME\fP suffixed with \-<COMPONENT>
for component\-based installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-controlfields.html#s\-f\-Source\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_FILE_NAME
.TP
.B CPACK_DEBIAN_<COMPONENT>_FILE_NAME
Package file name.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : \fB<CPACK_PACKAGE_FILE_NAME>[\-<component>].deb\fP
.UNINDENT
.sp
This may be set to \fBDEB\-DEFAULT\fP to allow CPackDeb to generate package file
name by itself in deb format:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<PackageName>_<VersionNumber>\-<DebianRevisionNumber>_<DebianArchitecture>.deb
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Alternatively provided package file name must end with \fB\&.deb\fP suffix.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Preferred setting of this variable is \fBDEB\-DEFAULT\fP but for backward
compatibility with CPackDeb in CMake prior to version 3.6 this feature
is disabled by default.
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
By using non default filenames duplicate names may occur. Duplicate files
get overwritten and it is up to the packager to set the variables in a
manner that will prevent such errors.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_VERSION
The Debian package version
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : \fBCPACK_PACKAGE_VERSION\fP
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_RELEASE
The Debian package release \- Debian revision number.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : 1
.UNINDENT
.sp
This is the numbering of the DEB package itself, i.e. the version of the
packaging and not the version of the content (see
\fI\%CPACK_DEBIAN_PACKAGE_VERSION\fP). One may change the default value
if the previous packaging was buggy and/or you want to put here a fancy Linux
distro specific numbering.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_ARCHITECTURE
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE
The Debian package architecture
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : Output of \fBdpkg \-\-print\-architecture\fP (or \fBi386\fP
if \fBdpkg\fP is not found)
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_DEPENDS
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
Sets the Debian dependencies of this package.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_DEPENDS\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
If \fI\%CPACK_DEBIAN_PACKAGE_SHLIBDEPS\fP or
more specifically \fI\%CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS\fP
is set for this component, the discovered dependencies will be appended
to \fI\%CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS\fP instead of
\fI\%CPACK_DEBIAN_PACKAGE_DEPENDS\fP\&. If
\fI\%CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS\fP is an empty string,
only the automatically discovered dependencies will be set for this
component.
.UNINDENT
.UNINDENT
.sp
Example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1\-6), libc6 (< 2.4)")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
Sets inter component dependencies if listed with
\fBCPACK_COMPONENT_<compName>_DEPENDS\fP variables.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_MAINTAINER
The Debian package maintainer
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : \fBCPACK_PACKAGE_CONTACT\fP
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_DESCRIPTION
.TP
.B CPACK_COMPONENT_<COMPONENT>_DESCRIPTION
The Debian package description
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_DESCRIPTION\fP if set or
.IP \(bu 2
\fBCPACK_PACKAGE_DESCRIPTION_SUMMARY\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_SECTION
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
Set Section control field e.g. admin, devel, doc, ...
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : "devel"
.UNINDENT
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-archive.html#s\-subsections\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_ARCHIVE_TYPE
The archive format used for creating the Debian package.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : "paxr"
.UNINDENT
.sp
Possible values are:
.INDENT 7.0
.IP \(bu 2
paxr
.IP \(bu 2
gnutar
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Default pax archive format is the most portable format and generates
packages that do not treat sparse files specially.
GNU tar format on the other hand supports longer filenames.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_COMPRESSION_TYPE
The compression used for creating the Debian package.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : "gzip"
.UNINDENT
.sp
Possible values are:
.INDENT 7.0
.IP \(bu 2
lzma
.IP \(bu 2
xz
.IP \(bu 2
bzip2
.IP \(bu 2
gzip
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_PRIORITY
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY
Set Priority control field e.g. required, important, standard, optional,
extra
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : "optional"
.UNINDENT
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-archive.html#s\-priorities\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_HOMEPAGE
The URL of the web site for this package, preferably (when applicable) the
site from which the original source can be obtained and any additional
upstream documentation or information may be found.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
The content of this field is a simple URL without any surrounding
characters such as <>.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_SHLIBDEPS
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS
May be set to ON in order to use \fBdpkg\-shlibdeps\fP to generate
better package dependency list.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_SHLIBDEPS\fP if set or
.IP \(bu 2
OFF
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
You may need set \fBCMAKE_INSTALL_RPATH\fP to an appropriate value
if you use this feature, because if you don\(aqt \fBdpkg\-shlibdeps\fP
may fail to find your own shared libs.
See \fI\%https://cmake.org/Wiki/CMake_RPATH_handling\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_DEBUG
May be set when invoking cpack in order to trace debug information
during CPackDeb run.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_PREDEPENDS
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS
Sets the \fIPre\-Depends\fP field of the Debian package.
Like \fI\%Depends\fP, except that it
also forces \fBdpkg\fP to complete installation of the packages named
before even starting the installation of the package which declares the
pre\-dependency.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_PREDEPENDS\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%http://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-binarydeps\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_ENHANCES
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES
Sets the \fIEnhances\fP field of the Debian package.
Similar to \fI\%Suggests\fP but works
in the opposite direction: declares that a package can enhance the
functionality of another package.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_ENHANCES\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%http://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-binarydeps\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_BREAKS
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS
Sets the \fIBreaks\fP field of the Debian package.
When a binary package (P) declares that it breaks other packages (B),
\fBdpkg\fP will not allow the package (P) which declares \fIBreaks\fP be
\fBunpacked\fP unless the packages that will be broken (B) are deconfigured
first.
As long as the package (P) is configured, the previously deconfigured
packages (B) cannot be reconfigured again.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_BREAKS\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-breaks\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_CONFLICTS
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS
Sets the \fIConflicts\fP field of the Debian package.
When one binary package declares a conflict with another using a \fIConflicts\fP
field, \fBdpkg\fP will not allow them to be unpacked on the system at
the same time.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_CONFLICTS\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-conflicts\fP
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
This is a stronger restriction than
\fI\%Breaks\fP, which prevents the
broken package from being configured while the breaking package is in
the "Unpacked" state but allows both packages to be unpacked at the same
time.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_PROVIDES
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES
Sets the \fIProvides\fP field of the Debian package.
A virtual package is one which appears in the \fIProvides\fP control field of
another package.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_PROVIDES\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-virtual\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_REPLACES
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES
Sets the \fIReplaces\fP field of the Debian package.
Packages can declare in their control file that they should overwrite
files in certain other packages, or completely replace other packages.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_REPLACES\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%http://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-binarydeps\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_RECOMMENDS
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS
Sets the \fIRecommends\fP field of the Debian package.
Allows packages to declare a strong, but not absolute, dependency on other
packages.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_RECOMMENDS\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%http://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-binarydeps\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_SUGGESTS
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS
Sets the \fISuggests\fP field of the Debian package.
Allows packages to declare a suggested package install grouping.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_SUGGESTS\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%http://www.debian.org/doc/debian\-policy/ch\-relationships.html#s\-binarydeps\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : OFF
.UNINDENT
.sp
Allows to generate shlibs control file automatically. Compatibility is defined by
\fI\%CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY\fP variable value.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Libraries are only considered if they have both library name and version
set. This can be done by setting SOVERSION property with
\fBset_target_properties()\fP command.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY
Compatibility policy for auto\-generated shlibs control file.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : "="
.UNINDENT
.sp
Defines compatibility policy for auto\-generated shlibs control file.
Possible values: "=", ">="
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-sharedlibs.html#s\-sharedlibs\-shlibdeps\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_EXTRA
This variable allow advanced user to add custom script to the
control.tar.gz.
Typical usage is for conffiles, postinst, postrm, prerm.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
Usage:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
The original permissions of the files will be used in the final
package unless the variable
\fI\%CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION\fP is set.
In particular, the scripts should have the proper executable
flag prior to the generation of the package.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_STRICT_PERMISSION
This variable indicates if the Debian policy on control files should be
strictly followed.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : FALSE
.UNINDENT
.sp
Usage:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
This overrides the permissions on the original files, following the rules
set by Debian policy
\fI\%https://www.debian.org/doc/debian\-policy/ch\-files.html#s\-permissions\-owners\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DEBIAN_PACKAGE_SOURCE
.TP
.B CPACK_DEBIAN_<COMPONENT>_PACKAGE_SOURCE
Sets the \fBSource\fP field of the binary Debian package.
When the binary package name is not the same as the source package name
(in particular when several components/binaries are generated from one
source) the source from which the binary has been generated should be
indicated with the field \fBSource\fP\&.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default :
.INDENT 2.0
.IP \(bu 2
An empty string for non\-component based installations
.IP \(bu 2
\fI\%CPACK_DEBIAN_PACKAGE_SOURCE\fP for component\-based
installations.
.UNINDENT
.UNINDENT
.sp
See \fI\%https://www.debian.org/doc/debian\-policy/ch\-controlfields.html#s\-f\-Source\fP
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
This value is not interpreted. It is possible to pass an optional
revision number of the referenced source package as well.
.UNINDENT
.UNINDENT
.UNINDENT
.SS CPackDMG
.sp
DragNDrop CPack generator (Mac OS X).
.SS Variables specific to CPack DragNDrop generator
.sp
The following variables are specific to the DragNDrop installers built
on Mac OS X:
.INDENT 0.0
.TP
.B CPACK_DMG_VOLUME_NAME
The volume name of the generated disk image. Defaults to
CPACK_PACKAGE_FILE_NAME.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DMG_FORMAT
The disk image format. Common values are UDRO (UDIF read\-only), UDZO (UDIF
zlib\-compressed) or UDBZ (UDIF bzip2\-compressed). Refer to hdiutil(1) for
more information on other available formats. Defaults to UDZO.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DMG_DS_STORE
Path to a custom DS_Store file. This .DS_Store file e.g. can be used to
specify the Finder window position/geometry and layout (such as hidden
toolbars, placement of the icons etc.). This file has to be generated by
the Finder (either manually or through AppleScript) using a normal folder
from which the .DS_Store file can then be extracted.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DMG_DS_STORE_SETUP_SCRIPT
Path to a custom AppleScript file. This AppleScript is used to generate
a .DS_Store file which specifies the Finder window position/geometry and
layout (such as hidden toolbars, placement of the icons etc.).
By specifying a custom AppleScript there is no need to use
CPACK_DMG_DS_STORE, as the .DS_Store that is generated by the AppleScript
will be packaged.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DMG_BACKGROUND_IMAGE
Path to an image file to be used as the background. This file will be
copied to .background/background.<ext>, where ext is the original image file
extension. The background image is installed into the image before
CPACK_DMG_DS_STORE_SETUP_SCRIPT is executed or CPACK_DMG_DS_STORE is
installed. By default no background image is set.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK
Default behaviour is to include a symlink to \fB/Applications\fP in the DMG.
Set this option to \fBON\fP to avoid adding the symlink.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DMG_SLA_DIR
Directory where license and menu files for different languages are stored.
Setting this causes CPack to look for a \fB<language>.menu.txt\fP and
\fB<language>.license.txt\fP file for every language defined in
\fBCPACK_DMG_SLA_LANGUAGES\fP\&. If both this variable and
\fBCPACK_RESOURCE_FILE_LICENSE\fP are set, CPack will only look for the menu
files and use the same license file for all languages.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_DMG_SLA_LANGUAGES
Languages for which a license agreement is provided when mounting the
generated DMG. A menu file consists of 9 lines of text. The first line is
is the name of the language itself, uppercase, in English (e.g. German).
The other lines are translations of the following strings:
.INDENT 7.0
.IP \(bu 2
Agree
.IP \(bu 2
Disagree
.IP \(bu 2
Print
.IP \(bu 2
Save...
.IP \(bu 2
You agree to the terms of the License Agreement when you click the
"Agree" button.
.IP \(bu 2
Software License Agreement
.IP \(bu 2
This text cannot be saved. The disk may be full or locked, or the file
may be locked.
.IP \(bu 2
Unable to print. Make sure you have selected a printer.
.UNINDENT
.sp
For every language in this list, CPack will try to find files
\fB<language>.menu.txt\fP and \fB<language>.license.txt\fP in the directory
specified by the \fI\%CPACK_DMG_SLA_DIR\fP variable.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMMAND_HDIUTIL
Path to the hdiutil(1) command used to operate on disk image files on Mac
OS X. This variable can be used to override the automatically detected
command (or specify its location if the auto\-detection fails to find it.)
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMMAND_SETFILE
Path to the SetFile(1) command used to set extended attributes on files and
directories on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto\-detection fails to find it.)
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMMAND_REZ
Path to the Rez(1) command used to compile resources on Mac OS X. This
variable can be used to override the automatically detected command (or
specify its location if the auto\-detection fails to find it.)
.UNINDENT
.SS CPackIFW
.sp
This module looks for the location of the command line utilities supplied
with the Qt Installer Framework (\fI\%QtIFW\fP).
.sp
The module also defines several commands to control the behavior of the
CPack \fBIFW\fP generator.
.SS Overview
.sp
CPack \fBIFW\fP generator helps you to create online and offline
binary cross\-platform installers with a graphical user interface.
.sp
CPack IFW generator prepares project installation and generates configuration
and meta information for \fI\%QtIFW\fP tools.
.sp
The \fI\%QtIFW\fP provides a set of tools and utilities to create
installers for the supported desktop Qt platforms: Linux, Microsoft Windows,
and Mac OS X.
.sp
You should also install \fI\%QtIFW\fP to use CPack \fBIFW\fP generator.
If you don\(aqt use a default path for the installation, please set
the used path in the variable \fBQTIFWDIR\fP\&.
.SS Variables
.sp
You can use the following variables to change behavior of CPack \fBIFW\fP
generator.
.SS Debug
.INDENT 0.0
.TP
.B CPACK_IFW_VERBOSE
Set to \fBON\fP to enable addition debug output.
By default is \fBOFF\fP\&.
.UNINDENT
.SS Package
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_TITLE
Name of the installer as displayed on the title bar.
By default used \fBCPACK_PACKAGE_DESCRIPTION_SUMMARY\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_PUBLISHER
Publisher of the software (as shown in the Windows Control Panel).
By default used \fBCPACK_PACKAGE_VENDOR\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PRODUCT_URL
URL to a page that contains product information on your web site.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_ICON
Filename for a custom installer icon. The actual file is \(aq.icns\(aq (Mac OS X),
\(aq.ico\(aq (Windows). No functionality on Unix.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_WINDOW_ICON
Filename for a custom window icon in PNG format for the Installer
application.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_LOGO
Filename for a logo is used as QWizard::LogoPixmap.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_WATERMARK
Filename for a watermark is used as QWizard::WatermarkPixmap.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_BANNER
Filename for a banner is used as QWizard::BannerPixmap.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_BACKGROUND
Filename for an image used as QWizard::BackgroundPixmap (only used by MacStyle).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_WIZARD_STYLE
Wizard style to be used ("Modern", "Mac", "Aero" or "Classic").
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
Default width of the wizard in pixels. Setting a banner image will override this.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
Default height of the wizard in pixels. Setting a watermark image will override this.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_TITLE_COLOR
Color of the titles and subtitles (takes an HTML color code, such as "#88FF33").
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
Name of the default program group for the product in the Windows Start menu.
.sp
By default used \fI\%CPACK_IFW_PACKAGE_NAME\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_TARGET_DIRECTORY
Default target directory for installation.
By default used
"@ApplicationsDir@/\fBCPACK_PACKAGE_INSTALL_DIRECTORY\fP"
.sp
You can use predefined variables.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_ADMIN_TARGET_DIRECTORY
Default target directory for installation with administrator rights.
.sp
You can use predefined variables.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_GROUP
The group, which will be used to configure the root package
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_NAME
The root package name, which will be used if configuration group is not
specified
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
Filename of the generated maintenance tool.
The platform\-specific executable file extension is appended.
.sp
By default used \fI\%QtIFW\fP defaults (\fBmaintenancetool\fP).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
Filename for the configuration of the generated maintenance tool.
.sp
By default used \fI\%QtIFW\fP defaults (\fBmaintenancetool.ini\fP).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
Set to \fBON\fP if the installation path can contain non\-ASCII characters.
.sp
Is \fBON\fP for \fI\%QtIFW\fP less 2.0 tools.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
Set to \fBOFF\fP if the installation path cannot contain space characters.
.sp
Is \fBON\fP for \fI\%QtIFW\fP less 2.0 tools.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_CONTROL_SCRIPT
Filename for a custom installer control script.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGE_RESOURCES
List of additional resources (\(aq.qrc\(aq files) to include in the installer
binary.
.sp
You can use \fI\%cpack_ifw_add_package_resources()\fP command to resolve
relative paths.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_REPOSITORIES_ALL
The list of remote repositories.
.sp
The default value of this variable is computed by CPack and contains
all repositories added with command \fI\%cpack_ifw_add_repository()\fP
or updated with command \fI\%cpack_ifw_update_repository()\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_DOWNLOAD_ALL
If this is \fBON\fP all components will be downloaded.
By default is \fBOFF\fP or used value
from \fBCPACK_DOWNLOAD_ALL\fP if set
.UNINDENT
.SS Components
.INDENT 0.0
.TP
.B CPACK_IFW_RESOLVE_DUPLICATE_NAMES
Resolve duplicate names when installing components with groups.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_PACKAGES_DIRECTORIES
Additional prepared packages dirs that will be used to resolve
dependent components.
.UNINDENT
.SS Tools
.INDENT 0.0
.TP
.B CPACK_IFW_FRAMEWORK_VERSION
The version of used \fI\%QtIFW\fP tools.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_BINARYCREATOR_EXECUTABLE
The path to "binarycreator" command line client.
.sp
This variable is cached and can be configured user if need.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_IFW_REPOGEN_EXECUTABLE
The path to "repogen" command line client.
.sp
This variable is cached and can be configured user if need.
.UNINDENT
.SS Commands
.sp
The module defines the following commands:
.INDENT 0.0
.TP
.B cpack_ifw_configure_component
Sets the arguments specific to the CPack IFW generator.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL] [VIRTUAL]
[FORCED_INSTALLATION] [REQUIRES_ADMIN_RIGHTS]
[NAME <name>]
[DISPLAY_NAME <display_name>]
[DESCRIPTION <description>]
[UPDATE_TEXT <update_text>]
[VERSION <version>]
[RELEASE_DATE <release_date>]
[SCRIPT <script>]
[PRIORITY|SORTING_PRIORITY <sorting_priority>] # Note: PRIORITY is deprecated
[DEPENDS|DEPENDENCIES <com_id> ...]
[AUTO_DEPEND_ON <comp_id> ...]
[LICENSES <display_name> <file_path> ...]
[DEFAULT <value>]
[USER_INTERFACES <file_path> <file_path> ...]
[TRANSLATIONS <file_path> <file_path> ...])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command should be called after \fBcpack_add_component()\fP command.
.INDENT 7.0
.TP
.B \fBCOMMON\fP
if set, then the component will be packaged and installed as part
of a group to which it belongs.
.TP
.B \fBESSENTIAL\fP
if set, then the package manager stays disabled until that
component is updated.
.TP
.B \fBVIRTUAL\fP
if set, then the component will be hidden from the installer.
It is a equivalent of the \fBHIDDEN\fP option from the
\fBcpack_add_component()\fP command.
.TP
.B \fBFORCED_INSTALLATION\fP
if set, then the component must always be installed.
It is a equivalent of the \fBREQUARED\fP option from the
\fBcpack_add_component()\fP command.
.TP
.B \fBREQUIRES_ADMIN_RIGHTS\fP
set it if the component needs to be installed with elevated permissions.
.TP
.B \fBNAME\fP
is used to create domain\-like identification for this component.
By default used origin component name.
.TP
.B \fBDISPLAY_NAME\fP
set to rewrite original name configured by
\fBcpack_add_component()\fP command.
.TP
.B \fBDESCRIPTION\fP
set to rewrite original description configured by
\fBcpack_add_component()\fP command.
.TP
.B \fBUPDATE_TEXT\fP
will be added to the component description if this is an update to
the component.
.TP
.B \fBVERSION\fP
is version of component.
By default used \fBCPACK_PACKAGE_VERSION\fP\&.
.TP
.B \fBRELEASE_DATE\fP
keep empty to auto generate.
.TP
.B \fBSCRIPT\fP
is a relative or absolute path to operations script
for this component.
.TP
.B \fBPRIORITY\fP | \fBSORTING_PRIORITY\fP
is priority of the component in the tree.
The \fBPRIORITY\fP option is deprecated and will be removed in a future
version of CMake. Please use \fBSORTING_PRIORITY\fP option instead.
.TP
.B \fBDEPENDS\fP | \fBDEPENDENCIES\fP
list of dependency component or component group identifiers in
\fI\%QtIFW\fP style.
.TP
.B \fBAUTO_DEPEND_ON\fP
list of identifiers of component or component group in \fI\%QtIFW\fP style
that this component has an automatic dependency on.
.TP
.B \fBLICENSES\fP
pair of <display_name> and <file_path> of license text for this
component. You can specify more then one license.
.TP
.B \fBDEFAULT\fP
Possible values are: TRUE, FALSE, and SCRIPT.
Set to FALSE to disable the component in the installer or to SCRIPT
to resolved during runtime (don\(aqt forget add the file of the script
as a value of the \fBSCRIPT\fP option).
.TP
.B \fBUSER_INTERFACES\fP
is a list of <file_path> (\(aq.ui\(aq files) representing pages to load.
.TP
.B \fBTRANSLATIONS\fP
is a list of <file_path> (\(aq.qm\(aq files) representing translations to load.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B cpack_ifw_configure_component_group
Sets the arguments specific to the CPack IFW generator.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_ifw_configure_component_group(<groupname> [VIRTUAL]
[FORCED_INSTALLATION] [REQUIRES_ADMIN_RIGHTS]
[NAME <name>]
[DISPLAY_NAME <display_name>]
[DESCRIPTION <description>]
[UPDATE_TEXT <update_text>]
[VERSION <version>]
[RELEASE_DATE <release_date>]
[SCRIPT <script>]
[PRIORITY|SORTING_PRIORITY <sorting_priority>] # Note: PRIORITY is deprecated
[DEPENDS|DEPENDENCIES <com_id> ...]
[AUTO_DEPEND_ON <comp_id> ...]
[LICENSES <display_name> <file_path> ...]
[DEFAULT <value>]
[USER_INTERFACES <file_path> <file_path> ...]
[TRANSLATIONS <file_path> <file_path> ...])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command should be called after \fBcpack_add_component_group()\fP
command.
.INDENT 7.0
.TP
.B \fBVIRTUAL\fP
if set, then the group will be hidden from the installer.
Note that setting this on a root component does not work.
.TP
.B \fBFORCED_INSTALLATION\fP
if set, then the group must always be installed.
.TP
.B \fBREQUIRES_ADMIN_RIGHTS\fP
set it if the component group needs to be installed with elevated
permissions.
.TP
.B \fBNAME\fP
is used to create domain\-like identification for this component group.
By default used origin component group name.
.TP
.B \fBDISPLAY_NAME\fP
set to rewrite original name configured by
\fBcpack_add_component_group()\fP command.
.TP
.B \fBDESCRIPTION\fP
set to rewrite original description configured by
\fBcpack_add_component_group()\fP command.
.TP
.B \fBUPDATE_TEXT\fP
will be added to the component group description if this is an update to
the component group.
.TP
.B \fBVERSION\fP
is version of component group.
By default used \fBCPACK_PACKAGE_VERSION\fP\&.
.TP
.B \fBRELEASE_DATE\fP
keep empty to auto generate.
.TP
.B \fBSCRIPT\fP
is a relative or absolute path to operations script
for this component group.
.TP
.B \fBPRIORITY\fP | \fBSORTING_PRIORITY\fP
is priority of the component group in the tree.
The \fBPRIORITY\fP option is deprecated and will be removed in a future
version of CMake. Please use \fBSORTING_PRIORITY\fP option instead.
.TP
.B \fBDEPENDS\fP | \fBDEPENDENCIES\fP
list of dependency component or component group identifiers in
\fI\%QtIFW\fP style.
.TP
.B \fBAUTO_DEPEND_ON\fP
list of identifiers of component or component group in \fI\%QtIFW\fP style
that this component group has an automatic dependency on.
.TP
.B \fBLICENSES\fP
pair of <display_name> and <file_path> of license text for this
component group. You can specify more then one license.
.TP
.B \fBDEFAULT\fP
Possible values are: TRUE, FALSE, and SCRIPT.
Set to TRUE to preselect the group in the installer
(this takes effect only on groups that have no visible child components)
or to SCRIPT to resolved during runtime (don\(aqt forget add the file of
the script as a value of the \fBSCRIPT\fP option).
.TP
.B \fBUSER_INTERFACES\fP
is a list of <file_path> (\(aq.ui\(aq files) representing pages to load.
.TP
.B \fBTRANSLATIONS\fP
is a list of <file_path> (\(aq.qm\(aq files) representing translations to load.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B cpack_ifw_add_repository
Add \fI\%QtIFW\fP specific remote repository to binary installer.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_ifw_add_repository(<reponame> [DISABLED]
URL <url>
[USERNAME <username>]
[PASSWORD <password>]
[DISPLAY_NAME <display_name>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command will also add the <reponame> repository
to a variable \fI\%CPACK_IFW_REPOSITORIES_ALL\fP\&.
.INDENT 7.0
.TP
.B \fBDISABLED\fP
if set, then the repository will be disabled by default.
.TP
.B \fBURL\fP
is points to a list of available components.
.TP
.B \fBUSERNAME\fP
is used as user on a protected repository.
.TP
.B \fBPASSWORD\fP
is password to use on a protected repository.
.TP
.B \fBDISPLAY_NAME\fP
is string to display instead of the URL.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B cpack_ifw_update_repository
Update \fI\%QtIFW\fP specific repository from remote repository.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_ifw_update_repository(<reponame>
[[ADD|REMOVE] URL <url>]|
[REPLACE OLD_URL <old_url> NEW_URL <new_url>]]
[USERNAME <username>]
[PASSWORD <password>]
[DISPLAY_NAME <display_name>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command will also add the <reponame> repository
to a variable \fI\%CPACK_IFW_REPOSITORIES_ALL\fP\&.
.INDENT 7.0
.TP
.B \fBURL\fP
is points to a list of available components.
.TP
.B \fBOLD_URL\fP
is points to a list that will replaced.
.TP
.B \fBNEW_URL\fP
is points to a list that will replace to.
.TP
.B \fBUSERNAME\fP
is used as user on a protected repository.
.TP
.B \fBPASSWORD\fP
is password to use on a protected repository.
.TP
.B \fBDISPLAY_NAME\fP
is string to display instead of the URL.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B cpack_ifw_add_package_resources
Add additional resources in the installer binary.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_ifw_add_package_resources(<file_path> <file_path> ...)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command will also add the specified files
to a variable \fI\%CPACK_IFW_PACKAGE_RESOURCES\fP\&.
.UNINDENT
.SS Example usage
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_PACKAGE_NAME "MyPackage")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyPackage Installation Example")
set(CPACK_PACKAGE_VERSION "1.0.0") # Version of installer
include(CPack)
include(CPackIFW)
cpack_add_component(myapp
DISPLAY_NAME "MyApp"
DESCRIPTION "My Application")
cpack_ifw_configure_component(myapp
VERSION "1.2.3" # Version of component
SCRIPT "operations.qs")
cpack_add_component(mybigplugin
DISPLAY_NAME "MyBigPlugin"
DESCRIPTION "My Big Downloadable Plugin"
DOWNLOADED)
cpack_ifw_add_repository(myrepo
URL "http://example.com/ifw/repo/myapp"
DISPLAY_NAME "My Application Repository")
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Online installer
.sp
By default CPack IFW generator makes offline installer. This means that all
components will be packaged into a binary file.
.sp
To make a component downloaded, you must set the \fBDOWNLOADED\fP option in
\fBcpack_add_component()\fP\&.
.sp
Then you would use the command \fBcpack_configure_downloads()\fP\&.
If you set \fBALL\fP option all components will be downloaded.
.sp
You also can use command \fI\%cpack_ifw_add_repository()\fP and
variable \fI\%CPACK_IFW_DOWNLOAD_ALL\fP for more specific configuration.
.sp
CPack IFW generator creates "repository" dir in current binary dir. You
would copy content of this dir to specified \fBsite\fP (\fBurl\fP).
.SS See Also
.sp
Qt Installer Framework Manual:
.INDENT 0.0
.IP \(bu 2
Index page:
\fI\%http://doc.qt.io/qtinstallerframework/index.html\fP
.IP \(bu 2
Component Scripting:
\fI\%http://doc.qt.io/qtinstallerframework/scripting.html\fP
.IP \(bu 2
Predefined Variables:
\fI\%http://doc.qt.io/qtinstallerframework/scripting.html#predefined\-variables\fP
.IP \(bu 2
Promoting Updates:
\fI\%http://doc.qt.io/qtinstallerframework/ifw\-updates.html\fP
.UNINDENT
.INDENT 0.0
.TP
.B Download Qt Installer Framework for you platform from Qt site:
\fI\%http://download.qt.io/official_releases/qt\-installer\-framework\fP
.UNINDENT
.SS CPackIFWConfigureFile
.sp
The module defines \fBconfigure_file()\fP similar command to
configure file templates prepared in QtIFW/SDK/Creator style.
.SS Commands
.sp
The module defines the following commands:
.INDENT 0.0
.TP
.B cpack_ifw_configure_file
Copy a file to another location and modify its contents.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack_ifw_configure_file(<input> <output>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Copies an \fB<input>\fP file to an \fB<output>\fP file and substitutes variable
values referenced as \fB%{VAR}\fP or \fB%VAR%\fP in the input file content.
Each variable reference will be replaced with the current value of the
variable, or the empty string if the variable is not defined.
.UNINDENT
.SS CPackNSIS
.sp
CPack NSIS generator specific options
.SS Variables specific to CPack NSIS generator
.sp
The following variables are specific to the graphical installers built
on Windows using the Nullsoft Installation System.
.INDENT 0.0
.TP
.B CPACK_NSIS_INSTALL_ROOT
The default installation directory presented to the end user by the NSIS
installer is under this root dir. The full directory presented to the end
user is: ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_MUI_ICON
An icon filename. The name of a \fB*.ico\fP file used as the main icon for the
generated install program.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_MUI_UNIICON
An icon filename. The name of a \fB*.ico\fP file used as the main icon for the
generated uninstall program.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_INSTALLER_MUI_ICON_CODE
undocumented.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP
The filename of a bitmap to use as the NSIS MUI_WELCOMEFINISHPAGE_BITMAP.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP
The filename of a bitmap to use as the NSIS MUI_UNWELCOMEFINISHPAGE_BITMAP.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS
Extra NSIS commands that will be added to the beginning of the install
Section, before your install tree is available on the target system.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_EXTRA_INSTALL_COMMANDS
Extra NSIS commands that will be added to the end of the install Section,
after your install tree is available on the target system.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
Extra NSIS commands that will be added to the uninstall Section, before
your install tree is removed from the target system.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_COMPRESSOR
The arguments that will be passed to the NSIS SetCompressor command.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL
Ask about uninstalling previous versions first. If this is set to "ON",
then an installer will look for previous installed versions and if one is
found, ask the user whether to uninstall it before proceeding with the
install.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_MODIFY_PATH
Modify PATH toggle. If this is set to "ON", then an extra page will appear
in the installer that will allow the user to choose whether the program
directory should be added to the system PATH variable.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_DISPLAY_NAME
The display name string that appears in the Windows Add/Remove Program
control panel
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_PACKAGE_NAME
The title displayed at the top of the installer.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_INSTALLED_ICON_NAME
A path to the executable that contains the installer icon.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_HELP_LINK
URL to a web site providing assistance in installing your application.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_URL_INFO_ABOUT
URL to a web site providing more information about your application.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_CONTACT
Contact information for questions and comments about the installation
process.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_<compName>_INSTALL_DIRECTORY
Custom install directory for the specified component <compName> instead
of $INSTDIR.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_CREATE_ICONS_EXTRA
Additional NSIS commands for creating start menu shortcuts.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_DELETE_ICONS_EXTRA
Additional NSIS commands to uninstall start menu shortcuts.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_EXECUTABLES_DIRECTORY
Creating NSIS start menu links assumes that they are in \(aqbin\(aq unless this
variable is set. For example, you would set this to \(aqexec\(aq if your
executables are in an exec directory.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_MUI_FINISHPAGE_RUN
Specify an executable to add an option to run on the finish page of the
NSIS installer.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_NSIS_MENU_LINKS
Specify links in [application] menu. This should contain a list of pair
"link" "link name". The link may be an URL or a path relative to
installation prefix. Like:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_NSIS_MENU_LINKS
"doc/cmake\-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html"
"CMake Help" "https://cmake.org" "CMake Web Site")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS CPackPackageMaker
.sp
PackageMaker CPack generator (Mac OS X).
.SS Variables specific to CPack PackageMaker generator
.sp
The following variable is specific to installers built on Mac
OS X using PackageMaker:
.INDENT 0.0
.TP
.B CPACK_OSX_PACKAGE_VERSION
The version of Mac OS X that the resulting PackageMaker archive should be
compatible with. Different versions of Mac OS X support different
features. For example, CPack can only build component\-based installers for
Mac OS X 10.4 or newer, and can only build installers that download
component son\-the\-fly for Mac OS X 10.5 or newer. If left blank, this value
will be set to the minimum version of Mac OS X that supports the requested
features. Set this variable to some value (e.g., 10.4) only if you want to
guarantee that your installer will work on that version of Mac OS X, and
don\(aqt mind missing extra features available in the installer shipping with
later versions of Mac OS X.
.UNINDENT
.SS CPackProductBuild
.sp
productbuild CPack generator (Mac OS X).
.SS Variables specific to CPack productbuild generator
.sp
The following variable is specific to installers built on Mac
OS X using productbuild:
.INDENT 0.0
.TP
.B CPACK_COMMAND_PRODUCTBUILD
Path to the productbuild(1) command used to generate a product archive for
the OS X Installer or Mac App Store. This variable can be used to override
the automatically detected command (or specify its location if the
auto\-detection fails to find it.)
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PRODUCTBUILD_IDENTITY_NAME
Adds a digital signature to the resulting package.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PRODUCTBUILD_KEYCHAIN_PATH
Specify a specific keychain to search for the signing identity.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_COMMAND_PKGBUILD
Path to the pkgbuild(1) command used to generate an OS X component package
on OS X. This variable can be used to override the automatically detected
command (or specify its location if the auto\-detection fails to find it.)
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PKGBUILD_IDENTITY_NAME
Adds a digital signature to the resulting package.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PKGBUILD_KEYCHAIN_PATH
Specify a specific keychain to search for the signing identity.
.UNINDENT
.SS CPackRPM
.sp
The built in (binary) CPack RPM generator (Unix only)
.SS Variables specific to CPack RPM generator
.sp
CPackRPM may be used to create RPM packages using \fBCPack\fP\&.
CPackRPM is a \fBCPack\fP generator thus it uses the \fBCPACK_XXX\fP
variables used by \fBCPack\fP\&.
.sp
CPackRPM has specific features which are controlled by the specifics
\fBCPACK_RPM_XXX\fP variables.
.sp
\fBCPACK_RPM_<COMPONENT>_XXXX\fP variables may be used in order to have
\fBcomponent\fP specific values. Note however that \fB<COMPONENT>\fP refers to the
\fBgrouping name\fP written in upper case. It may be either a component name or
a component GROUP name. Usually those variables correspond to RPM spec file
entities. One may find information about spec files here
\fI\%http://www.rpm.org/wiki/Docs\fP
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
\fI<COMPONENT>\fP part of variables is preferred to be in upper case (for e.g. if
component is named \fIfoo\fP then use \fICPACK_RPM_FOO_XXXX\fP variable name format)
as is with other \fICPACK_<COMPONENT>_XXXX\fP variables.
For the purposes of back compatibility (CMake/CPack version 3.5 and lower)
support for same cased component (e.g. \fIfOo\fP would be used as
\fICPACK_RPM_fOo_XXXX\fP) is still supported for variables defined in older
versions of CMake/CPack but is not guaranteed for variables that
will be added in the future. For the sake of back compatibility same cased
component variables also override upper cased versions where both are
present.
.UNINDENT
.UNINDENT
.sp
Here are some CPackRPM wiki resources that are here for historic reasons and
are no longer maintained but may still prove useful:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%https://cmake.org/Wiki/CMake:CPackConfiguration\fP
.IP \(bu 2
\fI\%https://cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29\fP
.UNINDENT
.UNINDENT
.UNINDENT
.sp
List of CPackRPM specific variables:
.INDENT 0.0
.TP
.B CPACK_RPM_COMPONENT_INSTALL
Enable component packaging for CPackRPM
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : OFF
.UNINDENT
.sp
If enabled (ON) multiple packages are generated. By default a single package
containing files of all components is generated.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_SUMMARY
.TP
.B CPACK_RPM_<component>_PACKAGE_SUMMARY
The RPM package summary.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : \fBCPACK_PACKAGE_DESCRIPTION_SUMMARY\fP
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_NAME
.TP
.B CPACK_RPM_<component>_PACKAGE_NAME
The RPM package name.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : \fBCPACK_PACKAGE_NAME\fP
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_FILE_NAME
.TP
.B CPACK_RPM_<component>_FILE_NAME
Package file name.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
.INDENT 2.0
.TP
.B Default
\fB<CPACK_PACKAGE_FILE_NAME>[\-<component>].rpm\fP with spaces
replaced by \(aq\-\(aq
.UNINDENT
.UNINDENT
.sp
This may be set to \fBRPM\-DEFAULT\fP to allow rpmbuild tool to generate package
file name by itself.
Alternatively provided package file name must end with \fB\&.rpm\fP suffix.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
By using user provided spec file, rpm macro extensions such as for
generating debuginfo packages or by simply using multiple components more
than one rpm file may be generated, either from a single spec file or from
multiple spec files (each component execution produces it\(aqs own spec file).
In such cases duplicate file names may occur as a result of this variable
setting or spec file content structure. Duplicate files get overwritten
and it is up to the packager to set the variables in a manner that will
prevent such errors.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_MAIN_COMPONENT
Main component that is packaged without component suffix.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
This variable can be set to any component or group name so that component or
group rpm package is generated without component suffix in filename and
package name.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_VERSION
The RPM package version.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : \fBCPACK_PACKAGE_VERSION\fP
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_ARCHITECTURE
.TP
.B CPACK_RPM_<component>_PACKAGE_ARCHITECTURE
The RPM package architecture.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : Native architecture output by \fBuname \-m\fP
.UNINDENT
.sp
This may be set to \fBnoarch\fP if you know you are building a noarch package.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_RELEASE
The RPM package release.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : 1
.UNINDENT
.sp
This is the numbering of the RPM package itself, i.e. the version of the
packaging and not the version of the content (see
\fI\%CPACK_RPM_PACKAGE_VERSION\fP). One may change the default value if
the previous packaging was buggy and/or you want to put here a fancy Linux
distro specific numbering.
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
This is the string that goes into the RPM \fBRelease:\fP field. Some distros
(e.g. Fedora, CentOS) require \fB1%{?dist}\fP format and not just a number.
\fB%{?dist}\fP part can be added by setting \fI\%CPACK_RPM_PACKAGE_RELEASE_DIST\fP\&.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_RELEASE_DIST
The dist tag that is added RPM \fBRelease:\fP field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : OFF
.UNINDENT
.sp
This is the reported \fB%{dist}\fP tag from the current distribution or empty
\fB%{dist}\fP if RPM macro is not set. If this variable is set then RPM
\fBRelease:\fP field value is set to \fB${CPACK_RPM_PACKAGE_RELEASE}%{?dist}\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_LICENSE
The RPM package license policy.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : "unknown"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_GROUP
.TP
.B CPACK_RPM_<component>_PACKAGE_GROUP
The RPM package group.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : "unknown"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_VENDOR
The RPM package vendor.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : CPACK_PACKAGE_VENDOR if set or "unknown"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_URL
.TP
.B CPACK_RPM_<component>_PACKAGE_URL
The projects URL.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_DESCRIPTION
.TP
.B CPACK_RPM_<component>_PACKAGE_DESCRIPTION
RPM package description.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : \fBCPACK_COMPONENT_<compName>_DESCRIPTION\fP (component
based installers only) if set, \fBCPACK_PACKAGE_DESCRIPTION_FILE\fP
if set or "no package description available"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_COMPRESSION_TYPE
RPM compression type.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to override RPM compression type to be used to build the
RPM. For example some Linux distribution now default to lzma or xz
compression whereas older cannot use such RPM. Using this one can enforce
compression type to be used.
.sp
Possible values are:
.INDENT 7.0
.IP \(bu 2
lzma
.IP \(bu 2
xz
.IP \(bu 2
bzip2
.IP \(bu 2
gzip
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_AUTOREQ
.TP
.B CPACK_RPM_<component>_PACKAGE_AUTOREQ
RPM spec autoreq field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to enable (1, yes) or disable (0, no) automatic shared libraries
dependency detection. Dependencies are added to requires list.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
By default automatic dependency detection is enabled by rpm generator.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_AUTOPROV
.TP
.B CPACK_RPM_<component>_PACKAGE_AUTOPROV
RPM spec autoprov field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to enable (1, yes) or disable (0, no) automatic listing of shared
libraries that are provided by the package. Shared libraries are added to
provides list.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
By default automatic provides detection is enabled by rpm generator.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_AUTOREQPROV
.TP
.B CPACK_RPM_<component>_PACKAGE_AUTOREQPROV
RPM spec autoreqprov field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
Variable enables/disables autoreq and autoprov at the same time.
See \fI\%CPACK_RPM_PACKAGE_AUTOREQ\fP and \fI\%CPACK_RPM_PACKAGE_AUTOPROV\fP
for more details.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
By default automatic detection feature is enabled by rpm.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_REQUIRES
.TP
.B CPACK_RPM_<component>_PACKAGE_REQUIRES
RPM spec requires field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set RPM dependencies (requires). Note that you must enclose
the complete requires string between quotes, for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The required package list of an RPM file could be printed with:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
rpm \-qp \-\-requires file.rpm
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_CONFLICTS
.TP
.B CPACK_RPM_<component>_PACKAGE_CONFLICTS
RPM spec conflicts field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set negative RPM dependencies (conflicts). Note that you must
enclose the complete requires string between quotes, for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_RPM_PACKAGE_CONFLICTS "libxml2")
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The conflicting package list of an RPM file could be printed with:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
rpm \-qp \-\-conflicts file.rpm
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_REQUIRES_PRE
.TP
.B CPACK_RPM_<component>_PACKAGE_REQUIRES_PRE
RPM spec requires(pre) field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set RPM preinstall dependencies (requires(pre)). Note that
you must enclose the complete requires string between quotes, for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_RPM_PACKAGE_REQUIRES_PRE "shadow\-utils, initscripts")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_REQUIRES_POST
.TP
.B CPACK_RPM_<component>_PACKAGE_REQUIRES_POST
RPM spec requires(post) field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set RPM postinstall dependencies (requires(post)). Note that
you must enclose the complete requires string between quotes, for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_RPM_PACKAGE_REQUIRES_POST "shadow\-utils, initscripts")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_REQUIRES_POSTUN
.TP
.B CPACK_RPM_<component>_PACKAGE_REQUIRES_POSTUN
RPM spec requires(postun) field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set RPM postuninstall dependencies (requires(postun)). Note
that you must enclose the complete requires string between quotes, for
example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_RPM_PACKAGE_REQUIRES_POSTUN "shadow\-utils, initscripts")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_REQUIRES_PREUN
.TP
.B CPACK_RPM_<component>_PACKAGE_REQUIRES_PREUN
RPM spec requires(preun) field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set RPM preuninstall dependencies (requires(preun)). Note that
you must enclose the complete requires string between quotes, for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_RPM_PACKAGE_REQUIRES_PREUN "shadow\-utils, initscripts")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_SUGGESTS
.TP
.B CPACK_RPM_<component>_PACKAGE_SUGGESTS
RPM spec suggest field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set weak RPM dependencies (suggests). Note that you must
enclose the complete requires string between quotes.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_PROVIDES
.TP
.B CPACK_RPM_<component>_PACKAGE_PROVIDES
RPM spec provides field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set RPM dependencies (provides). The provided package list
of an RPM file could be printed with:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
rpm \-qp \-\-provides file.rpm
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_OBSOLETES
.TP
.B CPACK_RPM_<component>_PACKAGE_OBSOLETES
RPM spec obsoletes field.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set RPM packages that are obsoleted by this one.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_RELOCATABLE
build a relocatable RPM.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : CPACK_PACKAGE_RELOCATABLE
.UNINDENT
.sp
If this variable is set to TRUE or ON CPackRPM will try
to build a relocatable RPM package. A relocatable RPM may
be installed using:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
rpm \-\-prefix or \-\-relocate
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
in order to install it at an alternate place see rpm(8). Note that
currently this may fail if \fBCPACK_SET_DESTDIR\fP is set to \fBON\fP\&. If
\fBCPACK_SET_DESTDIR\fP is set then you will get a warning message but
if there is file installed with absolute path you\(aqll get unexpected behavior.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_SPEC_INSTALL_POST
Deprecated \- use \fI\%CPACK_RPM_POST_INSTALL_SCRIPT_FILE\fP instead.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.IP \(bu 2
Deprecated: YES
.UNINDENT
.sp
This way of specifying post\-install script is deprecated, use
\fI\%CPACK_RPM_POST_INSTALL_SCRIPT_FILE\fP\&.
May be used to set an RPM post\-install command inside the spec file.
For example setting it to \fB/bin/true\fP may be used to prevent
rpmbuild to strip binaries.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_SPEC_MORE_DEFINE
RPM extended spec definitions lines.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to add any \fB%define\fP lines to the generated spec file.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_DEBUG
Toggle CPackRPM debug output.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be set when invoking cpack in order to trace debug information
during CPack RPM run. For example you may launch CPack like this:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack \-D CPACK_RPM_PACKAGE_DEBUG=1 \-G RPM
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_USER_BINARY_SPECFILE
.TP
.B CPACK_RPM_<componentName>_USER_BINARY_SPECFILE
A user provided spec file.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be set by the user in order to specify a USER binary spec file
to be used by CPackRPM instead of generating the file.
The specified file will be processed by configure_file( @ONLY).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
Spec file template.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
If set CPack will generate a template for USER specified binary
spec file and stop with an error. For example launch CPack like this:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack \-D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 \-G RPM
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The user may then use this file in order to hand\-craft is own
binary spec file which may be used with
\fI\%CPACK_RPM_USER_BINARY_SPECFILE\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
.TP
.B CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
Path to file containing pre (un)install script.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to embed a pre (un)installation script in the spec file.
The referred script file (or both) will be read and directly
put after the \fB%pre\fP or \fB%preun\fP section
If \fI\%CPACK_RPM_COMPONENT_INSTALL\fP is set to ON the (un)install
script for each component can be overridden with
\fBCPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE\fP and
\fBCPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE\fP\&.
One may verify which scriptlet has been included with:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
rpm \-qp \-\-scripts package.rpm
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_POST_INSTALL_SCRIPT_FILE
.TP
.B CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
Path to file containing post (un)install script.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to embed a post (un)installation script in the spec file.
The referred script file (or both) will be read and directly
put after the \fB%post\fP or \fB%postun\fP section.
If \fI\%CPACK_RPM_COMPONENT_INSTALL\fP is set to ON the (un)install
script for each component can be overridden with
\fBCPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE\fP and
\fBCPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE\fP\&.
One may verify which scriptlet has been included with:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
rpm \-qp \-\-scripts package.rpm
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_USER_FILELIST
.TP
.B CPACK_RPM_<COMPONENT>_USER_FILELIST
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to explicitly specify \fB%(<directive>)\fP file line
in the spec file. Like \fB%config(noreplace)\fP or any other directive
that be found in the \fB%files\fP section. You can have multiple directives
per line, as in \fB%attr(600,root,root) %config(noreplace)\fP\&. Since
CPackRPM is generating the list of files (and directories) the user
specified files of the \fBCPACK_RPM_<COMPONENT>_USER_FILELIST\fP list will
be removed from the generated list. If referring to directories do
not add a trailing slash.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_CHANGELOG_FILE
RPM changelog file.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to embed a changelog in the spec file.
The referred file will be read and directly put after the \fB%changelog\fP
section.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
list of path to be excluded.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include
.UNINDENT
.sp
May be used to exclude path (directories or files) from the auto\-generated
list of paths discovered by CPack RPM. The defaut value contains a
reasonable set of values if the variable is not defined by the user. If the
variable is defined by the user then CPackRPM will NOT any of the default
path. If you want to add some path to the default list then you can use
\fI\%CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION\fP variable.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
additional list of path to be excluded.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to add more exclude path (directories or files) from the initial
default list of excluded paths. See
\fI\%CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_RELOCATION_PATHS
Packages relocation paths list.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to specify more than one relocation path per relocatable RPM.
Variable contains a list of relocation paths that if relative are prefixed
by the value of \fI\%CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX\fP or by the
value of \fBCPACK_PACKAGING_INSTALL_PREFIX\fP if the component version
is not provided.
Variable is not component based as its content can be used to set a different
path prefix for e.g. binary dir and documentation dir at the same time.
Only prefixes that are required by a certain component are added to that
component \- component must contain at least one file/directory/symbolic link
with \fI\%CPACK_RPM_RELOCATION_PATHS\fP prefix for a certain relocation
path to be added. Package will not contain any relocation paths if there are
no files/directories/symbolic links on any of the provided prefix locations.
Packages that either do not contain any relocation paths or contain
files/directories/symbolic links that are outside relocation paths print
out an \fBAUTHOR_WARNING\fP that RPM will be partially relocatable.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX
Per component relocation path install prefix.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : CPACK_PACKAGING_INSTALL_PREFIX
.UNINDENT
.sp
May be used to set per component \fBCPACK_PACKAGING_INSTALL_PREFIX\fP
for relocatable RPM packages.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION
.TP
.B CPACK_RPM_NO_<COMPONENT>_INSTALL_PREFIX_RELOCATION
Removal of default install prefix from relocation paths list.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
.INDENT 2.0
.TP
.B Default
CPACK_PACKAGING_INSTALL_PREFIX or CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX
are treated as one of relocation paths
.UNINDENT
.UNINDENT
.sp
May be used to remove CPACK_PACKAGING_INSTALL_PREFIX and CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX
from relocatable RPM prefix paths.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_ADDITIONAL_MAN_DIRS
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set additional man dirs that could potentially be compressed
by brp\-compress RPM macro. Variable content must be a list of regular
expressions that point to directories containing man files or to man files
directly. Note that in order to compress man pages a path must also be
present in brp\-compress RPM script and that brp\-compress script must be
added to RPM configuration by the operating system.
.sp
Regular expressions that are added by default were taken from brp\-compress
RPM macro:
.INDENT 7.0
.IP \(bu 2
/usr/man/man.*
.IP \(bu 2
/usr/man/.*/man.*
.IP \(bu 2
/usr/info.*
.IP \(bu 2
/usr/share/man/man.*
.IP \(bu 2
/usr/share/man/.*/man.*
.IP \(bu 2
/usr/share/info.*
.IP \(bu 2
/usr/kerberos/man.*
.IP \(bu 2
/usr/X11R6/man/man.*
.IP \(bu 2
/usr/lib/perl5/man/man.*
.IP \(bu 2
/usr/share/doc/.*/man/man.*
.IP \(bu 2
/usr/lib/.*/man/man.*
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_DEFAULT_USER
.TP
.B CPACK_RPM_<compName>_DEFAULT_USER
default user ownership of RPM content
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : root
.UNINDENT
.sp
Value should be user name and not UID.
Note that <compName> must be in upper\-case.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_DEFAULT_GROUP
.TP
.B CPACK_RPM_<compName>_DEFAULT_GROUP
default group ownership of RPM content
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : root
.UNINDENT
.sp
Value should be group name and not GID.
Note that <compName> must be in upper\-case.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_DEFAULT_FILE_PERMISSIONS
.TP
.B CPACK_RPM_<compName>_DEFAULT_FILE_PERMISSIONS
default permissions used for packaged files
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \- (system default)
.UNINDENT
.sp
Accepted values are lists with \fBPERMISSIONS\fP\&. Valid permissions
are:
.INDENT 7.0
.IP \(bu 2
OWNER_READ
.IP \(bu 2
OWNER_WRITE
.IP \(bu 2
OWNER_EXECUTE
.IP \(bu 2
GROUP_READ
.IP \(bu 2
GROUP_WRITE
.IP \(bu 2
GROUP_EXECUTE
.IP \(bu 2
WORLD_READ
.IP \(bu 2
WORLD_WRITE
.IP \(bu 2
WORLD_EXECUTE
.UNINDENT
.sp
Note that <compName> must be in upper\-case.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_DEFAULT_DIR_PERMISSIONS
.TP
.B CPACK_RPM_<compName>_DEFAULT_DIR_PERMISSIONS
default permissions used for packaged directories
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \- (system default)
.UNINDENT
.sp
Accepted values are lists with PERMISSIONS. Valid permissions
are the same as for \fI\%CPACK_RPM_DEFAULT_FILE_PERMISSIONS\fP\&.
Note that <compName> must be in upper\-case.
.UNINDENT
.SS Packaging of Symbolic Links
.sp
CPackRPM supports packaging of symbolic links:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
execute_process(COMMAND ${CMAKE_COMMAND}
\-E create_symlink <relative_path_location> <symlink_name>)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/<symlink_name>
DESTINATION <symlink_location> COMPONENT libraries)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Symbolic links will be optimized (paths will be shortened if possible)
before being added to the package or if multiple relocation paths are
detected, a post install symlink relocation script will be generated.
.sp
Symbolic links may point to locations that are not packaged by the same
package (either a different component or even not packaged at all) but
those locations will be treated as if they were a part of the package
while determining if symlink should be either created or present in a
post install script \- depending on relocation paths.
.sp
Symbolic links that point to locations outside packaging path produce a
warning and are treated as non relocatable permanent symbolic links.
.sp
Currently there are a few limitations though:
.INDENT 0.0
.IP \(bu 2
For component based packaging component interdependency is not checked
when processing symbolic links. Symbolic links pointing to content of
a different component are treated the same way as if pointing to location
that will not be packaged.
.IP \(bu 2
Symbolic links pointing to a location through one or more intermediate
symbolic links will not be handled differently \- if the intermediate
symbolic link(s) is also on a relocatable path, relocating it during
package installation may cause initial symbolic link to point to an
invalid location.
.UNINDENT
.SS Packaging of debug information
.sp
Debuginfo packages contain debug symbols and sources for debugging packaged
binaries.
.sp
Debuginfo RPM packaging has it\(aqs own set of variables:
.INDENT 0.0
.TP
.B CPACK_RPM_DEBUGINFO_PACKAGE
.TP
.B CPACK_RPM_<component>_DEBUGINFO_PACKAGE
Enable generation of debuginfo RPM package(s).
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : OFF
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Binaries must contain debug symbols before packaging so use either \fBDebug\fP
or \fBRelWithDebInfo\fP for \fBCMAKE_BUILD_TYPE\fP variable value.
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Packages generated from packages without binary files, with binary files but
without execute permissions or without debug symbols will be empty.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BUILD_SOURCE_DIRS
Provides locations of root directories of source files from which binaries
were built.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES if \fI\%CPACK_RPM_DEBUGINFO_PACKAGE\fP is set
.IP \(bu 2
Default : \-
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
For CMake project \fI\%CPACK_BUILD_SOURCE_DIRS\fP is set by default to
point to \fBCMAKE_SOURCE_DIR\fP and \fBCMAKE_BINARY_DIR\fP paths.
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Sources with path prefixes that do not fall under any location provided with
\fI\%CPACK_BUILD_SOURCE_DIRS\fP will not be present in debuginfo package.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX
.TP
.B CPACK_RPM_<component>_BUILD_SOURCE_DIRS_PREFIX
Prefix of location where sources will be placed during package installation.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES if \fI\%CPACK_RPM_DEBUGINFO_PACKAGE\fP is set
.IP \(bu 2
.INDENT 2.0
.TP
.B Default
"/usr/src/debug/<CPACK_PACKAGE_FILE_NAME>" and
for component packaging "/usr/src/debug/<CPACK_PACKAGE_FILE_NAME>\-<component>"
.UNINDENT
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Each source path prefix is additionaly suffixed by \fBsrc_<index>\fP where
index is index of the path used from \fI\%CPACK_BUILD_SOURCE_DIRS\fP
variable. This produces \fB<CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX>/src_<index>\fP
replacement path.
Limitation is that replaced path part must be shorter or of equal
length than the length of its replacement. If that is not the case either
\fI\%CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX\fP variable has to be set to
a shorter path or source directories must be placed on a longer path.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS
Directories containing sources that should be excluded from debuginfo packages.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : "/usr /usr/src /usr/src/debug"
.UNINDENT
.sp
Listed paths are owned by other RPM packages and should therefore not be
deleted on debuginfo package uninstallation.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS_ADDITION
Paths that should be appended to \fI\%CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS\fP
for exclusion.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE
Create a single debuginfo package even if components packaging is set.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : OFF
.UNINDENT
.sp
When this variable is enabled it produces a single debuginfo package even if
component packaging is enabled.
.sp
When using this feature in combination with components packaging and there is
more than one component this variable requires \fI\%CPACK_RPM_MAIN_COMPONENT\fP
to be set.
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
If none of the \fI\%CPACK_RPM_<component>_DEBUGINFO_PACKAGE\fP variables
is set then \fI\%CPACK_RPM_DEBUGINFO_PACKAGE\fP is automatically set to
\fBON\fP when \fI\%CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE\fP is set.
.UNINDENT
.UNINDENT
.SS Packaging of sources (SRPM)
.sp
SRPM packaging is enabled by setting \fI\%CPACK_RPM_PACKAGE_SOURCES\fP
variable while usually using \fBCPACK_INSTALLED_DIRECTORIES\fP variable
to provide directory containing CMakeLists.txt and source files.
.sp
For CMake projects SRPM package would be product by executing:
.sp
\fBcpack \-G RPM \-\-config ./CPackSourceConfig.cmake\fP
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Produced SRPM package is expected to be built with \fBcmake(1)\fP executable
and packaged with \fBcpack(1)\fP executable so CMakeLists.txt has to be
located in root source directory and must be able to generate binary rpm
packages by executing \fBcpack \-G\fP command. The two executables as well as
rpmbuild must also be present when generating binary rpm packages from the
produced SRPM package.
.UNINDENT
.UNINDENT
.sp
Once the SRPM package is generated it can be used to generate binary packages
by creating a directory structure for rpm generation and executing rpmbuild
tool:
.sp
\fBmkdir \-p build_dir/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}\fP
\fBrpmbuild \-\-define "_topdir <path_to_build_dir>" \-\-rebuild <SRPM_file_name>\fP
.sp
Generated packages will be located in build_dir/RPMS directory or its sub
directories.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
SRPM package internally uses CPack/RPM generator to generate binary packages
so CMakeScripts.txt can decide during the SRPM to binary rpm generation step
what content the package(s) should have as well as how they should be packaged
(monolithic or components). CMake can decide this for e.g. by reading environment
variables set by the package manager before starting the process of generating
binary rpm packages. This way a single SRPM package can be used to produce
different binary rpm packages on different platforms depending on the platform\(aqs
packaging rules.
.UNINDENT
.UNINDENT
.sp
Source RPM packaging has it\(aqs own set of variables:
.INDENT 0.0
.TP
.B CPACK_RPM_PACKAGE_SOURCES
Should the content be packaged as a source rpm (default is binary rpm).
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : OFF
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
For cmake projects \fI\%CPACK_RPM_PACKAGE_SOURCES\fP variable is set
to \fBOFF\fP in CPackConfig.cmake and \fBON\fP in CPackSourceConfig.cmake
generated files.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_SOURCE_PKG_BUILD_PARAMS
Additional command\-line parameters provided to \fBcmake(1)\fP executable.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX
Packaging install prefix that would be provided in \fBCPACK_PACKAGING_INSTALL_PREFIX\fP
variable for producing binary RPM packages.
.INDENT 7.0
.IP \(bu 2
Mandatory : YES
.IP \(bu 2
Default : "/"
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RPM_BUILDREQUIRES
List of source rpm build dependencies.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : \-
.UNINDENT
.sp
May be used to set source RPM build dependencies (BuildRequires). Note that
you must enclose the complete build requirements string between quotes, for
example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(CPACK_RPM_BUILDREQUIRES "python >= 2.5.0, cmake >= 2.8")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS CPack
.sp
Build binary and source package installers.
.SS Variables common to all CPack generators
.sp
The
CPack module generates binary and source installers in a variety of
formats using the cpack program. Inclusion of the CPack module adds
two new targets to the resulting makefiles, package and
package_source, which build the binary and source installers,
respectively. The generated binary installers contain everything
installed via CMake\(aqs INSTALL command (and the deprecated
INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS commands).
.sp
For certain kinds of binary installers (including the graphical
installers on Mac OS X and Windows), CPack generates installers that
allow users to select individual application components to install.
See CPackComponent module for that.
.sp
The CPACK_GENERATOR variable has different meanings in different
contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a \fIlist of
generators\fP: when run with no other arguments, CPack will iterate over
that list and produce one package for each generator. In a
CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERATOR is a \fIstring naming
a single generator\fP\&. If you need per\-cpack\- generator logic to
control \fIother\fP cpack settings, then you need a
CPACK_PROJECT_CONFIG_FILE.
.sp
The CMake source tree itself contains a CPACK_PROJECT_CONFIG_FILE.
See the top level file CMakeCPackOptions.cmake.in for an example.
.sp
If set, the CPACK_PROJECT_CONFIG_FILE is included automatically on a
per\-generator basis. It only need contain overrides.
.sp
Here\(aqs how it works:
.INDENT 0.0
.IP \(bu 2
cpack runs
.IP \(bu 2
it includes CPackConfig.cmake
.IP \(bu 2
it iterates over the generators listed in that file\(aqs
CPACK_GENERATOR list variable (unless told to use just a
specific one via \-G on the command line...)
.IP \(bu 2
foreach generator, it then
.INDENT 2.0
.IP \(bu 2
sets CPACK_GENERATOR to the one currently being iterated
.IP \(bu 2
includes the CPACK_PROJECT_CONFIG_FILE
.IP \(bu 2
produces the package for that generator
.UNINDENT
.UNINDENT
.sp
This is the key: For each generator listed in CPACK_GENERATOR in
CPackConfig.cmake, cpack will \fIreset\fP CPACK_GENERATOR internally to
\fIthe one currently being used\fP and then include the
CPACK_PROJECT_CONFIG_FILE.
.sp
Before including this CPack module in your CMakeLists.txt file, there
are a variety of variables that can be set to customize the resulting
installers. The most commonly\-used variables are:
.INDENT 0.0
.TP
.B CPACK_PACKAGE_NAME
The name of the package (or application). If not specified, defaults to
the project name.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_VENDOR
The name of the package vendor. (e.g., "Kitware").
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_DIRECTORY
The directory in which CPack is doing its packaging. If it is not set
then this will default (internally) to the build dir. This variable may
be defined in CPack config file or from the cpack command line option
"\-B". If set the command line option override the value found in the
config file.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_VERSION_MAJOR
Package major Version
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_VERSION_MINOR
Package minor Version
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_VERSION_PATCH
Package patch Version
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_DESCRIPTION_FILE
A text file used to describe the project. Used, for example, the
introduction screen of a CPack\-generated Windows installer to describe
the project.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_DESCRIPTION_SUMMARY
Short description of the project (only a few words).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_FILE_NAME
The name of the package file to generate, not including the
extension. For example, cmake\-2.6.1\-Linux\-i686. The default value is:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
${CPACK_PACKAGE_NAME}\-${CPACK_PACKAGE_VERSION}\-${CPACK_SYSTEM_NAME}.
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_INSTALL_DIRECTORY
Installation directory on the target system. This may be used by some
CPack generators like NSIS to create an installation directory e.g.,
"CMake 2.5" below the installation prefix. All installed element will be
put inside this directory.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_ICON
A branding image that will be displayed inside the installer (used by GUI
installers).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_CHECKSUM
An algorithm that will be used to generate additional file with checksum
of the package. Output file name will be:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
${CPACK_PACKAGE_FILE_NAME}.${CPACK_PACKAGE_CHECKSUM}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Supported algorithms are those listed by the
string(<HASH>)
command.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PROJECT_CONFIG_FILE
CPack\-time project CPack configuration file. This file included at cpack
time, once per generator after CPack has set CPACK_GENERATOR to the
actual generator being used. It allows per\-generator setting of CPACK_*
variables at cpack time.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RESOURCE_FILE_LICENSE
License to be embedded in the installer. It will typically be displayed
to the user by the produced installer (often with an explicit "Accept"
button, for graphical installers) prior to installation. This license
file is NOT added to installed file but is used by some CPack generators
like NSIS. If you want to install a license file (may be the same as this
one) along with your project you must add an appropriate CMake INSTALL
command in your CMakeLists.txt.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RESOURCE_FILE_README
ReadMe file to be embedded in the installer. It typically describes in
some detail the purpose of the project during the installation. Not all
CPack generators uses this file.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_RESOURCE_FILE_WELCOME
Welcome file to be embedded in the installer. It welcomes users to this
installer. Typically used in the graphical installers on Windows and Mac
OS X.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_MONOLITHIC_INSTALL
Disables the component\-based installation mechanism. When set the
component specification is ignored and all installed items are put in a
single "MONOLITHIC" package. Some CPack generators do monolithic
packaging by default and may be asked to do component packaging by
setting CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_GENERATOR
List of CPack generators to use. If not specified, CPack will create a
set of options CPACK_BINARY_<GENNAME> (e.g., CPACK_BINARY_NSIS) allowing
the user to enable/disable individual generators. This variable may be
used on the command line as well as in:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
cpack \-D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_OUTPUT_CONFIG_FILE
The name of the CPack binary configuration file. This file is the CPack
configuration generated by the CPack module for binary
installers. Defaults to CPackConfig.cmake.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_EXECUTABLES
Lists each of the executables and associated text label to be used to
create Start Menu shortcuts. For example, setting this to the list
ccmake;CMake will create a shortcut named "CMake" that will execute the
installed executable ccmake. Not all CPack generators use it (at least
NSIS, WIX and OSXX11 do).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_STRIP_FILES
List of files to be stripped. Starting with CMake 2.6.0 CPACK_STRIP_FILES
will be a boolean variable which enables stripping of all files (a list
of files evaluates to TRUE in CMake, so this change is compatible).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_VERBATIM_VARIABLES
If set to TRUE, values of variables prefixed with \fI\%CPACK\fP will be escaped
before being written to the configuration files, so that the cpack program
receives them exactly as they were specified. If not, characters like quotes
and backslashes can cause parsing errors or alter the value received by the
cpack program. Defaults to FALSE for backwards compatibility.
.INDENT 7.0
.IP \(bu 2
Mandatory : NO
.IP \(bu 2
Default : FALSE
.UNINDENT
.UNINDENT
.sp
The following CPack variables are specific to source packages, and
will not affect binary packages:
.INDENT 0.0
.TP
.B CPACK_SOURCE_PACKAGE_FILE_NAME
The name of the source package. For example cmake\-2.6.1.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_SOURCE_STRIP_FILES
List of files in the source tree that will be stripped. Starting with
CMake 2.6.0 CPACK_SOURCE_STRIP_FILES will be a boolean variable which
enables stripping of all files (a list of files evaluates to TRUE in
CMake, so this change is compatible).
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_SOURCE_GENERATOR
List of generators used for the source packages. As with CPACK_GENERATOR,
if this is not specified then CPack will create a set of options (e.g.,
CPACK_SOURCE_ZIP) allowing users to select which packages will be
generated.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_SOURCE_OUTPUT_CONFIG_FILE
The name of the CPack source configuration file. This file is the CPack
configuration generated by the CPack module for source
installers. Defaults to CPackSourceConfig.cmake.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_SOURCE_IGNORE_FILES
Pattern of files in the source tree that won\(aqt be packaged when building
a source package. This is a list of regular expression patterns (that
must be properly escaped), e.g.,
/CVS/;/\e.svn/;\e.swp$;\e.#;/#;.*~;cscope.*
.UNINDENT
.sp
The following variables are for advanced uses of CPack:
.INDENT 0.0
.TP
.B CPACK_CMAKE_GENERATOR
What CMake generator should be used if the project is CMake
project. Defaults to the value of CMAKE_GENERATOR few users will want to
change this setting.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_INSTALL_CMAKE_PROJECTS
List of four values that specify what project to install. The four values
are: Build directory, Project Name, Project Component, Directory. If
omitted, CPack will build an installer that installs everything.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_SYSTEM_NAME
System name, defaults to the value of ${CMAKE_SYSTEM_NAME}.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_VERSION
Package full version, used internally. By default, this is built from
CPACK_PACKAGE_VERSION_MAJOR, CPACK_PACKAGE_VERSION_MINOR, and
CPACK_PACKAGE_VERSION_PATCH.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_TOPLEVEL_TAG
Directory for the installed files.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_INSTALL_COMMANDS
Extra commands to install components.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_INSTALLED_DIRECTORIES
Extra directories to install.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_PACKAGE_INSTALL_REGISTRY_KEY
Registry key used when installing this project. This is only used by
installer for Windows. The default value is based on the installation
directory.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_CREATE_DESKTOP_LINKS
List of desktop links to create.
Each desktop link requires a corresponding start menu shortcut
as created by \fI\%CPACK_PACKAGE_EXECUTABLES\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_BINARY_<GENNAME>
CPack generated options for binary generators. The CPack.cmake module
generates (when CPACK_GENERATOR is not set) a set of CMake options (see
CMake option command) which may then be used to select the CPack
generator(s) to be used when launching the package target.
.sp
Provide options to choose generators we might check here if the required
tools for the generates exist and set the defaults according to the results
.UNINDENT
.SS CPackWIX
.sp
CPack WiX generator specific options
.SS Variables specific to CPack WiX generator
.sp
The following variables are specific to the installers built on
Windows using WiX.
.INDENT 0.0
.TP
.B CPACK_WIX_UPGRADE_GUID
Upgrade GUID (\fBProduct/@UpgradeCode\fP)
.sp
Will be automatically generated unless explicitly provided.
.sp
It should be explicitly set to a constant generated globally unique
identifier (GUID) to allow your installers to replace existing
installations that use the same GUID.
.sp
You may for example explicitly set this variable in your
CMakeLists.txt to the value that has been generated per default. You
should not use GUIDs that you did not generate yourself or which may
belong to other projects.
.sp
A GUID shall have the following fixed length syntax:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
XXXXXXXX\-XXXX\-XXXX\-XXXX\-XXXXXXXXXXXX
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
(each X represents an uppercase hexadecimal digit)
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_PRODUCT_GUID
Product GUID (\fBProduct/@Id\fP)
.sp
Will be automatically generated unless explicitly provided.
.sp
If explicitly provided this will set the Product Id of your installer.
.sp
The installer will abort if it detects a pre\-existing installation that
uses the same GUID.
.sp
The GUID shall use the syntax described for CPACK_WIX_UPGRADE_GUID.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_LICENSE_RTF
RTF License File
.sp
If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used as\-is.
.sp
If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is implicitly
converted to RTF by the WiX Generator.
The expected encoding of the .txt file is UTF\-8.
.sp
With CPACK_WIX_LICENSE_RTF you can override the license file used by the
WiX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported
format or the .txt \-> .rtf conversion does not work as expected.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_PRODUCT_ICON
The Icon shown next to the program name in Add/Remove programs.
.sp
If set, this icon is used in place of the default icon.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_UI_REF
This variable allows you to override the Id of the \fB<UIRef>\fP element
in the WiX template.
.sp
The default is \fBWixUI_InstallDir\fP in case no CPack components have
been defined and \fBWixUI_FeatureTree\fP otherwise.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_UI_BANNER
The bitmap will appear at the top of all installer pages other than the
welcome and completion dialogs.
.sp
If set, this image will replace the default banner image.
.sp
This image must be 493 by 58 pixels.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_UI_DIALOG
Background bitmap used on the welcome and completion dialogs.
.sp
If this variable is set, the installer will replace the default dialog
image.
.sp
This image must be 493 by 312 pixels.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_PROGRAM_MENU_FOLDER
Start menu folder name for launcher.
.sp
If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_CULTURES
Language(s) of the installer
.sp
Languages are compiled into the WixUI extension library. To use them,
simply provide the name of the culture. If you specify more than one
culture identifier in a comma or semicolon delimited list, the first one
that is found will be used. You can find a list of supported languages at:
\fI\%http://wix.sourceforge.net/manual\-wix3/WixUI_localization.htm\fP
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_TEMPLATE
Template file for WiX generation
.sp
If this variable is set, the specified template will be used to generate
the WiX wxs file. This should be used if further customization of the
output is required.
.sp
If this variable is not set, the default MSI template included with CMake
will be used.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_PATCH_FILE
Optional list of XML files with fragments to be inserted into
generated WiX sources
.sp
This optional variable can be used to specify an XML file that the
WiX generator will use to inject fragments into its generated
source files.
.sp
Patch files understood by the CPack WiX generator
roughly follow this RELAX NG compact schema:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
start = CPackWiXPatch
CPackWiXPatch = element CPackWiXPatch { CPackWiXFragment* }
CPackWiXFragment = element CPackWiXFragment
{
attribute Id { string },
fragmentContent*
}
fragmentContent = element * \- CPackWiXFragment
{
(attribute * { text } | text | fragmentContent)*
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Currently fragments can be injected into most
Component, File, Directory and Feature elements.
.sp
The following additional special Ids can be used:
.INDENT 7.0
.IP \(bu 2
\fB#PRODUCT\fP for the \fB<Product>\fP element.
.IP \(bu 2
\fB#PRODUCTFEATURE\fP for the root \fB<Feature>\fP element.
.UNINDENT
.sp
The following example illustrates how this works.
.sp
Given that the WiX generator creates the following XML element:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<Component Id="CM_CP_applications.bin.my_libapp.exe" Guid="*"/>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following XML patch file may be used to inject an Environment element
into it:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<CPackWiXPatch>
<CPackWiXFragment Id="CM_CP_applications.bin.my_libapp.exe">
<Environment Id="MyEnvironment" Action="set"
Name="MyVariableName" Value="MyVariableValue"/>
</CPackWiXFragment>
</CPackWiXPatch>
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_EXTRA_SOURCES
Extra WiX source files
.sp
This variable provides an optional list of extra WiX source files (.wxs)
that should be compiled and linked. The full path to source files is
required.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_EXTRA_OBJECTS
Extra WiX object files or libraries
.sp
This variable provides an optional list of extra WiX object (.wixobj)
and/or WiX library (.wixlib) files. The full path to objects and libraries
is required.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_EXTENSIONS
This variable provides a list of additional extensions for the WiX
tools light and candle.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_<TOOL>_EXTENSIONS
This is the tool specific version of CPACK_WIX_EXTENSIONS.
\fB<TOOL>\fP can be either LIGHT or CANDLE.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_<TOOL>_EXTRA_FLAGS
This list variable allows you to pass additional
flags to the WiX tool \fB<TOOL>\fP\&.
.sp
Use it at your own risk.
Future versions of CPack may generate flags which may be in conflict
with your own flags.
.sp
\fB<TOOL>\fP can be either LIGHT or CANDLE.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_CMAKE_PACKAGE_REGISTRY
If this variable is set the generated installer will create
an entry in the windows registry key
\fBHKEY_LOCAL_MACHINE\eSoftware\eKitware\eCMake\ePackages\e<package>\fP
The value for \fB<package>\fP is provided by this variable.
.sp
Assuming you also install a CMake configuration file this will
allow other CMake projects to find your package with
the \fBfind_package()\fP command.
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_PROPERTY_<PROPERTY>
This variable can be used to provide a value for
the Windows Installer property \fB<PROPERTY>\fP
.sp
The following list contains some example properties that can be used to
customize information under
"Programs and Features" (also known as "Add or Remove Programs")
.INDENT 7.0
.IP \(bu 2
ARPCOMMENTS \- Comments
.IP \(bu 2
ARPHELPLINK \- Help and support information URL
.IP \(bu 2
ARPURLINFOABOUT \- General information URL
.IP \(bu 2
ARPURLUPDATEINFO \- Update information URL
.IP \(bu 2
ARPHELPTELEPHONE \- Help and support telephone number
.IP \(bu 2
ARPSIZE \- Size (in kilobytes) of the application
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B CPACK_WIX_ROOT_FEATURE_TITLE
.UNINDENT
.sp
Sets the name of the root install feature in the WIX installer. Same as
CPACK_COMPONENT_<compName>_DISPLAY_NAME for components.
.INDENT 0.0
.TP
.B CPACK_WIX_ROOT_FEATURE_DESCRIPTION
.UNINDENT
.sp
Sets the description of the root install feature in the WIX installer. Same as
CPACK_COMPONENT_<compName>_DESCRIPTION for components.
.INDENT 0.0
.TP
.B CPACK_WIX_SKIP_PROGRAM_FOLDER
.UNINDENT
.sp
If this variable is set to true, the default install location
of the generated package will be CPACK_PACKAGE_INSTALL_DIRECTORY directly.
The install location will not be located relatively below
ProgramFiles or ProgramFiles64.
.INDENT 0.0
.INDENT 3.5
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Installers created with this feature do not take differences
between the system on which the installer is created
and the system on which the installer might be used into account.
.sp
It is therefor possible that the installer e.g. might try to install
onto a drive that is unavailable or unintended or a path that does not
follow the localization or convention of the system on which the
installation is performed.
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.SS CSharpUtilities
.sp
Functions to make configuration of CSharp/.NET targets easier.
.sp
A collection of CMake utility functions useful for dealing with CSharp
targets for Visual Studio generators from version 2010 and later.
.sp
The following functions are provided by this module:
.sp
\fBMain functions\fP
.INDENT 0.0
.IP \(bu 2
\fI\%csharp_set_windows_forms_properties()\fP
.IP \(bu 2
\fI\%csharp_set_designer_cs_properties()\fP
.IP \(bu 2
\fI\%csharp_set_xaml_cs_properties()\fP
.UNINDENT
.sp
\fBHelper functions\fP
.INDENT 0.0
.IP \(bu 2
\fI\%csharp_get_filename_keys()\fP
.IP \(bu 2
\fI\%csharp_get_filename_key_base()\fP
.IP \(bu 2
\fI\%csharp_get_dependentupon_name()\fP
.UNINDENT
.SS Main functions provided by the module
.INDENT 0.0
.TP
.B csharp_set_windows_forms_properties
Sets source file properties for use of Windows Forms. Use this, if your CSharp
target uses Windows Forms:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
csharp_set_windows_forms_properties([<file1> [<file2> [...]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fB<fileN>\fP
List of all source files which are relevant for setting the
\fBVS_CSHARP_<tagname>\fP properties (including \fB\&.cs\fP, \fB\&.resx\fP and
\fB\&.Designer.cs\fP extensions).
.UNINDENT
.sp
In the list of all given files for all files ending with \fB\&.Designer.cs\fP and
\fB\&.resx\fP is searched. For every \fIdesigner\fP or \fIresource\fP file a file with the
same base name but only \fB\&.cs\fP as extension is searched. If this is found, the
\fBVS_CSHARP_<tagname>\fP properties are set as follows:
.INDENT 7.0
.TP
for the \fB\&.cs\fP file:
.INDENT 7.0
.IP \(bu 2
VS_CSHARP_SubType "Form"
.UNINDENT
.TP
for the \fB\&.Designer.cs\fP file (if it exists):
.INDENT 7.0
.IP \(bu 2
VS_CSHARP_DependentUpon <cs\-filename>
.IP \(bu 2
VS_CSHARP_DesignTime "" (delete tag if previously defined)
.IP \(bu 2
VS_CSHARP_AutoGen ""(delete tag if previously defined)
.UNINDENT
.TP
for the \fB\&.resx\fP file (if it exists):
.INDENT 7.0
.IP \(bu 2
VS_RESOURCE_GENERATOR "" (delete tag if previously defined)
.IP \(bu 2
VS_CSHARP_DependentUpon <cs\-filename>
.IP \(bu 2
VS_CSHARP_SubType "Designer"
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B csharp_set_designer_cs_properties
Sets source file properties of \fB\&.Designer.cs\fP files depending on
sibling filenames. Use this, if your CSharp target does \fBnot\fP
use Windows Forms (for Windows Forms use
\fI\%csharp_set_designer_cs_properties()\fP instead):
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
csharp_set_designer_cs_properties([<file1> [<file2> [...]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fB<fileN>\fP
List of all source files which are relevant for setting the
\fBVS_CSHARP_<tagname>\fP properties (including \fB\&.cs\fP,
\fB\&.resx\fP, \fB\&.settings\fP and \fB\&.Designer.cs\fP extensions).
.UNINDENT
.sp
In the list of all given files for all files ending with
\fB\&.Designer.cs\fP is searched. For every \fIdesigner\fP file all files
with the same base name but different extensions are searched. If
a match is found, the source file properties of the \fIdesigner\fP file
are set depending on the extension of the matched file:
.INDENT 7.0
.TP
if match is \fB\&.resx\fP file:
.INDENT 7.0
.IP \(bu 2
VS_CSHARP_AutoGen "True"
.IP \(bu 2
VS_CSHARP_DesignTime "True"
.IP \(bu 2
VS_CSHARP_DependentUpon <resx\-filename>
.UNINDENT
.TP
if match is \fB\&.cs\fP file:
.INDENT 7.0
.IP \(bu 2
VS_CSHARP_DependentUpon <cs\-filename>
.UNINDENT
.TP
if match is \fB\&.settings\fP file:
.INDENT 7.0
.IP \(bu 2
VS_CSHARP_AutoGen "True"
.IP \(bu 2
VS_CSHARP_DesignTimeSharedInput "True"
.IP \(bu 2
VS_CSHARP_DependentUpon <settings\-filename>
.UNINDENT
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Because the source file properties of the \fB\&.Designer.cs\fP file are set according
to the found matches and every match sets the \fBVS_CSHARP_DependentUpon\fP
property, there should only be one match for each \fBDesigner.cs\fP file.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B csharp_set_xaml_cs_properties
Sets source file properties for use of Windows Presentation Foundation (WPF) and
XAML. Use this, if your CSharp target uses WPF/XAML:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
csharp_set_xaml_cs_properties([<file1> [<file2> [...]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fB<fileN>\fP
List of all source files which are relevant for setting the
\fBVS_CSHARP_<tagname>\fP properties (including \fB\&.cs\fP,
\fB\&.xaml\fP, and \fB\&.xaml.cs\fP extensions).
.UNINDENT
.sp
In the list of all given files for all files ending with
\fB\&.xaml.cs\fP is searched. For every \fIxaml\-cs\fP file, a file
with the same base name but extension \fB\&.xaml\fP is searched.
If a match is found, the source file properties of the \fB\&.xaml.cs\fP
file are set:
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
VS_CSHARP_DependentUpon <xaml\-filename>
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.SS Helper functions which are used by the above ones
.INDENT 0.0
.TP
.B csharp_get_filename_keys
Helper function which computes a list of key values to identify
source files independently of relative/absolute paths given in cmake
and eliminates case sensitivity:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
csharp_get_filename_keys(OUT [<file1> [<file2> [...]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBOUT\fP
Name of the variable in which the list of keys is stored
.TP
.B \fB<fileN>\fP
filename(s) as given to to CSharp target using \fBadd_library()\fP
or \fBadd_executable()\fP
.UNINDENT
.sp
In some way the function applies a canonicalization to the source names.
This is necessary to find file matches if the files have been added to
the target with different directory prefixes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
add_library(lib
myfile.cs
${CMAKE_CURRENT_SOURCE_DIR}/myfile.Designer.cs)
set_source_files_properties(myfile.Designer.cs PROPERTIES
VS_CSHARP_DependentUpon myfile.cs)
# this will fail, because in cmake
# \- ${CMAKE_CURRENT_SOURCE_DIR}/myfile.Designer.cs
# \- myfile.Designer.cs
# are not the same source file. The source file property is not set.
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B csharp_get_filename_key_base
Returns the full filepath and name \fBwithout\fP extension of a key.
KEY is expected to be a key from csharp_get_filename_keys. In BASE
the value of KEY without the file extension is returned:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
csharp_get_filename_key_base(BASE KEY)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBBASE\fP
Name of the variable with the computed "base" of \fBKEY\fP\&.
.TP
.B \fBKEY\fP
The key of which the base will be computed. Expected to be a
upper case full filename.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B csharp_get_dependentupon_name
Computes a string which can be used as value for the source file property
\fBVS_CSHARP_<tagname>\fP with \fItarget\fP being \fBDependentUpon\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
csharp_get_dependentupon_name(NAME FILE)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBNAME\fP
Name of the variable with the result value
.TP
.B \fBFILE\fP
Filename to convert to \fB<DependentUpon>\fP value
.UNINDENT
.sp
Actually this is only the filename without any path given at the moment.
.UNINDENT
.SS CTest
.sp
Configure a project for testing with CTest/CDash
.sp
Include this module in the top CMakeLists.txt file of a project to
enable testing with CTest and dashboard submissions to CDash:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
project(MyProject)
\&...
include(CTest)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The module automatically creates a \fBBUILD_TESTING\fP option that selects
whether to enable testing support (\fBON\fP by default). After including
the module, use code like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
if(BUILD_TESTING)
# ... CMake code to create tests ...
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
to creating tests when testing is enabled.
.sp
To enable submissions to a CDash server, create a \fBCTestConfig.cmake\fP
file at the top of the project with content such as:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CTEST_PROJECT_NAME "MyProject")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
set(CTEST_DROP_SITE_CDASH TRUE)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
(the CDash server can provide the file to a project administrator who
configures \fBMyProject\fP). Settings in the config file are shared by
both this \fBCTest\fP module and the \fBctest(1)\fP command\-line
Dashboard Client mode (\fBctest \-S\fP).
.sp
While building a project for submission to CDash, CTest scans the
build output for errors and warnings and reports them with surrounding
context from the build log. This generic approach works for all build
tools, but does not give details about the command invocation that
produced a given problem. One may get more detailed reports by setting
the \fBCTEST_USE_LAUNCHERS\fP variable:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CTEST_USE_LAUNCHERS 1)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
in the \fBCTestConfig.cmake\fP file.
.SS CTestCoverageCollectGCOV
.sp
This module provides the \fBctest_coverage_collect_gcov\fP function.
.sp
This function runs gcov on all .gcda files found in the binary tree
and packages the resulting .gcov files into a tar file.
This tarball also contains the following:
.INDENT 0.0
.IP \(bu 2
\fIdata.json\fP defines the source and build directories for use by CDash.
.IP \(bu 2
\fILabels.json\fP indicates any \fBLABELS\fP that have been set on the
source files.
.IP \(bu 2
The \fIuncovered\fP directory holds any uncovered files found by
\fBCTEST_EXTRA_COVERAGE_GLOB\fP\&.
.UNINDENT
.sp
After generating this tar file, it can be sent to CDash for display with the
\fBctest_submit(CDASH_UPLOAD)\fP command.
.INDENT 0.0
.TP
.B cdash_coverage_collect_gcov
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ctest_coverage_collect_gcov(TARBALL <tarfile>
[SOURCE <source_dir>][BUILD <build_dir>]
[GCOV_COMMAND <gcov_command>]
[GCOV_OPTIONS <options>...]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Run gcov and package a tar file for CDash. The options are:
.INDENT 7.0
.TP
.B \fBTARBALL <tarfile>\fP
Specify the location of the \fB\&.tar\fP file to be created for later
upload to CDash. Relative paths will be interpreted with respect
to the top\-level build directory.
.TP
.B \fBSOURCE <source_dir>\fP
Specify the top\-level source directory for the build.
Default is the value of \fBCTEST_SOURCE_DIRECTORY\fP\&.
.TP
.B \fBBUILD <build_dir>\fP
Specify the top\-level build directory for the build.
Default is the value of \fBCTEST_BINARY_DIRECTORY\fP\&.
.TP
.B \fBGCOV_COMMAND <gcov_command>\fP
Specify the full path to the \fBgcov\fP command on the machine.
Default is the value of \fBCTEST_COVERAGE_COMMAND\fP\&.
.TP
.B \fBGCOV_OPTIONS <options>...\fP
Specify options to be passed to gcov. The \fBgcov\fP command
is run as \fBgcov <options>... \-o <gcov\-dir> <file>.gcda\fP\&.
If not specified, the default option is just \fB\-b\fP\&.
.TP
.B \fBGLOB\fP
Recursively search for .gcda files in build_dir rather than
determining search locations by reading TargetDirectories.txt.
.TP
.B \fBDELETE\fP
Delete coverage files after they\(aqve been packaged into the .tar.
.TP
.B \fBQUIET\fP
Suppress non\-error messages that otherwise would have been
printed out by this function.
.UNINDENT
.UNINDENT
.SS CTestScriptMode
.sp
This file is read by ctest in script mode (\-S)
.SS CTestUseLaunchers
.sp
Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
.sp
CTestUseLaunchers is automatically included when you include(CTest).
However, it is split out into its own module file so projects can use
the CTEST_USE_LAUNCHERS functionality independently.
.sp
To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest \-S
dashboard script, and then also set it in the cache of the configured
project. Both cmake and ctest need to know the value of it for the
launchers to work properly. CMake needs to know in order to generate
proper build rules, and ctest, in order to produce the proper error
and warning analysis.
.sp
For convenience, you may set the ENV variable
CTEST_USE_LAUNCHERS_DEFAULT in your ctest \-S script, too. Then, as
long as your CMakeLists uses include(CTest) or
include(CTestUseLaunchers), it will use the value of the ENV variable
to initialize a CTEST_USE_LAUNCHERS cache variable. This cache
variable initialization only occurs if CTEST_USE_LAUNCHERS is not
already defined. If CTEST_USE_LAUNCHERS is on in a ctest \-S script
the ctest_configure command will add \-DCTEST_USE_LAUNCHERS:BOOL=TRUE
to the cmake command used to configure the project.
.SS Dart
.sp
Configure a project for testing with CTest or old Dart Tcl Client
.sp
This file is the backwards\-compatibility version of the CTest module.
It supports using the old Dart 1 Tcl client for driving dashboard
submissions as well as testing with CTest. This module should be
included in the CMakeLists.txt file at the top of a project. Typical
usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include(Dart)
if(BUILD_TESTING)
# ... testing related CMake code ...
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The BUILD_TESTING option is created by the Dart module to determine
whether testing support should be enabled. The default is ON.
.SS DeployQt4
.sp
Functions to help assemble a standalone Qt4 executable.
.sp
A collection of CMake utility functions useful for deploying Qt4
executables.
.sp
The following functions are provided by this module:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
write_qt4_conf
resolve_qt4_paths
fixup_qt4_executable
install_qt4_plugin_path
install_qt4_plugin
install_qt4_executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Requires CMake 2.6 or greater because it uses function and
PARENT_SCOPE. Also depends on BundleUtilities.cmake.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
WRITE_QT4_CONF(<qt_conf_dir> <qt_conf_contents>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Writes a qt.conf file with the <qt_conf_contents> into <qt_conf_dir>.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
RESOLVE_QT4_PATHS(<paths_var> [<executable_path>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Loop through <paths_var> list and if any don\(aqt exist resolve them
relative to the <executable_path> (if supplied) or the
CMAKE_INSTALL_PREFIX.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FIXUP_QT4_EXECUTABLE(<executable>
[<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Copies Qt plugins, writes a Qt configuration file (if needed) and
fixes up a Qt4 executable using BundleUtilities so it is standalone
and can be drag\-and\-drop copied to another machine as long as all of
the system libraries are compatible.
.sp
<executable> should point to the executable to be fixed\-up.
.sp
<qtplugins> should contain a list of the names or paths of any Qt
plugins to be installed.
.sp
<libs> will be passed to BundleUtilities and should be a list of any
already installed plugins, libraries or executables to also be
fixed\-up.
.sp
<dirs> will be passed to BundleUtilities and should contain and
directories to be searched to find library dependencies.
.sp
<plugins_dir> allows an custom plugins directory to be used.
.sp
<request_qt_conf> will force a qt.conf file to be written even if not
needed.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var
<plugins_dir> <component> <configurations>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Install (or copy) a resolved <plugin> to the default plugins directory
(or <plugins_dir>) relative to <executable> and store the result in
<installed_plugin_path_var>.
.sp
If <copy> is set to TRUE then the plugins will be copied rather than
installed. This is to allow this module to be used at CMake time
rather than install time.
.sp
If <component> is set then anything installed will use this COMPONENT.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var
<plugins_dir> <component>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Install (or copy) an unresolved <plugin> to the default plugins
directory (or <plugins_dir>) relative to <executable> and store the
result in <installed_plugin_path_var>. See documentation of
INSTALL_QT4_PLUGIN_PATH.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
INSTALL_QT4_EXECUTABLE(<executable>
[<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Installs Qt plugins, writes a Qt configuration file (if needed) and
fixes up a Qt4 executable using BundleUtilities so it is standalone
and can be drag\-and\-drop copied to another machine as long as all of
the system libraries are compatible. The executable will be fixed\-up
at install time. <component> is the COMPONENT used for bundle fixup
and plugin installation. See documentation of FIXUP_QT4_BUNDLE.
.SS Documentation
.sp
DocumentationVTK.cmake
.sp
This file provides support for the VTK documentation framework. It
relies on several tools (Doxygen, Perl, etc).
.SS ExternalData
.sp
Manage data files stored outside source tree
.SS Introduction
.sp
Use this module to unambiguously reference data files stored outside
the source tree and fetch them at build time from arbitrary local and
remote content\-addressed locations. Functions provided by this module
recognize arguments with the syntax \fBDATA{<name>}\fP as references to
external data, replace them with full paths to local copies of those
data, and create build rules to fetch and update the local copies.
.sp
For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include(ExternalData)
set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)"
"file:////host/share/%(algo)/%(hash)"
"http://data.org/%(algo)/%(hash)")
ExternalData_Add_Test(MyData
NAME MyTest
COMMAND MyExe DATA{MyInput.png}
)
ExternalData_Add_Target(MyData)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
When test \fBMyTest\fP runs the \fBDATA{MyInput.png}\fP argument will be
replaced by the full path to a real instance of the data file
\fBMyInput.png\fP on disk. If the source tree contains a content link
such as \fBMyInput.png.md5\fP then the \fBMyData\fP target creates a real
\fBMyInput.png\fP in the build tree.
.SS Module Functions
.INDENT 0.0
.TP
.B ExternalData_Expand_Arguments
The \fBExternalData_Expand_Arguments\fP function evaluates \fBDATA{}\fP
references in its arguments and constructs a new list of arguments:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalData_Expand_Arguments(
<target> # Name of data management target
<outVar> # Output variable
[args...] # Input arguments, DATA{} allowed
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It replaces each \fBDATA{}\fP reference in an argument with the full path of
a real data file on disk that will exist after the \fB<target>\fP builds.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_Add_Test
The \fBExternalData_Add_Test\fP function wraps around the CMake
\fBadd_test()\fP command but supports \fBDATA{}\fP references in
its arguments:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalData_Add_Test(
<target> # Name of data management target
... # Arguments of add_test(), DATA{} allowed
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It passes its arguments through \fBExternalData_Expand_Arguments\fP and then
invokes the \fBadd_test()\fP command using the results.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_Add_Target
The \fBExternalData_Add_Target\fP function creates a custom target to
manage local instances of data files stored externally:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalData_Add_Target(
<target> # Name of data management target
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It creates custom commands in the target as necessary to make data
files available for each \fBDATA{}\fP reference previously evaluated by
other functions provided by this module.
Data files may be fetched from one of the URL templates specified in
the \fBExternalData_URL_TEMPLATES\fP variable, or may be found locally
in one of the paths specified in the \fBExternalData_OBJECT_STORES\fP
variable.
.sp
Typically only one target is needed to manage all external data within
a project. Call this function once at the end of configuration after
all data references have been processed.
.UNINDENT
.SS Module Variables
.sp
The following variables configure behavior. They should be set before
calling any of the functions provided by this module.
.INDENT 0.0
.TP
.B ExternalData_BINARY_ROOT
The \fBExternalData_BINARY_ROOT\fP variable may be set to the directory to
hold the real data files named by expanded \fBDATA{}\fP references. The
default is \fBCMAKE_BINARY_DIR\fP\&. The directory layout will mirror that of
content links under \fBExternalData_SOURCE_ROOT\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_CUSTOM_SCRIPT_<key>
Specify a full path to a \fB\&.cmake\fP custom fetch script identified by
\fB<key>\fP in entries of the \fBExternalData_URL_TEMPLATES\fP list.
See \fI\%Custom Fetch Scripts\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_LINK_CONTENT
The \fBExternalData_LINK_CONTENT\fP variable may be set to the name of a
supported hash algorithm to enable automatic conversion of real data
files referenced by the \fBDATA{}\fP syntax into content links. For each
such \fB<file>\fP a content link named \fB<file><ext>\fP is created. The
original file is renamed to the form \fB\&.ExternalData_<algo>_<hash>\fP to
stage it for future transmission to one of the locations in the list
of URL templates (by means outside the scope of this module). The
data fetch rule created for the content link will use the staged
object if it cannot be found using any URL template.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_NO_SYMLINKS
The real data files named by expanded \fBDATA{}\fP references may be made
available under \fBExternalData_BINARY_ROOT\fP using symbolic links on
some platforms. The \fBExternalData_NO_SYMLINKS\fP variable may be set
to disable use of symbolic links and enable use of copies instead.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_OBJECT_STORES
The \fBExternalData_OBJECT_STORES\fP variable may be set to a list of local
directories that store objects using the layout \fB<dir>/%(algo)/%(hash)\fP\&.
These directories will be searched first for a needed object. If the
object is not available in any store then it will be fetched remotely
using the URL templates and added to the first local store listed. If
no stores are specified the default is a location inside the build
tree.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_SERIES_PARSE
.TP
.B ExternalData_SERIES_PARSE_PREFIX
.TP
.B ExternalData_SERIES_PARSE_NUMBER
.TP
.B ExternalData_SERIES_PARSE_SUFFIX
.TP
.B ExternalData_SERIES_MATCH
See \fI\%Referencing File Series\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_SOURCE_ROOT
The \fBExternalData_SOURCE_ROOT\fP variable may be set to the highest source
directory containing any path named by a \fBDATA{}\fP reference. The
default is \fBCMAKE_SOURCE_DIR\fP\&. \fBExternalData_SOURCE_ROOT\fP and
\fBCMAKE_SOURCE_DIR\fP must refer to directories within a single source
distribution (e.g. they come together in one tarball).
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_TIMEOUT_ABSOLUTE
The \fBExternalData_TIMEOUT_ABSOLUTE\fP variable sets the download
absolute timeout, in seconds, with a default of \fB300\fP seconds.
Set to \fB0\fP to disable enforcement.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_TIMEOUT_INACTIVITY
The \fBExternalData_TIMEOUT_INACTIVITY\fP variable sets the download
inactivity timeout, in seconds, with a default of \fB60\fP seconds.
Set to \fB0\fP to disable enforcement.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_URL_ALGO_<algo>_<key>
Specify a custom URL component to be substituted for URL template
placeholders of the form \fB%(algo:<key>)\fP, where \fB<key>\fP is a
valid C identifier, when fetching an object referenced via hash
algorithm \fB<algo>\fP\&. If not defined, the default URL component
is just \fB<algo>\fP for any \fB<key>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_URL_TEMPLATES
The \fBExternalData_URL_TEMPLATES\fP may be set to provide a list of
of URL templates using the placeholders \fB%(algo)\fP and \fB%(hash)\fP
in each template. Data fetch rules try each URL template in order
by substituting the hash algorithm name for \fB%(algo)\fP and the hash
value for \fB%(hash)\fP\&. Alternatively one may use \fB%(algo:<key>)\fP
with \fBExternalData_URL_ALGO_<algo>_<key>\fP variables to gain more
flexibility in remote URLs.
.UNINDENT
.SS Referencing Files
.SS Referencing Single Files
.sp
The \fBDATA{}\fP syntax is literal and the \fB<name>\fP is a full or relative path
within the source tree. The source tree must contain either a real
data file at \fB<name>\fP or a "content link" at \fB<name><ext>\fP containing a
hash of the real file using a hash algorithm corresponding to \fB<ext>\fP\&.
For example, the argument \fBDATA{img.png}\fP may be satisfied by either a
real \fBimg.png\fP file in the current source directory or a \fBimg.png.md5\fP
file containing its MD5 sum.
.sp
Multiple content links of the same name with different hash algorithms
are supported (e.g. \fBimg.png.sha256\fP and \fBimg.png.sha1\fP) so long as
they all correspond to the same real file. This allows objects to be
fetched from sources indexed by different hash algorithms.
.SS Referencing File Series
.sp
The \fBDATA{}\fP syntax can be told to fetch a file series using the form
\fBDATA{<name>,:}\fP, where the \fB:\fP is literal. If the source tree
contains a group of files or content links named like a series then a
reference to one member adds rules to fetch all of them. Although all
members of a series are fetched, only the file originally named by the
\fBDATA{}\fP argument is substituted for it. The default configuration
recognizes file series names ending with \fB#.ext\fP, \fB_#.ext\fP, \fB\&.#.ext\fP,
or \fB\-#.ext\fP where \fB#\fP is a sequence of decimal digits and \fB\&.ext\fP is
any single extension. Configure it with a regex that parses \fB<number>\fP
and \fB<suffix>\fP parts from the end of \fB<name>\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For more complicated cases set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalData_SERIES_PARSE = regex with at least two () groups
ExternalData_SERIES_PARSE_PREFIX = <prefix> regex group number, if any
ExternalData_SERIES_PARSE_NUMBER = <number> regex group number
ExternalData_SERIES_PARSE_SUFFIX = <suffix> regex group number
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Configure series number matching with a regex that matches the
\fB<number>\fP part of series members named \fB<prefix><number><suffix>\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalData_SERIES_MATCH = regex matching <number> in all series members
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that the \fB<suffix>\fP of a series does not include a hash\-algorithm
extension.
.SS Referencing Associated Files
.sp
The \fBDATA{}\fP syntax can alternatively match files associated with the
named file and contained in the same directory. Associated files may
be specified by options using the syntax
\fBDATA{<name>,<opt1>,<opt2>,...}\fP\&. Each option may specify one file by
name or specify a regular expression to match file names using the
syntax \fBREGEX:<regex>\fP\&. For example, the arguments:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
DATA{MyData/MyInput.mhd,MyInput.img} # File pair
DATA{MyData/MyFrames00.png,REGEX:MyFrames[0\-9]+\e\e.png} # Series
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
will pass \fBMyInput.mha\fP and \fBMyFrames00.png\fP on the command line but
ensure that the associated files are present next to them.
.SS Referencing Directories
.sp
The \fBDATA{}\fP syntax may reference a directory using a trailing slash and
a list of associated files. The form \fBDATA{<name>/,<opt1>,<opt2>,...}\fP
adds rules to fetch any files in the directory that match one of the
associated file options. For example, the argument
\fBDATA{MyDataDir/,REGEX:.*}\fP will pass the full path to a \fBMyDataDir\fP
directory on the command line and ensure that the directory contains
files corresponding to every file or content link in the \fBMyDataDir\fP
source directory. In order to match associated files in subdirectories,
specify a \fBRECURSE:\fP option, e.g. \fBDATA{MyDataDir/,RECURSE:,REGEX:.*}\fP\&.
.SS Hash Algorithms
.sp
The following hash algorithms are supported:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
%(algo) <ext> Description
\-\-\-\-\-\-\- \-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-
MD5 .md5 Message\-Digest Algorithm 5, RFC 1321
SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174
SHA224 .sha224 US Secure Hash Algorithms, RFC 4634
SHA256 .sha256 US Secure Hash Algorithms, RFC 4634
SHA384 .sha384 US Secure Hash Algorithms, RFC 4634
SHA512 .sha512 US Secure Hash Algorithms, RFC 4634
SHA3_224 .sha3\-224 Keccak SHA\-3
SHA3_256 .sha3\-256 Keccak SHA\-3
SHA3_384 .sha3\-384 Keccak SHA\-3
SHA3_512 .sha3\-512 Keccak SHA\-3
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that the hashes are used only for unique data identification and
download verification.
.SS Custom Fetch Scripts
.sp
When a data file must be fetched from one of the URL templates
specified in the \fBExternalData_URL_TEMPLATES\fP variable, it is
normally downloaded using the \fBfile(DOWNLOAD)\fP command.
One may specify usage of a custom fetch script by using a URL
template of the form \fBExternalDataCustomScript://<key>/<loc>\fP\&.
The \fB<key>\fP must be a C identifier, and the \fB<loc>\fP must
contain the \fB%(algo)\fP and \fB%(hash)\fP placeholders.
A variable corresponding to the key, \fBExternalData_CUSTOM_SCRIPT_<key>\fP,
must be set to the full path to a \fB\&.cmake\fP script file. The script
will be included to perform the actual fetch, and provided with
the following variables:
.INDENT 0.0
.TP
.B ExternalData_CUSTOM_LOCATION
When a custom fetch script is loaded, this variable is set to the
location part of the URL, which will contain the substituted hash
algorithm name and content hash value.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalData_CUSTOM_FILE
When a custom fetch script is loaded, this variable is set to the
full path to a file in which the script must store the fetched
content. The name of the file is unspecified and should not be
interpreted in any way.
.UNINDENT
.sp
The custom fetch script is expected to store fetched content in the
file or set a variable:
.INDENT 0.0
.TP
.B ExternalData_CUSTOM_ERROR
When a custom fetch script fails to fetch the requested content,
it must set this variable to a short one\-line message describing
the reason for failure.
.UNINDENT
.SS ExternalProject
.sp
Create custom targets to build projects in external trees
.INDENT 0.0
.TP
.B ExternalProject_Add
The \fBExternalProject_Add\fP function creates a custom target to drive
download, update/patch, configure, build, install and test steps of an
external project:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalProject_Add(<name> [<option>...])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
General options are:
.INDENT 7.0
.TP
.B \fBDEPENDS <projects>...\fP
Targets on which the project depends
.TP
.B \fBPREFIX <dir>\fP
Root dir for entire project
.TP
.B \fBLIST_SEPARATOR <sep>\fP
Sep to be replaced by ; in cmd lines
.TP
.B \fBTMP_DIR <dir>\fP
Directory to store temporary files
.TP
.B \fBSTAMP_DIR <dir>\fP
Directory to store step timestamps
.TP
.B \fBEXCLUDE_FROM_ALL 1\fP
The "all" target does not depend on this
.UNINDENT
.sp
Download step options are:
.INDENT 7.0
.TP
.B \fBDOWNLOAD_NAME <fname>\fP
File name to store (if not end of URL)
.TP
.B \fBDOWNLOAD_DIR <dir>\fP
Directory to store downloaded files
.TP
.B \fBDOWNLOAD_COMMAND <cmd>...\fP
Command to download source tree
.TP
.B \fBDOWNLOAD_NO_PROGRESS 1\fP
Disable download progress reports
.TP
.B \fBCVS_REPOSITORY <cvsroot>\fP
CVSROOT of CVS repository
.TP
.B \fBCVS_MODULE <mod>\fP
Module to checkout from CVS repo
.TP
.B \fBCVS_TAG <tag>\fP
Tag to checkout from CVS repo
.TP
.B \fBSVN_REPOSITORY <url>\fP
URL of Subversion repo
.TP
.B \fBSVN_REVISION \-r<rev>\fP
Revision to checkout from Subversion repo
.TP
.B \fBSVN_USERNAME <username>\fP
Username for Subversion checkout and update
.TP
.B \fBSVN_PASSWORD <password>\fP
Password for Subversion checkout and update
.TP
.B \fBSVN_TRUST_CERT 1\fP
Trust the Subversion server site certificate
.TP
.B \fBGIT_REPOSITORY <url>\fP
URL of git repo
.TP
.B \fBGIT_TAG <tag>\fP
Git branch name, commit id or tag
.TP
.B \fBGIT_REMOTE_NAME <name>\fP
The optional name of the remote, default to \fBorigin\fP
.TP
.B \fBGIT_SUBMODULES <module>...\fP
Git submodules that shall be updated, all if empty
.TP
.B \fBGIT_SHALLOW 1\fP
Tell Git to clone with \fB\-\-depth 1\fP\&. Use when \fBGIT_TAG\fP is not
specified or when it names a branch in order to download only the
tip of the branch without the rest of its history.
.TP
.B \fBGIT_PROGRESS 1\fP
Tell Git to clone with \fB\-\-progress\fP\&. For large projects, the clone step
does not output anything which can make the build appear to have stalled.
This option forces Git to output progress information during the clone step
so that forward progress is indicated.
.TP
.B \fBGIT_CONFIG <option>...\fP
Tell Git to clone with \fB\-\-config <option>\fP\&. Use additional configuration
parameters when cloning the project (\fBkey=value\fP as expected by \fBgit
config\fP).
.TP
.B \fBHG_REPOSITORY <url>\fP
URL of mercurial repo
.TP
.B \fBHG_TAG <tag>\fP
Mercurial branch name, commit id or tag
.TP
.B \fBURL /.../src.tgz [/.../src.tgz]...\fP
Full path or URL(s) of source. Multiple URLs are allowed as mirrors.
.TP
.B \fBURL_HASH ALGO=value\fP
Hash of file at URL
.TP
.B \fBURL_MD5 md5\fP
Equivalent to URL_HASH MD5=md5
.TP
.B \fBHTTP_USERNAME <username>\fP
Username for download operation
.TP
.B \fBHTTP_PASSWORD <username>\fP
Password for download operation
.TP
.B \fBHTTP_HEADER <header>\fP
HTTP header for download operation. Suboption can be repeated several times.
.TP
.B \fBTLS_VERIFY <bool>\fP
Should certificate for https be checked
.TP
.B \fBTLS_CAINFO <file>\fP
Path to a certificate authority file
.TP
.B \fBTIMEOUT <seconds>\fP
Time allowed for file download operations
.TP
.B \fBDOWNLOAD_NO_EXTRACT 1\fP
Just download the file and do not extract it; the full path to the
downloaded file is available as \fB<DOWNLOADED_FILE>\fP\&.
.UNINDENT
.sp
Update/Patch step options are:
.INDENT 7.0
.TP
.B \fBUPDATE_COMMAND <cmd>...\fP
Source work\-tree update command
.TP
.B \fBUPDATE_DISCONNECTED 1\fP
Never update automatically from the remote repository
.TP
.B \fBPATCH_COMMAND <cmd>...\fP
Command to patch downloaded source
.UNINDENT
.sp
Configure step options are:
.INDENT 7.0
.TP
.B \fBSOURCE_DIR <dir>\fP
Source dir to be used for build
.TP
.B \fBSOURCE_SUBDIR <dir>\fP
Path to source CMakeLists.txt relative to \fBSOURCE_DIR\fP
.TP
.B \fBCONFIGURE_COMMAND <cmd>...\fP
Build tree configuration command
.TP
.B \fBCMAKE_COMMAND /.../cmake\fP
Specify alternative cmake executable
.TP
.B \fBCMAKE_GENERATOR <gen>\fP
Specify generator for native build
.TP
.B \fBCMAKE_GENERATOR_PLATFORM <platform>\fP
Generator\-specific platform name
.TP
.B \fBCMAKE_GENERATOR_TOOLSET <toolset>\fP
Generator\-specific toolset name
.TP
.B \fBCMAKE_ARGS <arg>...\fP
Arguments to CMake command line.
These arguments are passed to CMake command line, and can contain
arguments other than cache values, see also
\fBCMake Options\fP\&. Arguments in the form
\fB\-Dvar:string=on\fP are always passed to the command line, and
therefore cannot be changed by the user.
Arguments may use
\fBgenerator expressions\fP\&.
.TP
.B \fBCMAKE_CACHE_ARGS <arg>...\fP
Initial cache arguments, of the form \fB\-Dvar:string=on\fP\&.
These arguments are written in a pre\-load a script that populates
CMake cache, see also \fBcmake \-C\fP\&. This allows one to
overcome command line length limits.
These arguments are \fBset()\fP using the \fBFORCE\fP argument,
and therefore cannot be changed by the user.
Arguments may use
\fBgenerator expressions\fP\&.
.TP
.B \fBCMAKE_CACHE_DEFAULT_ARGS <arg>...\fP
Initial default cache arguments, of the form \fB\-Dvar:string=on\fP\&.
These arguments are written in a pre\-load a script that populates
CMake cache, see also \fBcmake \-C\fP\&. This allows one to
overcome command line length limits.
These arguments can be used as default value that will be set if no
previous value is found in the cache, and that the user can change
later.
Arguments may use
\fBgenerator expressions\fP\&.
.UNINDENT
.sp
Build step options are:
.INDENT 7.0
.TP
.B \fBBINARY_DIR <dir>\fP
Specify build dir location
.TP
.B \fBBUILD_COMMAND <cmd>...\fP
Command to drive the native build
.TP
.B \fBBUILD_IN_SOURCE 1\fP
Use source dir for build dir
.TP
.B \fBBUILD_ALWAYS 1\fP
No stamp file, build step always runs
.TP
.B \fBBUILD_BYPRODUCTS <file>...\fP
Files that will be generated by the build command but may or may
not have their modification time updated by subsequent builds.
.UNINDENT
.sp
Install step options are:
.INDENT 7.0
.TP
.B \fBINSTALL_DIR <dir>\fP
Installation prefix to be placed in the \fB<INSTALL_DIR>\fP placeholder.
This does not actually configure the external project to install to
the given prefix. That must be done by passing appropriate arguments
to the external project configuration step, e.g. using \fB<INSTALL_DIR>\fP\&.
.TP
.B \fBINSTALL_COMMAND <cmd>...\fP
Command to drive installation of the external project after it has been
built. This only happens at the \fIbuild\fP time of the calling project.
In order to install files from the external project alongside the
locally\-built files, a separate local \fBinstall()\fP call must be
added to pick the files up from one of the external project trees.
.UNINDENT
.sp
Test step options are:
.INDENT 7.0
.TP
.B \fBTEST_BEFORE_INSTALL 1\fP
Add test step executed before install step
.TP
.B \fBTEST_AFTER_INSTALL 1\fP
Add test step executed after install step
.TP
.B \fBTEST_EXCLUDE_FROM_MAIN 1\fP
Main target does not depend on the test step
.TP
.B \fBTEST_COMMAND <cmd>...\fP
Command to drive test
.UNINDENT
.sp
Output logging options are:
.INDENT 7.0
.TP
.B \fBLOG_DOWNLOAD 1\fP
Wrap download in script to log output
.TP
.B \fBLOG_UPDATE 1\fP
Wrap update in script to log output
.TP
.B \fBLOG_CONFIGURE 1\fP
Wrap configure in script to log output
.TP
.B \fBLOG_BUILD 1\fP
Wrap build in script to log output
.TP
.B \fBLOG_TEST 1\fP
Wrap test in script to log output
.TP
.B \fBLOG_INSTALL 1\fP
Wrap install in script to log output
.UNINDENT
.sp
Steps can be given direct access to the terminal if possible. With
the \fBNinja\fP generator, this places the steps in the
\fBconsole\fP \fBpool\fP\&. Options are:
.INDENT 7.0
.TP
.B \fBUSES_TERMINAL_DOWNLOAD 1\fP
Give download terminal access.
.TP
.B \fBUSES_TERMINAL_UPDATE 1\fP
Give update terminal access.
.TP
.B \fBUSES_TERMINAL_CONFIGURE 1\fP
Give configure terminal access.
.TP
.B \fBUSES_TERMINAL_BUILD 1\fP
Give build terminal access.
.TP
.B \fBUSES_TERMINAL_TEST 1\fP
Give test terminal access.
.TP
.B \fBUSES_TERMINAL_INSTALL 1\fP
Give install terminal access.
.UNINDENT
.sp
Other options are:
.INDENT 7.0
.TP
.B \fBSTEP_TARGETS <step\-target>...\fP
Generate custom targets for these steps
.TP
.B \fBINDEPENDENT_STEP_TARGETS <step\-target>...\fP
Generate custom targets for these steps that do not depend on other
external projects even if a dependency is set
.UNINDENT
.sp
The \fB*_DIR\fP options specify directories for the project, with default
directories computed as follows. If the \fBPREFIX\fP option is given to
\fBExternalProject_Add()\fP or the \fBEP_PREFIX\fP directory property is set,
then an external project is built and installed under the specified prefix:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
TMP_DIR = <prefix>/tmp
STAMP_DIR = <prefix>/src/<name>\-stamp
DOWNLOAD_DIR = <prefix>/src
SOURCE_DIR = <prefix>/src/<name>
BINARY_DIR = <prefix>/src/<name>\-build
INSTALL_DIR = <prefix>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Otherwise, if the \fBEP_BASE\fP directory property is set then components
of an external project are stored under the specified base:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
TMP_DIR = <base>/tmp/<name>
STAMP_DIR = <base>/Stamp/<name>
DOWNLOAD_DIR = <base>/Download/<name>
SOURCE_DIR = <base>/Source/<name>
BINARY_DIR = <base>/Build/<name>
INSTALL_DIR = <base>/Install/<name>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If no \fBPREFIX\fP, \fBEP_PREFIX\fP, or \fBEP_BASE\fP is specified then the
default is to set \fBPREFIX\fP to \fB<name>\-prefix\fP\&. Relative paths are
interpreted with respect to the build directory corresponding to the
source directory in which \fBExternalProject_Add\fP is invoked.
.sp
If \fBSOURCE_SUBDIR\fP is set and no \fBCONFIGURE_COMMAND\fP is specified, the
configure command will run CMake using the \fBCMakeLists.txt\fP located in the
relative path specified by \fBSOURCE_SUBDIR\fP, relative to the \fBSOURCE_DIR\fP\&.
If no \fBSOURCE_SUBDIR\fP is given, \fBSOURCE_DIR\fP is used.
.sp
If \fBSOURCE_DIR\fP is explicitly set to an existing directory the project
will be built from it. Otherwise a download step must be specified
using one of the \fBDOWNLOAD_COMMAND\fP, \fBCVS_*\fP, \fBSVN_*\fP, or \fBURL\fP
options. The \fBURL\fP option may refer locally to a directory or source
tarball, or refer to a remote tarball (e.g. \fBhttp://.../src.tgz\fP).
.sp
If \fBUPDATE_DISCONNECTED\fP is set, the update step is not executed
automatically when building the main target. The update step can still
be added as a step target and called manually. This is useful if you
want to allow one to build the project when you are disconnected from the
network (you might still need the network for the download step).
This is disabled by default.
The directory property \fBEP_UPDATE_DISCONNECTED\fP can be used to change
the default value for all the external projects in the current
directory and its subdirectories.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalProject_Add_Step
The \fBExternalProject_Add_Step\fP function adds a custom step to an
external project:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalProject_Add_Step(<name> <step> [<option>...])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Options are:
.INDENT 7.0
.TP
.B \fBCOMMAND <cmd>...\fP
Command line invoked by this step
.TP
.B \fBCOMMENT "<text>..."\fP
Text printed when step executes
.TP
.B \fBDEPENDEES <step>...\fP
Steps on which this step depends
.TP
.B \fBDEPENDERS <step>...\fP
Steps that depend on this step
.TP
.B \fBDEPENDS <file>...\fP
Files on which this step depends
.TP
.B \fBBYPRODUCTS <file>...\fP
Files that will be generated by this step but may or may not
have their modification time updated by subsequent builds.
.TP
.B \fBALWAYS 1\fP
No stamp file, step always runs
.TP
.B \fBEXCLUDE_FROM_MAIN 1\fP
Main target does not depend on this step
.TP
.B \fBWORKING_DIRECTORY <dir>\fP
Working directory for command
.TP
.B \fBLOG 1\fP
Wrap step in script to log output
.TP
.B \fBUSES_TERMINAL 1\fP
Give the step direct access to the terminal if possible.
.UNINDENT
.sp
The command line, comment, working directory, and byproducts of every
standard and custom step are processed to replace tokens \fB<SOURCE_DIR>\fP,
\fB<SOURCE_SUBDIR>\fP, \fB<BINARY_DIR>\fP, \fB<INSTALL_DIR>\fP, and \fB<TMP_DIR>\fP
with corresponding property values.
.UNINDENT
.sp
Any builtin step that specifies a \fB<step>_COMMAND cmd...\fP or custom
step that specifies a \fBCOMMAND cmd...\fP may specify additional command
lines using the form \fBCOMMAND cmd...\fP\&. At build time the commands
will be executed in order and aborted if any one fails. For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
\&... BUILD_COMMAND make COMMAND echo done ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
specifies to run \fBmake\fP and then \fBecho done\fP during the build step.
Whether the current working directory is preserved between commands is
not defined. Behavior of shell operators like \fB&&\fP is not defined.
.sp
Arguments to \fB<step>_COMMAND\fP or \fBCOMMAND\fP options may use
\fBgenerator expressions\fP\&.
.INDENT 0.0
.TP
.B ExternalProject_Get_Property
The \fBExternalProject_Get_Property\fP function retrieves external project
target properties:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It stores property values in variables of the same name. Property
names correspond to the keyword argument names of
\fBExternalProject_Add\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B ExternalProject_Add_StepTargets
The \fBExternalProject_Add_StepTargets\fP function generates custom
targets for the steps listed:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalProject_Add_StepTargets(<name> [NO_DEPENDS] [step1 [step2 [...]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.sp
If \fBNO_DEPENDS\fP is set, the target will not depend on the
dependencies of the complete project. This is usually safe to use for
the download, update, and patch steps that do not require that all the
dependencies are updated and built. Using \fBNO_DEPENDS\fP for other
of the default steps might break parallel builds, so you should avoid,
it. For custom steps, you should consider whether or not the custom
commands requires that the dependencies are configured, built and
installed.
.sp
If \fBSTEP_TARGETS\fP or \fBINDEPENDENT_STEP_TARGETS\fP is set then
\fBExternalProject_Add_StepTargets\fP is automatically called at the end
of matching calls to \fBExternalProject_Add_Step\fP\&. Pass
\fBSTEP_TARGETS\fP or \fBINDEPENDENT_STEP_TARGETS\fP explicitly to
individual \fBExternalProject_Add\fP calls, or implicitly to all
\fBExternalProject_Add\fP calls by setting the directory properties
\fBEP_STEP_TARGETS\fP and \fBEP_INDEPENDENT_STEP_TARGETS\fP\&. The
\fBINDEPENDENT\fP version of the argument and of the property will call
\fBExternalProject_Add_StepTargets\fP with the \fBNO_DEPENDS\fP argument.
.sp
If \fBSTEP_TARGETS\fP and \fBINDEPENDENT_STEP_TARGETS\fP are not set,
clients may still manually call \fBExternalProject_Add_StepTargets\fP
after calling \fBExternalProject_Add\fP or \fBExternalProject_Add_Step\fP\&.
.sp
This functionality is provided to make it easy to drive the steps
independently of each other by specifying targets on build command
lines. For example, you may be submitting to a sub\-project based
dashboard, where you want to drive the configure portion of the build,
then submit to the dashboard, followed by the build portion, followed
by tests. If you invoke a custom target that depends on a step
halfway through the step dependency chain, then all the previous steps
will also run to ensure everything is up to date.
.sp
For example, to drive configure, build and test steps independently
for each \fBExternalProject_Add\fP call in your project, write the following
line prior to any \fBExternalProject_Add\fP calls in your \fBCMakeLists.txt\fP
file:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ExternalProject_Add_StepDependencies
The \fBExternalProject_Add_StepDependencies\fP function add some
dependencies for some external project step:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ExternalProject_Add_StepDependencies(<name> <step> [target1 [target2 [...]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This function takes care to set both target and file level
dependencies, and will ensure that parallel builds will not break.
It should be used instead of \fBadd_dependencies()\fP when adding
a dependency for some of the step targets generated by
\fBExternalProject\fP\&.
.UNINDENT
.SS FeatureSummary
.sp
Functions for generating a summary of enabled/disabled features.
.sp
These functions can be used to generate a summary of enabled and disabled
packages and/or feature for a build tree such as:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
\-\- The following OPTIONAL packages have been found:
LibXml2 (required version >= 2.4), XML processing lib, <http://xmlsoft.org>
* Enables HTML\-import in MyWordProcessor
* Enables odt\-export in MyWordProcessor
PNG, A PNG image library., <http://www.libpng.org/pub/png/>
* Enables saving screenshots
\-\- The following OPTIONAL packages have not been found:
Lua51, The Lua scripting language., <http://www.lua.org>
* Enables macros in MyWordProcessor
Foo, Foo provides cool stuff.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Global Properties
.INDENT 0.0
.TP
.B FeatureSummary_PKG_TYPES
.UNINDENT
.sp
The global property \fI\%FeatureSummary_PKG_TYPES\fP defines the type of
packages used by \fIFeatureSummary\fP\&.
.sp
The order in this list is important, the first package type in the list is the
least important, the last is the most important. the of a package can only be
changed to higher types.
.sp
The default package types are , \fBRUNTIME\fP, \fBOPTIONAL\fP, \fBRECOMMENDED\fP and
\fBREQUIRED\fP, and their importance is
\fBRUNTIME < OPTIONAL < RECOMMENDED < REQUIRED\fP\&.
.INDENT 0.0
.TP
.B FeatureSummary_REQUIRED_PKG_TYPES
.UNINDENT
.sp
The global property \fI\%FeatureSummary_REQUIRED_PKG_TYPES\fP defines which
package types are required.
.sp
If one or more package in this categories has not been found, CMake will abort
when calling \fI\%feature_summary()\fP with the
\(aqFATAL_ON_MISSING_REQUIRED_PACKAGES\(aq option enabled.
.sp
The default value for this global property is \fBREQUIRED\fP\&.
.INDENT 0.0
.TP
.B FeatureSummary_DEFAULT_PKG_TYPE
.UNINDENT
.sp
The global property \fI\%FeatureSummary_DEFAULT_PKG_TYPE\fP defines which
package type is the default one.
When calling \fI\%feature_summary()\fP, if the user did not set the package type
explicitly, the package will be assigned to this category.
.sp
This value must be one of the types defined in the
\fI\%FeatureSummary_PKG_TYPES\fP global property unless the package type
is set for all the packages.
.sp
The default value for this global property is \fBOPTIONAL\fP\&.
.SS Functions
.INDENT 0.0
.TP
.B feature_summary
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
feature_summary( [FILENAME <file>]
[APPEND]
[VAR <variable_name>]
[INCLUDE_QUIET_PACKAGES]
[FATAL_ON_MISSING_REQUIRED_PACKAGES]
[DESCRIPTION "<description>"]
[QUIET_ON_EMPTY]
WHAT (ALL
| PACKAGES_FOUND | PACKAGES_NOT_FOUND
| <TYPE>_PACKAGES_FOUND | <TYPE>_PACKAGES_NOT_FOUND
| ENABLED_FEATURES | DISABLED_FEATURES)
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBfeature_summary()\fP macro can be used to print information about
enabled or disabled packages or features of a project. By default,
only the names of the features/packages will be printed and their
required version when one was specified. Use \fBset_package_properties()\fP
to add more useful information, like e.g. a download URL for the
respective package or their purpose in the project.
.sp
The \fBWHAT\fP option is the only mandatory option. Here you specify what
information will be printed:
.INDENT 7.0
.TP
.B \fBALL\fP
print everything
.TP
.B \fBENABLED_FEATURES\fP
the list of all features which are enabled
.TP
.B \fBDISABLED_FEATURES\fP
the list of all features which are disabled
.TP
.B \fBPACKAGES_FOUND\fP
the list of all packages which have been found
.TP
.B \fBPACKAGES_NOT_FOUND\fP
the list of all packages which have not been found
.UNINDENT
.sp
For each package type \fB<TYPE>\fP defined by the
\fI\%FeatureSummary_PKG_TYPES\fP global property, the following
information can also be used:
.INDENT 7.0
.TP
.B \fB<TYPE>_PACKAGES_FOUND\fP
only those packages which have been found which have the type <TYPE>
.TP
.B \fB<TYPE>_PACKAGES_NOT_FOUND\fP
only those packages which have not been found which have the type <TYPE>
.UNINDENT
.sp
With the exception of the \fBALL\fP value, these values can be combined
in order to customize the output. For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If a \fBFILENAME\fP is given, the information is printed into this file. If
\fBAPPEND\fP is used, it is appended to this file, otherwise the file is
overwritten if it already existed. If the VAR option is used, the
information is "printed" into the specified variable. If \fBFILENAME\fP is
not used, the information is printed to the terminal. Using the
\fBDESCRIPTION\fP option a description or headline can be set which will be
printed above the actual content.
If \fBINCLUDE_QUIET_PACKAGES\fP is given, packages which have been searched with
\fBfind_package(... QUIET)\fP will also be listed. By default they are skipped.
If \fBFATAL_ON_MISSING_REQUIRED_PACKAGES\fP is given, CMake will abort if a
package which is marked as one of the package types listed in the
\fI\%FeatureSummary_REQUIRED_PKG_TYPES\fP global property has not been
found.
The default value for the \fI\%FeatureSummary_REQUIRED_PKG_TYPES\fP global
property is \fBREQUIRED\fP\&.
.sp
The \fI\%FeatureSummary_DEFAULT_PKG_TYPE\fP global property can be
modified to change the default package type assigned when not explicitly
assigned by the user.
.sp
If the \fBQUIET_ON_EMPTY\fP option is used, if only one type of package was
requested, and no packages belonging to that category were found, then no
output (including the \fBDESCRIPTION\fP) is printed or added to the \fBVAR\fP
variable.
.sp
Example 1, append everything to a file:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
include(FeatureSummary)
feature_summary(WHAT ALL
FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example 2, print the enabled features into the variable
enabledFeaturesText, including QUIET packages:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
include(FeatureSummary)
feature_summary(WHAT ENABLED_FEATURES
INCLUDE_QUIET_PACKAGES
DESCRIPTION "Enabled Features:"
VAR enabledFeaturesText)
message(STATUS "${enabledFeaturesText}")
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example 3, change default package types and print only the categories that
are not empty:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
include(FeatureSummary)
set_property(GLOBAL APPEND PROPERTY FeatureSummary_PKG_TYPES BUILD)
find_package(FOO)
set_package_properties(FOO PROPERTIES TYPE BUILD)
feature_summary(WHAT BUILD_PACKAGES_FOUND
Description "Build tools found:"
QUIET_ON_EMPTY)
feature_summary(WHAT BUILD_PACKAGES_NOT_FOUND
Description "Build tools not found:"
QUIET_ON_EMPTY)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B set_package_properties
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set_package_properties(<name> PROPERTIES
[ URL <url> ]
[ DESCRIPTION <description> ]
[ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ]
[ PURPOSE <purpose> ]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Use this macro to set up information about the named package, which
can then be displayed via FEATURE_SUMMARY(). This can be done either
directly in the Find\-module or in the project which uses the module
after the find_package() call. The features for which information can
be set are added automatically by the find_package() command.
.INDENT 7.0
.TP
.B \fBURL <url>\fP
This should be the homepage of the package, or something similar.
Ideally this is set already directly in the Find\-module.
.TP
.B \fBDESCRIPTION <description>\fP
A short description what that package is, at most one sentence.
Ideally this is set already directly in the Find\-module.
.TP
.B \fBTYPE <type>\fP
What type of dependency has the using project on that package.
Default is \fBOPTIONAL\fP\&. In this case it is a package which can be used
by the project when available at buildtime, but it also work without.
\fBRECOMMENDED\fP is similar to \fBOPTIONAL\fP, i.e. the project will build if
the package is not present, but the functionality of the resulting
binaries will be severly limited. If a \fBREQUIRED\fP package is not
available at buildtime, the project may not even build. This can be
combined with the \fBFATAL_ON_MISSING_REQUIRED_PACKAGES\fP argument for
\fBfeature_summary()\fP\&. Last, a \fBRUNTIME\fP package is a package which is
actually not used at all during the build, but which is required for
actually running the resulting binaries. So if such a package is
missing, the project can still be built, but it may not work later on.
If \fBset_package_properties()\fP is called multiple times for the same
package with different TYPEs, the \fBTYPE\fP is only changed to higher
TYPEs (\fBRUNTIME < OPTIONAL < RECOMMENDED < REQUIRED\fP), lower TYPEs are
ignored. The \fBTYPE\fP property is project\-specific, so it cannot be set
by the Find\-module, but must be set in the project.
Type accepted can be changed by setting the
\fI\%FeatureSummary_PKG_TYPES\fP global property.
.TP
.B \fBPURPOSE <purpose>\fP
This describes which features this package enables in the
project, i.e. it tells the user what functionality he gets in the
resulting binaries. If set_package_properties() is called multiple
times for a package, all PURPOSE properties are appended to a list of
purposes of the package in the project. As the TYPE property, also
the PURPOSE property is project\-specific, so it cannot be set by the
Find\-module, but must be set in the project.
.UNINDENT
.sp
Example for setting the info for a package:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(LibXml2)
set_package_properties(LibXml2 PROPERTIES
DESCRIPTION "A XML processing library."
URL "http://xmlsoft.org/")
# or
set_package_properties(LibXml2 PROPERTIES
TYPE RECOMMENDED
PURPOSE "Enables HTML\-import in MyWordProcessor")
# or
set_package_properties(LibXml2 PROPERTIES
TYPE OPTIONAL
PURPOSE "Enables odt\-export in MyWordProcessor")
find_package(DBUS)
set_package_properties(DBUS PROPERTIES
TYPE RUNTIME
PURPOSE "Necessary to disable the screensaver during a presentation")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B add_feature_info
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
add_feature_info(<name> <enabled> <description>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Use this macro to add information about a feature with the given \fB<name>\fP\&.
\fB<enabled>\fP contains whether this feature is enabled or not. It can be a
variable or a list of conditions.
\fB<description>\fP is a text describing the feature. The information can
be displayed using \fBfeature_summary()\fP for \fBENABLED_FEATURES\fP and
\fBDISABLED_FEATURES\fP respectively.
.sp
Example for setting the info for a feature:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
option(WITH_FOO "Help for foo" ON)
add_feature_info(Foo WITH_FOO "The Foo feature provides very cool stuff.")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS Legacy Macros
.sp
The following macros are provided for compatibility with previous
CMake versions:
.INDENT 0.0
.TP
.B set_package_info
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set_package_info(<name> <description> [ <url> [<purpose>] ])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Use this macro to set up information about the named package, which
can then be displayed via \fBfeature_summary()\fP\&. This can be done either
directly in the Find\-module or in the project which uses the module
after the \fBfind_package()\fP call. The features for which information
can be set are added automatically by the \fBfind_package()\fP command.
.UNINDENT
.INDENT 0.0
.TP
.B set_feature_info
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set_feature_info(<name> <description> [<url>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Does the same as:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set_package_info(<name> <description> <url>)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B print_enabled_features
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
print_enabled_features()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Does the same as
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B print_disabled_features
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
print_disabled_features()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Does the same as
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS FindALSA
.sp
Find alsa
.sp
Find the alsa libraries (asound)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
This module defines the following variables:
ALSA_FOUND \- True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
ALSA_LIBRARIES \- Set when ALSA_LIBRARY is found
ALSA_INCLUDE_DIRS \- Set when ALSA_INCLUDE_DIR is found
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ALSA_INCLUDE_DIR \- where to find asoundlib.h, etc.
ALSA_LIBRARY \- the asound library
ALSA_VERSION_STRING \- the version of alsa found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindArmadillo
.sp
Find Armadillo
.sp
Find the Armadillo C++ library
.sp
Using Armadillo:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Armadillo REQUIRED)
include_directories(${ARMADILLO_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo ${ARMADILLO_LIBRARIES})
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This module sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ARMADILLO_FOUND \- set to true if the library is found
ARMADILLO_INCLUDE_DIRS \- list of required include directories
ARMADILLO_LIBRARIES \- list of libraries to be linked
ARMADILLO_VERSION_MAJOR \- major version number
ARMADILLO_VERSION_MINOR \- minor version number
ARMADILLO_VERSION_PATCH \- patch version number
ARMADILLO_VERSION_STRING \- version number as a string (ex: "1.0.4")
ARMADILLO_VERSION_NAME \- name of the version (ex: "Antipodean Antileech")
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindASPELL
.sp
Try to find ASPELL
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ASPELL_FOUND \- system has ASPELL
ASPELL_EXECUTABLE \- the ASPELL executable
ASPELL_INCLUDE_DIR \- the ASPELL include directory
ASPELL_LIBRARIES \- The libraries needed to use ASPELL
ASPELL_DEFINITIONS \- Compiler switches required for using ASPELL
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindAVIFile
.sp
Locate AVIFILE library and include paths
.sp
AVIFILE (\fI\%http://avifile.sourceforge.net/)is\fP a set of libraries for
i386 machines to use various AVI codecs. Support is limited beyond
Linux. Windows provides native AVI support, and so doesn\(aqt need this
library. This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
AVIFILE_LIBRARIES, the libraries to link against
AVIFILE_DEFINITIONS, definitions to use when compiling
AVIFILE_FOUND, If false, don\(aqt try to use AVIFILE
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindBISON
.sp
Find \fBbison\fP executable and provide a macro to generate custom build rules.
.sp
The module defines the following variables:
.INDENT 0.0
.TP
.B \fBBISON_EXECUTABLE\fP
path to the \fBbison\fP program
.TP
.B \fBBISON_VERSION\fP
version of \fBbison\fP
.TP
.B \fBBISON_FOUND\fP
true if the program was found
.UNINDENT
.sp
The minimum required version of \fBbison\fP can be specified using the
standard CMake syntax, e.g. \fBfind_package(BISON 2.1.3)\fP\&.
.sp
If \fBbison\fP is found, the module defines the macro:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
BISON_TARGET(<Name> <YaccInput> <CodeOutput>
[COMPILE_FLAGS <flags>]
[DEFINES_FILE <file>]
[VERBOSE [<file>]]
[REPORT_FILE <file>]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
which will create a custom rule to generate a parser. \fB<YaccInput>\fP is
the path to a yacc file. \fB<CodeOutput>\fP is the name of the source file
generated by bison. A header file is also be generated, and contains
the token list.
.sp
The options are:
.INDENT 0.0
.TP
.B \fBCOMPILE_FLAGS <flags>\fP
Specify flags to be added to the \fBbison\fP command line.
.TP
.B \fBDEFINES_FILE <file>\fP
Specify a non\-default header \fB<file>\fP to be generated by \fBbison\fP\&.
.TP
.B \fBVERBOSE [<file>]\fP
Tell \fBbison\fP to write a report file of the grammar and parser.
If \fB<file>\fP is given, it specifies path the report file is copied to.
\fB[<file>]\fP is left for backward compatibility of this module.
Use \fBVERBOSE REPORT_FILE <file>\fP\&.
.TP
.B \fBREPORT_FILE <file>\fP
Specify a non\-default report \fB<file>\fP, if generated.
.UNINDENT
.sp
The macro defines the following variables:
.INDENT 0.0
.TP
.B \fBBISON_<Name>_DEFINED\fP
true is the macro ran successfully
.TP
.B \fBBISON_<Name>_INPUT\fP
The input source file, an alias for <YaccInput>
.TP
.B \fBBISON_<Name>_OUTPUT_SOURCE\fP
The source file generated by bison
.TP
.B \fBBISON_<Name>_OUTPUT_HEADER\fP
The header file generated by bison
.TP
.B \fBBISON_<Name>_OUTPUTS\fP
All files generated by bison including the source, the header and the report
.TP
.B \fBBISON_<Name>_COMPILE_FLAGS\fP
Options used in the \fBbison\fP command line
.UNINDENT
.sp
Example usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(BISON)
BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h)
add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindBLAS
.sp
Find BLAS library
.sp
This module finds an installed fortran library that implements the
BLAS linear\-algebra interface (see \fI\%http://www.netlib.org/blas/\fP). The
list of libraries searched for is taken from the autoconf macro file,
acx_blas.m4 (distributed at
\fI\%http://ac\-archive.sourceforge.net/ac\-archive/acx_blas.html\fP).
.sp
This module sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
BLAS_FOUND \- set to true if a library implementing the BLAS interface
is found
BLAS_LINKER_FLAGS \- uncached list of required linker flags (excluding \-l
and \-L).
BLAS_LIBRARIES \- uncached list of libraries (using full path name) to
link against to use BLAS
BLAS95_LIBRARIES \- uncached list of libraries (using full path name)
to link against to use BLAS95 interface
BLAS95_FOUND \- set to true if a library implementing the BLAS f95 interface
is found
BLA_STATIC if set on this determines what kind of linkage we do (static)
BLA_VENDOR if set checks only the specified vendor, if not set checks
all the possibilities
BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
List of vendors (BLA_VENDOR) valid in this module:
.INDENT 0.0
.IP \(bu 2
Goto
.IP \(bu 2
OpenBLAS
.IP \(bu 2
ATLAS PhiPACK
.IP \(bu 2
CXML
.IP \(bu 2
DXML
.IP \(bu 2
SunPerf
.IP \(bu 2
SCSL
.IP \(bu 2
SGIMATH
.IP \(bu 2
IBMESSL
.IP \(bu 2
Intel10_32 (intel mkl v10 32 bit)
.IP \(bu 2
Intel10_64lp (intel mkl v10 64 bit, lp thread model, lp64 model)
.IP \(bu 2
Intel10_64lp_seq (intel mkl v10 64 bit, sequential code, lp64 model)
.IP \(bu 2
Intel (older versions of mkl 32 and 64 bit)
.IP \(bu 2
ACML
.IP \(bu 2
ACML_MP
.IP \(bu 2
ACML_GPU
.IP \(bu 2
Apple
.IP \(bu 2
NAS
.IP \(bu 2
Generic
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
C/CXX should be enabled to use Intel mkl
.UNINDENT
.UNINDENT
.SS FindBacktrace
.sp
Find provider for backtrace(3).
.sp
Checks if OS supports backtrace(3) via either libc or custom library.
This module defines the following variables:
.INDENT 0.0
.TP
.B \fBBacktrace_HEADER\fP
The header file needed for backtrace(3). Cached.
Could be forcibly set by user.
.TP
.B \fBBacktrace_INCLUDE_DIRS\fP
The include directories needed to use backtrace(3) header.
.TP
.B \fBBacktrace_LIBRARIES\fP
The libraries (linker flags) needed to use backtrace(3), if any.
.TP
.B \fBBacktrace_FOUND\fP
Is set if and only if backtrace(3) support detected.
.UNINDENT
.sp
The following cache variables are also available to set or use:
.INDENT 0.0
.TP
.B \fBBacktrace_LIBRARY\fP
The external library providing backtrace, if any.
.TP
.B \fBBacktrace_INCLUDE_DIR\fP
The directory holding the backtrace(3) header.
.UNINDENT
.sp
Typical usage is to generate of header file using configure_file() with the
contents like the following:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#cmakedefine01 Backtrace_FOUND
#if Backtrace_FOUND
# include <${Backtrace_HEADER}>
#endif
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
And then reference that generated header file in actual source.
.SS FindBoost
.sp
Find Boost include dirs and libraries
.sp
Use this module by invoking find_package with the form:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Boost
[version] [EXACT] # Minimum or EXACT version e.g. 1.36.0
[REQUIRED] # Fail with error if Boost is not found
[COMPONENTS <libs>...] # Boost libraries by their canonical name
) # e.g. "date_time" for "libboost_date_time"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This module finds headers and requested component libraries OR a CMake
package configuration file provided by a "Boost CMake" build. For the
latter case skip to the "Boost CMake" section below. For the former
case results are reported in variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Boost_FOUND \- True if headers and requested libraries were found
Boost_INCLUDE_DIRS \- Boost include directories
Boost_LIBRARY_DIRS \- Link directories for Boost libraries
Boost_LIBRARIES \- Boost component libraries to be linked
Boost_<C>_FOUND \- True if component <C> was found (<C> is upper\-case)
Boost_<C>_LIBRARY \- Libraries to link for component <C> (may include
target_link_libraries debug/optimized keywords)
Boost_VERSION \- BOOST_VERSION value from boost/version.hpp
Boost_LIB_VERSION \- Version string appended to library filenames
Boost_MAJOR_VERSION \- Boost major version number (X in X.y.z)
Boost_MINOR_VERSION \- Boost minor version number (Y in x.Y.z)
Boost_SUBMINOR_VERSION \- Boost subminor version number (Z in x.y.Z)
Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
\- Pass to add_definitions() to have diagnostic
information about Boost\(aqs automatic linking
displayed during compilation
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This module reads hints about search locations from variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
BOOST_ROOT \- Preferred installation prefix
(or BOOSTROOT)
BOOST_INCLUDEDIR \- Preferred include directory e.g. <prefix>/include
BOOST_LIBRARYDIR \- Preferred library directory e.g. <prefix>/lib
Boost_NO_SYSTEM_PATHS \- Set to ON to disable searching in locations not
specified by these hint variables. Default is OFF.
Boost_ADDITIONAL_VERSIONS
\- List of Boost versions not known to this module
(Boost install locations may contain the version)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
and saves search results persistently in CMake cache entries:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Boost_INCLUDE_DIR \- Directory containing Boost headers
Boost_LIBRARY_DIR_RELEASE \- Directory containing release Boost libraries
Boost_LIBRARY_DIR_DEBUG \- Directory containing debug Boost libraries
Boost_<C>_LIBRARY_DEBUG \- Component <C> library debug variant
Boost_<C>_LIBRARY_RELEASE \- Component <C> library release variant
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following \fBIMPORTED\fP targets are also defined:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Boost::boost \- Target for header\-only dependencies
(Boost include directory)
Boost::<C> \- Target for specific component dependency
(shared or static library); <C> is lower\-
case
Boost::diagnostic_definitions \- interface target to enable diagnostic
information about Boost\(aqs automatic linking
during compilation (adds BOOST_LIB_DIAGNOSTIC)
Boost::disable_autolinking \- interface target to disable automatic
linking with MSVC (adds BOOST_ALL_NO_LIB)
Boost::dynamic_linking \- interface target to enable dynamic linking
linking with MSVC (adds BOOST_ALL_DYN_LINK)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Implicit dependencies such as Boost::filesystem requiring
Boost::system will be automatically detected and satisfied, even
if system is not specified when using find_package and if
Boost::system is not added to target_link_libraries. If using
Boost::thread, then Thread::Thread will also be added automatically.
.sp
It is important to note that the imported targets behave differently
than variables created by this module: multiple calls to
find_package(Boost) in the same directory or sub\-directories with
different options (e.g. static or shared) will not override the
values of the targets created by the first call.
.sp
Users may set these hints or results as cache entries. Projects
should not read these entries directly but instead use the above
result variables. Note that some hint names start in upper\-case
"BOOST". One may specify these as environment variables if they are
not specified as CMake variables or cache entries.
.sp
This module first searches for the Boost header files using the above
hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
Boost_INCLUDE_DIR. Then it searches for requested component libraries
using the above hints (excluding BOOST_INCLUDEDIR and
Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
and the library name configuration settings below. It saves the
library directories in Boost_LIBRARY_DIR_DEBUG and
Boost_LIBRARY_DIR_RELEASE and individual library
locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
When one changes settings used by previous searches in the same build
tree (excluding environment variables) this module discards previous
search results affected by the changes and searches again.
.sp
Boost libraries come in many variants encoded in their file name.
Users or projects may tell this module which variant to find by
setting variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Boost_USE_MULTITHREADED \- Set to OFF to use the non\-multithreaded
libraries (\(aqmt\(aq tag). Default is ON.
Boost_USE_STATIC_LIBS \- Set to ON to force the use of the static
libraries. Default is OFF.
Boost_USE_STATIC_RUNTIME \- Set to ON or OFF to specify whether to use
libraries linked statically to the C++ runtime
(\(aqs\(aq tag). Default is platform dependent.
Boost_USE_DEBUG_RUNTIME \- Set to ON or OFF to specify whether to use
libraries linked to the MS debug C++ runtime
(\(aqg\(aq tag). Default is ON.
Boost_USE_DEBUG_PYTHON \- Set to ON to use libraries compiled with a
debug Python build (\(aqy\(aq tag). Default is OFF.
Boost_USE_STLPORT \- Set to ON to use libraries compiled with
STLPort (\(aqp\(aq tag). Default is OFF.
Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
\- Set to ON to use libraries compiled with
STLPort deprecated "native iostreams"
(\(aqn\(aq tag). Default is OFF.
Boost_COMPILER \- Set to the compiler\-specific library suffix
(e.g. "\-gcc43"). Default is auto\-computed
for the C++ compiler in use. A list may be
used if multiple compatible suffixes should
be tested for, in decreasing order of
preference.
Boost_THREADAPI \- Suffix for "thread" component library name,
such as "pthread" or "win32". Names with
and without this suffix will both be tried.
Boost_NAMESPACE \- Alternate namespace used to build boost with
e.g. if set to "myboost", will search for
myboost_thread instead of boost_thread.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Other variables one may set to control this module are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Boost_DEBUG \- Set to ON to enable debug output from FindBoost.
Please enable this before filing any bug report.
Boost_DETAILED_FAILURE_MSG
\- Set to ON to add detailed information to the
failure message even when the REQUIRED option
is not given to the find_package call.
Boost_REALPATH \- Set to ON to resolve symlinks for discovered
libraries to assist with packaging. For example,
the "system" component library may be resolved to
"/usr/lib/libboost_system.so.1.42.0" instead of
"/usr/lib/libboost_system.so". This does not
affect linking and should not be enabled unless
the user needs this information.
Boost_LIBRARY_DIR \- Default value for Boost_LIBRARY_DIR_RELEASE and
Boost_LIBRARY_DIR_DEBUG.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
On Visual Studio and Borland compilers Boost headers request automatic
linking to corresponding libraries. This requires matching libraries
to be linked explicitly or available in the link library search path.
In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
dynamic linking. Boost automatic linking typically requests static
libraries with a few exceptions (such as Boost.Python). Use:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
to ask Boost to report information about automatic linking requests.
.sp
Example to find Boost headers only:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Boost 1.36.0)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(foo foo.cc)
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example to find Boost libraries and use imported targets:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Boost 1.56 REQUIRED COMPONENTS
date_time filesystem iostreams)
add_executable(foo foo.cc)
target_link_libraries(foo Boost::date_time Boost::filesystem
Boost::iostreams)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example to find Boost headers and some \fIstatic\fP libraries:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(Boost_USE_STATIC_LIBS ON) # only find static libs
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.36.0 COMPONENTS date_time filesystem system ...)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo ${Boost_LIBRARIES})
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Boost CMake
.sp
If Boost was built using the boost\-cmake project it provides a package
configuration file for use with find_package\(aqs Config mode. This
module looks for the package configuration file called
BoostConfig.cmake or boost\-config.cmake and stores the result in cache
entry "Boost_DIR". If found, the package configuration file is loaded
and this module returns with no further action. See documentation of
the Boost CMake package configuration for details on what it provides.
.sp
Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost\-cmake.
.SS FindBullet
.sp
Try to find the Bullet physics engine
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
This module defines the following variables
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
BULLET_FOUND \- Was bullet found
BULLET_INCLUDE_DIRS \- the Bullet include directories
BULLET_LIBRARIES \- Link to this, by default it includes
all bullet components (Dynamics,
Collision, LinearMath, & SoftBody)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
This module accepts the following variables
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
BULLET_ROOT \- Can be set to bullet install path or Windows build path
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindBZip2
.sp
Try to find BZip2
.SS IMPORTED Targets
.sp
This module defines \fBIMPORTED\fP target \fBBZip2::BZip2\fP, if
BZip2 has been found.
.SS Result Variables
.sp
This module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
BZIP2_FOUND \- system has BZip2
BZIP2_INCLUDE_DIR \- the BZip2 include directory
BZIP2_LIBRARIES \- Link these to use BZip2
BZIP2_NEED_PREFIX \- this is set if the functions are prefixed with BZ2_
BZIP2_VERSION_STRING \- the version of BZip2 found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindCABLE
.sp
Find CABLE
.sp
This module finds if CABLE is installed and determines where the
include files and libraries are. This code sets the following
variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CABLE the path to the cable executable
CABLE_TCL_LIBRARY the path to the Tcl wrapper library
CABLE_INCLUDE_DIR the path to the include directory
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To build Tcl wrappers, you should add shared library and link it to
${CABLE_TCL_LIBRARY}. You should also add ${CABLE_INCLUDE_DIR} as an
include directory.
.SS FindCoin3D
.sp
Find Coin3D (Open Inventor)
.sp
Coin3D is an implementation of the Open Inventor API. It provides
data structures and algorithms for 3D visualization.
.sp
This module defines the following variables
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
COIN3D_FOUND \- system has Coin3D \- Open Inventor
COIN3D_INCLUDE_DIRS \- where the Inventor include directory can be found
COIN3D_LIBRARIES \- Link to this to use Coin3D
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindCUDA
.sp
Tools for building CUDA C files: libraries and build dependencies.
.sp
This script locates the NVIDIA CUDA C tools. It should work on linux,
windows, and mac and should be reasonably up to date with CUDA C
releases.
.sp
This script makes use of the standard find_package arguments of
<VERSION>, REQUIRED and QUIET. CUDA_FOUND will report if an
acceptable version of CUDA was found.
.sp
The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR if
the prefix cannot be determined by the location of nvcc in the system
path and REQUIRED is specified to find_package(). To use a different
installed version of the toolkit set the environment variable
CUDA_BIN_PATH before running cmake (e.g.
CUDA_BIN_PATH=/usr/local/cuda1.0 instead of the default
/usr/local/cuda) or set CUDA_TOOLKIT_ROOT_DIR after configuring. If
you change the value of CUDA_TOOLKIT_ROOT_DIR, various components that
depend on the path will be relocated.
.sp
It might be necessary to set CUDA_TOOLKIT_ROOT_DIR manually on certain
platforms, or to use a cuda runtime not installed in the default
location. In newer versions of the toolkit the cuda library is
included with the graphics driver\- be sure that the driver version
matches what is needed by the cuda runtime version.
.sp
The following variables affect the behavior of the macros in the
script (in alphebetical order). Note that any of these flags can be
changed multiple times in the same directory before calling
CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX,
CUDA_COMPILE_FATBIN, CUDA_COMPILE_CUBIN or CUDA_WRAP_SRCS:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
\-\- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
Note that making this different from the host code when generating object
or C files from CUDA code just won\(aqt work, because size_t gets defined by
nvcc in the generated source. If you compile to PTX and then load the
file yourself, you can mix bit sizes between device and host.
CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
\-\- Set to ON if you want the custom build rule to be attached to the source
file in Visual Studio. Turn OFF if you add the same cuda file to multiple
targets.
This allows the user to build the target from the CUDA file; however, bad
things can happen if the CUDA source file is added to multiple targets.
When performing parallel builds it is possible for the custom build
command to be run more than once and in parallel causing cryptic build
errors. VS runs the rules for every source file in the target, and a
source can have only one rule no matter how many projects it is added to.
When the rule is run from multiple targets race conditions can occur on
the generated file. Eventually everything will get built, but if the user
is unaware of this behavior, there may be confusion. It would be nice if
this script could detect the reuse of source files across multiple targets
and turn the option off for the user, but no good solution could be found.
CUDA_BUILD_CUBIN (Default OFF)
\-\- Set to ON to enable and extra compilation pass with the \-cubin option in
Device mode. The output is parsed and register, shared memory usage is
printed during build.
CUDA_BUILD_EMULATION (Default OFF for device mode)
\-\- Set to ON for Emulation mode. \-D_DEVICEEMU is defined for CUDA C files
when CUDA_BUILD_EMULATION is TRUE.
CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
\-\- Set to the path you wish to have the generated files placed. If it is
blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
Intermediate files will always be placed in
CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
CUDA_HOST_COMPILATION_CPP (Default ON)
\-\- Set to OFF for C compilation of host code.
CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
\-\- Set the host compiler to be used by nvcc. Ignored if \-ccbin or
\-\-compiler\-bindir is already present in the CUDA_NVCC_FLAGS or
CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets
$(VCInstallDir)/bin is a special value that expands out to the path when
the command is run from within VS.
CUDA_NVCC_FLAGS
CUDA_NVCC_FLAGS_<CONFIG>
\-\- Additional NVCC command line arguments. NOTE: multiple arguments must be
semi\-colon delimited (e.g. \-\-compiler\-options;\-Wall)
CUDA_PROPAGATE_HOST_FLAGS (Default ON)
\-\- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
host compiler through nvcc\(aqs \-Xcompiler flag. This helps make the
generated host code match the rest of the system better. Sometimes
certain flags give nvcc problems, and this will help you turn the flag
propagation off. This does not affect the flags supplied directly to nvcc
via CUDA_NVCC_FLAGS or through the OPTION flags specified through
CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
shared library compilation are not affected by this flag.
CUDA_SEPARABLE_COMPILATION (Default OFF)
\-\- If set this will enable separable compilation for all CUDA runtime object
files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
(e.g. calling CUDA_WRAP_SRCS directly),
CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
CUDA_SOURCE_PROPERTY_FORMAT
\-\- If this source file property is set, it can override the format specified
to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file
is not a .cu file, setting this file will cause it to be treated as a .cu
file. See documentation for set_source_files_properties on how to set
this property.
CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
\-\- When enabled the static version of the CUDA runtime library will be used
in CUDA_LIBRARIES. If the version of CUDA configured doesn\(aqt support
this option, then it will be silently disabled.
CUDA_VERBOSE_BUILD (Default OFF)
\-\- Set to ON to see all the commands used when building the CUDA file. When
using a Makefile generator the value defaults to VERBOSE (run make
VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
always print the output.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The script creates the following macros (in alphebetical order):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
\-\- Adds the cufft library to the target (can be any target). Handles whether
you are in emulation mode or not.
CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
\-\- Adds the cublas library to the target (can be any target). Handles
whether you are in emulation mode or not.
CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
[WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
\-\- Creates an executable "cuda_target" which is made up of the files
specified. All of the non CUDA C files are compiled using the standard
build rules specified by CMAKE and the cuda files are compiled to object
files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
added automatically to include_directories(). Some standard CMake target
calls can be used on the target after calling this macro
(e.g. set_target_properties and target_link_libraries), but setting
properties that adjust compilation flags will not affect code compiled by
nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
[STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
\-\- Same as CUDA_ADD_EXECUTABLE except that a library is created.
CUDA_BUILD_CLEAN_TARGET()
\-\- Creates a convience target that deletes all the dependency files
generated. You should make clean after running this target to ensure the
dependency files get regenerated.
CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
[OPTIONS ...] )
\-\- Returns a list of generated files from the input source files to be used
with ADD_LIBRARY or ADD_EXECUTABLE.
CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
\-\- Returns a list of PTX files generated from the input source files.
CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
\-\- Returns a list of FATBIN files generated from the input source files.
CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
\-\- Returns a list of CUBIN files generated from the input source files.
CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
cuda_target
object_files )
\-\- Compute the name of the intermediate link file used for separable
compilation. This file name is typically passed into
CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced
based on cuda_target the list of objects files that need separable
compilation as specified by object_files. If the object_files list is
empty, then output_file_var will be empty. This function is called
automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
this is a function and not a macro.
CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
\-\- Sets the directories that should be passed to nvcc
(e.g. nvcc \-Ipath0 \-Ipath1 ... ). These paths usually contain other .cu
files.
CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
nvcc_flags object_files)
\-\- Generates the link object required by separable compilation from the given
object files. This is called automatically for CUDA_ADD_EXECUTABLE and
CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
nvcc_flags passed in are the same as the flags passed in via the OPTIONS
argument. The only nvcc flag added automatically is the bitness flag as
specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
instead of a macro.
CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures])
\-\- Selects GPU arch flags for nvcc based on target_CUDA_architectures
target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...)
\- "Auto" detects local machine GPU compute arch at runtime.
\- "Common" and "All" cover common and entire subsets of architectures
ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal
NUM: Any number. Only those pairs are currently accepted by NVCC though:
2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2
Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
Additionally, sets ${out_variable}_readable to the resulting numeric list
Example:
CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell)
LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA
Note that this is a function instead of a macro.
CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
[STATIC | SHARED | MODULE] [OPTIONS ...] )
\-\- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
function under the hood.
Given the list of files (file0 file1 ... fileN) this macro generates
custom commands that generate either PTX or linkable objects (use "PTX" or
"OBJ" for the format argument to switch). Files that don\(aqt end with .cu
or have the HEADER_FILE_ONLY property are ignored.
The arguments passed in after OPTIONS are extra command line options to
give to nvcc. You can also specify per configuration options by
specifying the name of the configuration followed by the options. General
options must precede configuration specific options. Not all
configurations need to be specified, only the ones provided will be used.
OPTIONS \-DFLAG=2 "\-DFLAG_OTHER=space in flag"
DEBUG \-g
RELEASE \-\-use_fast_math
RELWITHDEBINFO \-\-use_fast_math;\-g
MINSIZEREL \-\-use_fast_math
For certain configurations (namely VS generating object files with
CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
be produced for the given cuda file. This is because when you add the
cuda file to Visual Studio it knows that this file produces an object file
and will link in the resulting object file automatically.
This script will also generate a separate cmake script that is used at
build time to invoke nvcc. This is for several reasons.
1. nvcc can return negative numbers as return values which confuses
Visual Studio into thinking that the command succeeded. The script now
checks the error codes and produces errors when there was a problem.
2. nvcc has been known to not delete incomplete results when it
encounters problems. This confuses build systems into thinking the
target was generated when in fact an unusable file exists. The script
now deletes the output files if there was an error.
3. By putting all the options that affect the build into a file and then
make the build rule dependent on the file, the output files will be
regenerated when the options change.
This script also looks at optional arguments STATIC, SHARED, or MODULE to
determine when to target the object compilation for a shared library.
BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
CUDA_ADD_LIBRARY. On some systems special flags are added for building
objects intended for shared libraries. A preprocessor macro,
<target_name>_EXPORTS is defined when a shared library compilation is
detected.
Flags passed into add_definitions with \-D or /D are passed along to nvcc.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The script defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CUDA_VERSION_MAJOR \-\- The major version of cuda as reported by nvcc.
CUDA_VERSION_MINOR \-\- The minor version.
CUDA_VERSION
CUDA_VERSION_STRING \-\- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
CUDA_HAS_FP16 \-\- Whether a short float (float16,fp16) is supported.
CUDA_TOOLKIT_ROOT_DIR \-\- Path to the CUDA Toolkit (defined if not set).
CUDA_SDK_ROOT_DIR \-\- Path to the CUDA SDK. Use this to find files in the
SDK. This script will not directly support finding
specific libraries or headers, as that isn\(aqt
supported by NVIDIA. If you want to change
libraries when the path changes see the
FindCUDA.cmake script for an example of how to clear
these variables. There are also examples of how to
use the CUDA_SDK_ROOT_DIR to locate headers or
libraries, if you so choose (at your own risk).
CUDA_INCLUDE_DIRS \-\- Include directory for cuda headers. Added automatically
for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
CUDA_LIBRARIES \-\- Cuda RT library.
CUDA_CUFFT_LIBRARIES \-\- Device or emulation library for the Cuda FFT
implementation (alternative to:
CUDA_ADD_CUFFT_TO_TARGET macro)
CUDA_CUBLAS_LIBRARIES \-\- Device or emulation library for the Cuda BLAS
implementation (alternative to:
CUDA_ADD_CUBLAS_TO_TARGET macro).
CUDA_cudart_static_LIBRARY \-\- Statically linkable cuda runtime library.
Only available for CUDA version 5.5+
CUDA_cudadevrt_LIBRARY \-\- Device runtime library.
Required for separable compilation.
CUDA_cupti_LIBRARY \-\- CUDA Profiling Tools Interface library.
Only available for CUDA version 4.0+.
CUDA_curand_LIBRARY \-\- CUDA Random Number Generation library.
Only available for CUDA version 3.2+.
CUDA_cusolver_LIBRARY \-\- CUDA Direct Solver library.
Only available for CUDA version 7.0+.
CUDA_cusparse_LIBRARY \-\- CUDA Sparse Matrix library.
Only available for CUDA version 3.2+.
CUDA_npp_LIBRARY \-\- NVIDIA Performance Primitives lib.
Only available for CUDA version 4.0+.
CUDA_nppc_LIBRARY \-\- NVIDIA Performance Primitives lib (core).
Only available for CUDA version 5.5+.
CUDA_nppi_LIBRARY \-\- NVIDIA Performance Primitives lib (image processing).
Only available for CUDA version 5.5+.
CUDA_npps_LIBRARY \-\- NVIDIA Performance Primitives lib (signal processing).
Only available for CUDA version 5.5+.
CUDA_nvcuvenc_LIBRARY \-\- CUDA Video Encoder library.
Only available for CUDA version 3.2+.
Windows only.
CUDA_nvcuvid_LIBRARY \-\- CUDA Video Decoder library.
Only available for CUDA version 3.2+.
Windows only.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindCups
.sp
Try to find the Cups printing system
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CUPS_FOUND \- system has Cups
CUPS_INCLUDE_DIR \- the Cups include directory
CUPS_LIBRARIES \- Libraries needed to use Cups
CUPS_VERSION_STRING \- version of Cups found (since CMake 2.8.8)
Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
features this function (i.e. at least 1.1.19)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindCURL
.sp
Find curl
.sp
Find the native CURL headers and libraries.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CURL_INCLUDE_DIRS \- where to find curl/curl.h, etc.
CURL_LIBRARIES \- List of libraries when using curl.
CURL_FOUND \- True if curl found.
CURL_VERSION_STRING \- the version of curl found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindCurses
.sp
Find the curses or ncurses include file and library.
.SS Result Variables
.sp
This module defines the following variables:
.INDENT 0.0
.TP
.B \fBCURSES_FOUND\fP
True if Curses is found.
.TP
.B \fBCURSES_INCLUDE_DIRS\fP
The include directories needed to use Curses.
.TP
.B \fBCURSES_LIBRARIES\fP
The libraries needed to use Curses.
.TP
.B \fBCURSES_HAVE_CURSES_H\fP
True if curses.h is available.
.TP
.B \fBCURSES_HAVE_NCURSES_H\fP
True if ncurses.h is available.
.TP
.B \fBCURSES_HAVE_NCURSES_NCURSES_H\fP
True if \fBncurses/ncurses.h\fP is available.
.TP
.B \fBCURSES_HAVE_NCURSES_CURSES_H\fP
True if \fBncurses/curses.h\fP is available.
.UNINDENT
.sp
Set \fBCURSES_NEED_NCURSES\fP to \fBTRUE\fP before the
\fBfind_package(Curses)\fP call if NCurses functionality is required.
.SS Backward Compatibility
.sp
The following variable are provided for backward compatibility:
.INDENT 0.0
.TP
.B \fBCURSES_INCLUDE_DIR\fP
Path to Curses include. Use \fBCURSES_INCLUDE_DIRS\fP instead.
.TP
.B \fBCURSES_LIBRARY\fP
Path to Curses library. Use \fBCURSES_LIBRARIES\fP instead.
.UNINDENT
.SS FindCVS
.sp
The module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CVS_EXECUTABLE \- path to cvs command line client
CVS_FOUND \- true if the command line client was found
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(CVS)
if(CVS_FOUND)
message("CVS found: ${CVS_EXECUTABLE}")
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindCxxTest
.sp
Find CxxTest
.sp
Find the CxxTest suite and declare a helper macro for creating unit
tests and integrating them with CTest. For more details on CxxTest
see \fI\%http://cxxtest.tigris.org\fP
.sp
INPUT Variables
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CXXTEST_USE_PYTHON [deprecated since 1.3]
Only used in the case both Python & Perl
are detected on the system to control
which CxxTest code generator is used.
Valid only for CxxTest version 3.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
NOTE: In older versions of this Find Module,
this variable controlled if the Python test
generator was used instead of the Perl one,
regardless of which scripting language the
user had installed.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
Specify a list of options to pass to the CxxTest code
generator. If not defined, \-\-error\-printer is
passed.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
OUTPUT Variables
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CXXTEST_FOUND
True if the CxxTest framework was found
CXXTEST_INCLUDE_DIRS
Where to find the CxxTest include directory
CXXTEST_PERL_TESTGEN_EXECUTABLE
The perl\-based test generator
CXXTEST_PYTHON_TESTGEN_EXECUTABLE
The python\-based test generator
CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
The test generator that is actually used (chosen using user preferences
and interpreters found in the system)
CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
The full path to the Perl or Python executable on the system, on
platforms where the script cannot be executed using its shebang line.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
MACROS for optional use by CMake users:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
Creates a CxxTest runner and adds it to the CTest testing suite
Parameters:
test_name The name of the test
gen_source_file The generated source filename to be
generated by CxxTest
input_files_to_testgen The list of header files containing the
CxxTest::TestSuite\(aqs to be included in
this runner
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#==============
Example Usage:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(CxxTest)
if(CXXTEST_FOUND)
include_directories(${CXXTEST_INCLUDE_DIR})
enable_testing()
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CXXTEST_ADD_TEST(unittest_foo foo_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
target_link_libraries(unittest_foo foo) # as needed
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
This will (if CxxTest is found):
1. Invoke the testgen executable to autogenerate foo_test.cc in the
binary tree from "foo_test.h" in the current source directory.
2. Create an executable and test called unittest_foo.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#=============
Example foo_test.h:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include <cxxtest/TestSuite.h>
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
class MyTestSuite : public CxxTest::TestSuite
{
public:
void testAddition( void )
{
TS_ASSERT( 1 + 1 > 1 );
TS_ASSERT_EQUALS( 1 + 1, 2 );
}
};
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindCygwin
.sp
this module looks for Cygwin
.SS FindDart
.sp
Find DART
.sp
This module looks for the dart testing software and sets DART_ROOT to
point to where it found it.
.SS FindDCMTK
.sp
Find DCMTK libraries and applications
.sp
The module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
DCMTK_INCLUDE_DIRS \- Directories to include to use DCMTK
DCMTK_LIBRARIES \- Files to link against to use DCMTK
DCMTK_FOUND \- If false, don\(aqt try to use DCMTK
DCMTK_DIR \- (optional) Source directory for DCMTK
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Compatibility
.sp
This module is able to find a version of DCMTK that does or does not export
a \fIDCMTKConfig.cmake\fP file. It applies a two step process:
.INDENT 0.0
.IP \(bu 2
Step 1: Attempt to find DCMTK version providing a \fIDCMTKConfig.cmake\fP file.
.IP \(bu 2
Step 2: If step 1 failed, rely on \fIFindDCMTK.cmake\fP to set \fIDCMTK_*\fP variables details below.
.UNINDENT
.sp
\fI\%Recent DCMTK\fP
provides a \fIDCMTKConfig.cmake\fP \fBpackage configuration file\fP\&. To exclusively use the package configuration file
(recommended when possible), pass the \fINO_MODULE\fP option to
\fBfind_package()\fP\&. For example, \fIfind_package(DCMTK NO_MODULE)\fP\&.
This requires official DCMTK snapshot \fI3.6.1_20140617\fP or newer.
.sp
Until all clients update to the more recent DCMTK, build systems will need
to support different versions of DCMTK.
.sp
On any given system, the following combinations of DCMTK versions could be
considered:
.TS
center;
|l|l|l|l|.
_
T{
T} T{
SYSTEM DCMTK
T} T{
LOCAL DCMTK
T} T{
Supported ?
T}
_
T{
Case A
T} T{
NA
T} T{
[ ] DCMTKConfig
T} T{
YES
T}
_
T{
Case B
T} T{
NA
T} T{
[X] DCMTKConfig
T} T{
YES
T}
_
T{
Case C
T} T{
[ ] DCMTKConfig
T} T{
NA
T} T{
YES
T}
_
T{
Case D
T} T{
[X] DCMTKConfig
T} T{
NA
T} T{
YES
T}
_
T{
Case E
T} T{
[ ] DCMTKConfig
T} T{
[ ] DCMTKConfig
T} T{
YES (*)
T}
_
T{
Case F
T} T{
[X] DCMTKConfig
T} T{
[ ] DCMTKConfig
T} T{
NO
T}
_
T{
Case G
T} T{
[ ] DCMTKConfig
T} T{
[X] DCMTKConfig
T} T{
YES
T}
_
T{
Case H
T} T{
[X] DCMTKConfig
T} T{
[X] DCMTKConfig
T} T{
YES
T}
_
.TE
.INDENT 0.0
.INDENT 3.5
(*) See Troubleshooting section.
.UNINDENT
.UNINDENT
.sp
Legend:
.INDENT 0.0
.INDENT 3.5
NA ...............: Means that no System or Local DCMTK is available
.sp
[ ] DCMTKConfig ..: Means that the version of DCMTK does NOT export a DCMTKConfig.cmake file.
.sp
[X] DCMTKConfig ..: Means that the version of DCMTK exports a DCMTKConfig.cmake file.
.UNINDENT
.UNINDENT
.SS Troubleshooting
.sp
What to do if my project finds a different version of DCMTK?
.sp
Remove DCMTK entry from the CMake cache per \fBfind_package()\fP
documentation.
.SS FindDevIL
.sp
This module locates the developer\(aqs image library.
\fI\%http://openil.sourceforge.net/\fP
.sp
This module sets:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
IL_LIBRARIES \- the name of the IL library. These include the full path to
the core DevIL library. This one has to be linked into the
application.
ILU_LIBRARIES \- the name of the ILU library. Again, the full path. This
library is for filters and effects, not actual loading. It
doesn\(aqt have to be linked if the functionality it provides
is not used.
ILUT_LIBRARIES \- the name of the ILUT library. Full path. This part of the
library interfaces with OpenGL. It is not strictly needed
in applications.
IL_INCLUDE_DIR \- where to find the il.h, ilu.h and ilut.h files.
DevIL_FOUND \- this is set to TRUE if all the above variables were set.
This will be set to false if ILU or ILUT are not found,
even if they are not needed. In most systems, if one
library is found all the others are as well. That\(aqs the
way the DevIL developers release it.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindDoxygen
.sp
This module looks for Doxygen and the path to Graphviz\(aqs dot
.sp
Doxygen is a documentation generation tool. Please see
\fI\%http://www.doxygen.org\fP
.sp
This module accepts the following optional variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
(an optional component often used by Doxygen)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This modules defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
DOXYGEN_EXECUTABLE = The path to the doxygen command.
DOXYGEN_FOUND = Was Doxygen found or not?
DOXYGEN_VERSION = The version reported by doxygen \-\-version
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
DOXYGEN_DOT_FOUND = Was Dot found or not?
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For compatibility with older versions of CMake, the now\-deprecated
variable \fBDOXYGEN_DOT_PATH\fP is set to the path to the directory
containing \fBdot\fP as reported in \fBDOXYGEN_DOT_EXECUTABLE\fP\&.
The path may have forward slashes even on Windows and is not
suitable for direct substitution into a \fBDoxyfile.in\fP template.
If you need this value, use \fBget_filename_component()\fP
to compute it from \fBDOXYGEN_DOT_EXECUTABLE\fP directly, and
perhaps the \fBfile(TO_NATIVE_PATH)\fP command to prepare
the path for a Doxygen configuration file.
.SS FindEXPAT
.sp
Find expat
.sp
Find the native EXPAT headers and libraries.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
EXPAT_INCLUDE_DIRS \- where to find expat.h, etc.
EXPAT_LIBRARIES \- List of libraries when using expat.
EXPAT_FOUND \- True if expat found.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindFLEX
.sp
Find flex executable and provides a macro to generate custom build rules
.sp
The module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLEX_FOUND \- true is flex executable is found
FLEX_EXECUTABLE \- the path to the flex executable
FLEX_VERSION \- the version of flex
FLEX_LIBRARIES \- The flex libraries
FLEX_INCLUDE_DIRS \- The path to the flex headers
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum required version of flex can be specified using the
standard syntax, e.g. find_package(FLEX 2.5.13)
.sp
If flex is found on the system, the module provides the macro:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLEX_TARGET(Name FlexInput FlexOutput
[COMPILE_FLAGS <string>]
[DEFINES_FILE <string>]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
which creates a custom command to generate the <FlexOutput> file from
the <FlexInput> file. If COMPILE_FLAGS option is specified, the next
parameter is added to the flex command line. If flex is configured to
output a header file, the DEFINES_FILE option may be used to specify its
name. Name is an alias used to get details of this custom command.
Indeed the macro defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLEX_${Name}_DEFINED \- true is the macro ran successfully
FLEX_${Name}_OUTPUTS \- the source file generated by the custom rule, an
alias for FlexOutput
FLEX_${Name}_INPUT \- the flex source file, an alias for ${FlexInput}
FLEX_${Name}_OUTPUT_HEADER \- the header flex output, if any.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Flex scanners oftenly use tokens defined by Bison: the code generated
by Flex depends of the header generated by Bison. This module also
defines a macro:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
which adds the required dependency between a scanner and a parser
where <FlexTarget> and <BisonTarget> are the first parameters of
respectively FLEX_TARGET and BISON_TARGET macros.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
====================================================================
Example:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(BISON)
find_package(FLEX)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(Foo
Foo.cc
${BISON_MyParser_OUTPUTS}
${FLEX_MyScanner_OUTPUTS}
)
====================================================================
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindFLTK2
.sp
Find the native FLTK2 includes and library
.sp
The following settings are defined
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
FLTK2_INCLUDE_DIR, where to find include files
FLTK2_LIBRARIES, list of fltk2 libraries
FLTK2_FOUND, Don\(aqt use FLTK2 if false.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following settings should not be used in general.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLTK2_BASE_LIBRARY = the full path to fltk2.lib
FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib
FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindFLTK
.sp
Find the native FLTK includes and library
.sp
By default FindFLTK.cmake will search for all of the FLTK components
and add them to the FLTK_LIBRARIES variable.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
You can limit the components which get placed in FLTK_LIBRARIES by
defining one or more of the following three options:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLTK_SKIP_OPENGL, set to true to disable searching for opengl and
the FLTK GL library
FLTK_SKIP_FORMS, set to true to disable searching for fltk_forms
FLTK_SKIP_IMAGES, set to true to disable searching for fltk_images
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLTK_SKIP_FLUID, set to true if the fluid binary need not be present
at build time
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables will be defined:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLTK_FOUND, True if all components not skipped were found
FLTK_INCLUDE_DIR, where to find include files
FLTK_LIBRARIES, list of fltk libraries you should link against
FLTK_FLUID_EXECUTABLE, where to find the Fluid tool
FLTK_WRAP_UI, This enables the FLTK_WRAP_UI command
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following cache variables are assigned but should not be used.
See the FLTK_LIBRARIES variable instead.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FLTK_BASE_LIBRARY = the full path to fltk.lib
FLTK_GL_LIBRARY = the full path to fltk_gl.lib
FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindFreetype
.sp
Locate FreeType library
.sp
This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FREETYPE_LIBRARIES, the library to link against
FREETYPE_FOUND, if false, do not try to link to FREETYPE
FREETYPE_INCLUDE_DIRS, where to find headers.
FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
This is the concatenation of the paths:
FREETYPE_INCLUDE_DIR_ft2build
FREETYPE_INCLUDE_DIR_freetype2
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
$FREETYPE_DIR is an environment variable that would correspond to the
./configure \-\-prefix=$FREETYPE_DIR used in building FREETYPE.
.SS FindGCCXML
.sp
Find the GCC\-XML front\-end executable.
.sp
This module will define the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GCCXML \- the GCC\-XML front\-end executable.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGDAL
.sp
Locate gdal
.sp
This module accepts the following environment variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GDAL_DIR or GDAL_ROOT \- Specify the location of GDAL
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This module defines the following CMake variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GDAL_FOUND \- True if libgdal is found
GDAL_LIBRARY \- A variable pointing to the GDAL library
GDAL_INCLUDE_DIR \- Where to find the headers
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGettext
.sp
Find GNU gettext tools
.sp
This module looks for the GNU gettext tools. This module defines the
following values:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
GETTEXT_FOUND: True if gettext has been found.
GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Additionally it provides the following macros:
.sp
GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
This will create a target "translations" which will convert the
given input po files into the binary output mo file. If the
ALL option is used, the translations will also be created when
building the default target.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
GETTEXT_PROCESS_POT_FILE( <potfile> [ALL] [INSTALL_DESTINATION <destdir>]
LANGUAGES <lang1> <lang2> ... )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Process the given pot file to mo files.
If INSTALL_DESTINATION is given then automatically install rules will
be created, the language subdirectory will be taken into account
(by default use share/locale/).
If ALL is specified, the pot file is processed when building the all traget.
It creates a custom target "potfile".
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>]
PO_FILES <po1> <po2> ... )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Process the given po files to mo files for the given language.
If INSTALL_DESTINATION is given then automatically install rules will
be created, the language subdirectory will be taken into account
(by default use share/locale/).
If ALL is specified, the po files are processed when building the all traget.
It creates a custom target "pofiles".
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
If you wish to use the Gettext library (libintl), use \fBFindIntl\fP\&.
.UNINDENT
.UNINDENT
.SS FindGIF
.sp
This finds the GIF library (giflib)
.sp
The module defines the following variables:
.INDENT 0.0
.TP
.B \fBGIF_FOUND\fP
True if giflib was found
.TP
.B \fBGIF_LIBRARIES\fP
Libraries to link to in order to use giflib
.TP
.B \fBGIF_INCLUDE_DIR\fP
where to find the headers
.TP
.B \fBGIF_VERSION\fP
3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6
.UNINDENT
.sp
The minimum required version of giflib can be specified using the
standard syntax, e.g. find_package(GIF 4)
.sp
$GIF_DIR is an environment variable that would correspond to the
./configure \-\-prefix=$GIF_DIR
.SS FindGit
.sp
The module defines the following variables:
.INDENT 0.0
.TP
.B \fBGIT_EXECUTABLE\fP
Path to Git command\-line client.
.TP
.B \fBGit_FOUND\fP, \fBGIT_FOUND\fP
True if the Git command\-line client was found.
.TP
.B \fBGIT_VERSION_STRING\fP
The version of Git found.
.UNINDENT
.sp
Example usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Git)
if(Git_FOUND)
message("Git found: ${GIT_EXECUTABLE}")
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGLEW
.sp
Find the OpenGL Extension Wrangler Library (GLEW)
.SS IMPORTED Targets
.sp
This module defines the \fBIMPORTED\fP target \fBGLEW::GLEW\fP,
if GLEW has been found.
.SS Result Variables
.sp
This module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GLEW_INCLUDE_DIRS \- include directories for GLEW
GLEW_LIBRARIES \- libraries to link against GLEW
GLEW_FOUND \- true if GLEW has been found and can be used
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGLUT
.sp
try to find glut library and include files.
.SS IMPORTED Targets
.sp
This module defines the \fBIMPORTED\fP targets:
.INDENT 0.0
.TP
.B \fBGLUT::GLUT\fP
Defined if the system has GLUT.
.UNINDENT
.SS Result Variables
.sp
This module sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
GLUT_LIBRARIES, the libraries to link against
GLUT_FOUND, If false, do not try to use GLUT.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Also defined, but not for general use are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GLUT_glut_LIBRARY = the full path to the glut library.
GLUT_Xmu_LIBRARY = the full path to the Xmu library.
GLUT_Xi_LIBRARY = the full path to the Xi Library.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGnuplot
.sp
this module looks for gnuplot
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GNUPLOT_FOUND \- system has Gnuplot
GNUPLOT_EXECUTABLE \- the Gnuplot executable
GNUPLOT_VERSION_STRING \- the version of Gnuplot found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
.SS FindGnuTLS
.sp
Try to find the GNU Transport Layer Security library (gnutls)
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GNUTLS_FOUND \- System has gnutls
GNUTLS_INCLUDE_DIR \- The gnutls include directory
GNUTLS_LIBRARIES \- The libraries needed to use gnutls
GNUTLS_DEFINITIONS \- Compiler switches required for using gnutls
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGSL
.sp
Find the native GSL includes and libraries.
.sp
The GNU Scientific Library (GSL) is a numerical library for C and C++
programmers. It is free software under the GNU General Public
License.
.SS Imported Targets
.sp
If GSL is found, this module defines the following \fBIMPORTED\fP
targets:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GSL::gsl \- The main GSL library.
GSL::gslcblas \- The CBLAS support library used by GSL.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Result Variables
.sp
This module will set the following variables in your project:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GSL_FOUND \- True if GSL found on the local system
GSL_INCLUDE_DIRS \- Location of GSL header files.
GSL_LIBRARIES \- The GSL libraries.
GSL_VERSION \- The version of the discovered GSL install.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Hints
.sp
Set \fBGSL_ROOT_DIR\fP to a directory that contains a GSL installation.
.sp
This script expects to find libraries at \fB$GSL_ROOT_DIR/lib\fP and the GSL
headers at \fB$GSL_ROOT_DIR/include/gsl\fP\&. The library directory may
optionally provide Release and Debug folders. For Unix\-like systems, this
script will use \fB$GSL_ROOT_DIR/bin/gsl\-config\fP (if found) to aid in the
discovery GSL.
.SS Cache Variables
.sp
This module may set the following variables depending on platform and type
of GSL installation discovered. These variables may optionally be set to
help this module find the correct files:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GSL_CBLAS_LIBRARY \- Location of the GSL CBLAS library.
GSL_CBLAS_LIBRARY_DEBUG \- Location of the debug GSL CBLAS library (if any).
GSL_CONFIG_EXECUTABLE \- Location of the \(ga\(gagsl\-config\(ga\(ga script (if any).
GSL_LIBRARY \- Location of the GSL library.
GSL_LIBRARY_DEBUG \- Location of the debug GSL library (if any).
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGTest
.sp
Locate the Google C++ Testing Framework.
.SS Imported targets
.sp
This module defines the following \fBIMPORTED\fP targets:
.INDENT 0.0
.TP
.B \fBGTest::GTest\fP
The Google Test \fBgtest\fP library, if found; adds Thread::Thread
automatically
.TP
.B \fBGTest::Main\fP
The Google Test \fBgtest_main\fP library, if found
.UNINDENT
.SS Result variables
.sp
This module will set the following variables in your project:
.INDENT 0.0
.TP
.B \fBGTEST_FOUND\fP
Found the Google Testing framework
.TP
.B \fBGTEST_INCLUDE_DIRS\fP
the directory containing the Google Test headers
.UNINDENT
.sp
The library variables below are set as normal variables. These
contain debug/optimized keywords when a debugging library is found.
.INDENT 0.0
.TP
.B \fBGTEST_LIBRARIES\fP
The Google Test \fBgtest\fP library; note it also requires linking
with an appropriate thread library
.TP
.B \fBGTEST_MAIN_LIBRARIES\fP
The Google Test \fBgtest_main\fP library
.TP
.B \fBGTEST_BOTH_LIBRARIES\fP
Both \fBgtest\fP and \fBgtest_main\fP
.UNINDENT
.SS Cache variables
.sp
The following cache variables may also be set:
.INDENT 0.0
.TP
.B \fBGTEST_ROOT\fP
The root directory of the Google Test installation (may also be
set as an environment variable)
.TP
.B \fBGTEST_MSVC_SEARCH\fP
If compiling with MSVC, this variable can be set to \fBMT\fP or
\fBMD\fP (the default) to enable searching a GTest build tree
.UNINDENT
.SS Example usage
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
enable_testing()
find_package(GTest REQUIRED)
add_executable(foo foo.cc)
target_link_libraries(foo GTest::GTest GTest::Main)
add_test(AllTestsInFoo foo)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Deeper integration with CTest
.sp
If you would like each Google test to show up in CTest as a test you
may use the following macro:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GTEST_ADD_TESTS(executable extra_args files...)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \fBexecutable\fP
the path to the test executable
.TP
.B \fBextra_args\fP
a list of extra arguments to be passed to executable enclosed in
quotes (or \fB""\fP for none)
.TP
.B \fBfiles...\fP
a list of source files to search for tests and test fixtures. Or
\fBAUTO\fP to find them from executable target
.UNINDENT
.sp
However, note that this macro will slow down your tests by running
an executable for each test and test fixture.
.sp
Example usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(FooTestArgs \-\-foo 1 \-\-bar 2)
add_executable(FooTest FooUnitTest.cc)
GTEST_ADD_TESTS(FooTest "${FooTestArgs}" AUTO)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGTK2
.sp
FindGTK2.cmake
.sp
This module can find the GTK2 widget libraries and several of its
other optional components like gtkmm, glade, and glademm.
.sp
NOTE: If you intend to use version checking, CMake 2.6.2 or later is
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
required.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Specify one or more of the following components as you call this find
module. See example below.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
gtk
gtkmm
glade
glademm
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variables will be defined for your use
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GTK2_FOUND \- Were all of your specified components found?
GTK2_INCLUDE_DIRS \- All include directories
GTK2_LIBRARIES \- All libraries
GTK2_TARGETS \- All imported targets
GTK2_DEFINITIONS \- Additional compiler flags
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GTK2_VERSION \- The version of GTK2 found (x.y.z)
GTK2_MAJOR_VERSION \- The major version of GTK2
GTK2_MINOR_VERSION \- The minor version of GTK2
GTK2_PATCH_VERSION \- The patch version of GTK2
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Optional variables you can define prior to calling this module:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GTK2_DEBUG \- Enables verbose debugging of the module
GTK2_ADDITIONAL_SUFFIXES \- Allows defining additional directories to
search for include files
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
================= Example Usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Call find_package() once, here are some examples to pick from:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Require GTK 2.6 or later
find_package(GTK2 2.6 REQUIRED gtk)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Require GTK 2.10 or later and Glade
find_package(GTK2 2.10 REQUIRED gtk glade)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Search for GTK/GTKMM 2.8 or later
find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
if(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
add_executable(mygui mygui.cc)
target_link_libraries(mygui ${GTK2_LIBRARIES})
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindGTK
.sp
try to find GTK (and glib) and GTKGLArea
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GTK_INCLUDE_DIR \- Directories to include to use GTK
GTK_LIBRARIES \- Files to link against to use GTK
GTK_FOUND \- GTK was found
GTK_GL_FOUND \- GTK\(aqs GL features were found
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindHDF5
.sp
Find HDF5, a library for reading and writing self describing array data.
.sp
This module invokes the HDF5 wrapper compiler that should be installed
alongside HDF5. Depending upon the HDF5 Configuration, the wrapper
compiler is called either h5cc or h5pcc. If this succeeds, the module
will then call the compiler with the \-show argument to see what flags
are used when compiling an HDF5 client application.
.sp
The module will optionally accept the COMPONENTS argument. If no
COMPONENTS are specified, then the find module will default to finding
only the HDF5 C library. If one or more COMPONENTS are specified, the
module will attempt to find the language bindings for the specified
components. The only valid components are C, CXX, Fortran, HL, and
Fortran_HL. If the COMPONENTS argument is not given, the module will
attempt to find only the C bindings.
.sp
On UNIX systems, this module will read the variable
HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
static link to a dynamic link for HDF5 and all of it\(aqs dependencies.
To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
variable is set before the call to find_package.
.sp
To provide the module with a hint about where to find your HDF5
installation, you can set the environment variable HDF5_ROOT. The
Find module will then look in this path when searching for HDF5
executables, paths, and libraries.
.sp
Both the serial and parallel HDF5 wrappers are considered and the first
directory to contain either one will be used. In the event that both appear
in the same directory the serial version is preferentially selected. This
behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to
true.
.sp
In addition to finding the includes and libraries required to compile
an HDF5 client application, this module also makes an effort to find
tools that come with the HDF5 distribution that may be useful for
regression testing.
.sp
This module will define the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HDF5_FOUND \- true if HDF5 was found on the system
HDF5_VERSION \- HDF5 version in format Major.Minor.Release
HDF5_INCLUDE_DIRS \- Location of the hdf5 includes
HDF5_INCLUDE_DIR \- Location of the hdf5 includes (deprecated)
HDF5_DEFINITIONS \- Required compiler definitions for HDF5
HDF5_LIBRARIES \- Required libraries for all requested bindings
HDF5_HL_LIBRARIES \- Required libraries for the HDF5 high level API for all
bindings, if the HL component is enabled
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Available components are: C CXX Fortran and HL. For each enabled language
binding, a corresponding HDF5_${LANG}_LIBRARIES variable will be defined.
If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will
also be defined. With all components enabled, the following variables will be defined:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HDF5_C_LIBRARIES \- Required libraries for the HDF5 C bindings
HDF5_CXX_LIBRARIES \- Required libraries for the HDF5 C++ bindings
HDF5_Fortran_LIBRARIES \- Required libraries for the HDF5 Fortran bindings
HDF5_C_HL_LIBRARIES \- Required libraries for the high level C bindings
HDF5_CXX_HL_LIBRARIES \- Required libraries for the high level C++ bindings
HDF5_Fortran_HL_LIBRARIES \- Required libraries for the high level Fortran
bindings.
HDF5_IS_PARALLEL \- Whether or not HDF5 was found with parallel IO support
HDF5_C_COMPILER_EXECUTABLE \- the path to the HDF5 C wrapper compiler
HDF5_CXX_COMPILER_EXECUTABLE \- the path to the HDF5 C++ wrapper compiler
HDF5_Fortran_COMPILER_EXECUTABLE \- the path to the HDF5 Fortran wrapper compiler
HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE \- path to the primary C compiler
which is also the HDF5 wrapper
HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE \- path to the primary C++
compiler which is also
the HDF5 wrapper
HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE \- path to the primary
Fortran compiler which
is also the HDF5 wrapper
HDF5_DIFF_EXECUTABLE \- the path to the HDF5 dataset comparison tool
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following variable can be set to guide the search for HDF5 libraries and includes:
.INDENT 0.0
.TP
.B \fBHDF5_ROOT\fP
Specify the path to the HDF5 installation to use.
.TP
.B \fBHDF5_NO_FIND_PACKAGE_CONFIG_FILE\fP
Set to a true value to skip trying to find \fBhdf5\-config.cmake\fP\&.
.UNINDENT
.SS FindHg
.sp
Extract information from a mercurial working copy.
.sp
The module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HG_EXECUTABLE \- path to mercurial command line client (hg)
HG_FOUND \- true if the command line client was found
HG_VERSION_STRING \- the version of mercurial found
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If the command line client executable is found the following macro is defined:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HG_WC_INFO(<dir> <var\-prefix>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Hg_WC_INFO extracts information of a mercurial working copy
at a given location. This macro defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<var\-prefix>_WC_CHANGESET \- current changeset
<var\-prefix>_WC_REVISION \- current revision
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Hg)
if(HG_FOUND)
message("hg found: ${HG_EXECUTABLE}")
HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
message("Current revision is ${Project_WC_REVISION}")
message("Current changeset is ${Project_WC_CHANGESET}")
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindHSPELL
.sp
Try to find Hspell
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HSPELL_FOUND \- system has Hspell
HSPELL_INCLUDE_DIR \- the Hspell include directory
HSPELL_LIBRARIES \- The libraries needed to use Hspell
HSPELL_DEFINITIONS \- Compiler switches required for using Hspell
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HSPELL_VERSION_STRING \- The version of Hspell found (x.y)
HSPELL_MAJOR_VERSION \- the major version of Hspell
HSPELL_MINOR_VERSION \- The minor version of Hspell
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindHTMLHelp
.sp
This module looks for Microsoft HTML Help Compiler
.sp
It defines:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HTML_HELP_COMPILER : full path to the Compiler (hhc.exe)
HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
HTML_HELP_LIBRARY : full path to the library (htmlhelp.lib)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindIce
.sp
Find the ZeroC Internet Communication Engine (ICE) programs,
libraries and datafiles.
.sp
This module supports multiple components.
Components can include any of: \fBFreeze\fP, \fBGlacier2\fP, \fBIce\fP,
\fBIceBox\fP, \fBIceDB\fP, \fBIceGrid\fP, \fBIcePatch\fP, \fBIceSSL\fP,
\fBIceStorm\fP, \fBIceUtil\fP, \fBIceXML\fP, or \fBSlice\fP\&.
.sp
This module reports information about the Ice installation in
several variables. General variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_VERSION \- Ice release version
Ice_FOUND \- true if the main programs and libraries were found
Ice_LIBRARIES \- component libraries to be linked
Ice_INCLUDE_DIRS \- the directories containing the Ice headers
Ice_SLICE_DIRS \- the directories containing the Ice slice interface
definitions
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Imported targets:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice::<C>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Where \fB<C>\fP is the name of an Ice component, for example
\fBIce::Glacier2\fP\&.
.sp
Ice slice programs are reported in:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_SLICE2CPP_EXECUTABLE \- path to slice2cpp executable
Ice_SLICE2CS_EXECUTABLE \- path to slice2cs executable
Ice_SLICE2FREEZEJ_EXECUTABLE \- path to slice2freezej executable
Ice_SLICE2FREEZE_EXECUTABLE \- path to slice2freeze executable
Ice_SLICE2HTML_EXECUTABLE \- path to slice2html executable
Ice_SLICE2JAVA_EXECUTABLE \- path to slice2java executable
Ice_SLICE2JS_EXECUTABLE \- path to slice2js executable
Ice_SLICE2PHP_EXECUTABLE \- path to slice2php executable
Ice_SLICE2PY_EXECUTABLE \- path to slice2py executable
Ice_SLICE2RB_EXECUTABLE \- path to slice2rb executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Ice programs are reported in:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_GLACIER2ROUTER_EXECUTABLE \- path to glacier2router executable
Ice_ICEBOX_EXECUTABLE \- path to icebox executable
Ice_ICEBOXADMIN_EXECUTABLE \- path to iceboxadmin executable
Ice_ICEBOXD_EXECUTABLE \- path to iceboxd executable
Ice_ICEBOXNET_EXECUTABLE \- path to iceboxnet executable
Ice_ICEGRIDADMIN_EXECUTABLE \- path to icegridadmin executable
Ice_ICEGRIDNODE_EXECUTABLE \- path to icegridnode executable
Ice_ICEGRIDNODED_EXECUTABLE \- path to icegridnoded executable
Ice_ICEGRIDREGISTRY_EXECUTABLE \- path to icegridregistry executable
Ice_ICEGRIDREGISTRYD_EXECUTABLE \- path to icegridregistryd executable
Ice_ICEPATCH2CALC_EXECUTABLE \- path to icepatch2calc executable
Ice_ICEPATCH2CLIENT_EXECUTABLE \- path to icepatch2client executable
Ice_ICEPATCH2SERVER_EXECUTABLE \- path to icepatch2server executable
Ice_ICESERVICEINSTALL_EXECUTABLE \- path to iceserviceinstall executable
Ice_ICESTORMADMIN_EXECUTABLE \- path to icestormadmin executable
Ice_ICESTORMMIGRATE_EXECUTABLE \- path to icestormmigrate executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Ice db programs (Windows only; standard system versions on all other
platforms) are reported in:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_DB_ARCHIVE_EXECUTABLE \- path to db_archive executable
Ice_DB_CHECKPOINT_EXECUTABLE \- path to db_checkpoint executable
Ice_DB_DEADLOCK_EXECUTABLE \- path to db_deadlock executable
Ice_DB_DUMP_EXECUTABLE \- path to db_dump executable
Ice_DB_HOTBACKUP_EXECUTABLE \- path to db_hotbackup executable
Ice_DB_LOAD_EXECUTABLE \- path to db_load executable
Ice_DB_LOG_VERIFY_EXECUTABLE \- path to db_log_verify executable
Ice_DB_PRINTLOG_EXECUTABLE \- path to db_printlog executable
Ice_DB_RECOVER_EXECUTABLE \- path to db_recover executable
Ice_DB_STAT_EXECUTABLE \- path to db_stat executable
Ice_DB_TUNER_EXECUTABLE \- path to db_tuner executable
Ice_DB_UPGRADE_EXECUTABLE \- path to db_upgrade executable
Ice_DB_VERIFY_EXECUTABLE \- path to db_verify executable
Ice_DUMPDB_EXECUTABLE \- path to dumpdb executable
Ice_TRANSFORMDB_EXECUTABLE \- path to transformdb executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Ice component libraries are reported in:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_<C>_FOUND \- ON if component was found
Ice_<C>_LIBRARIES \- libraries for component
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that \fB<C>\fP is the uppercased name of the component.
.sp
This module reads hints about search results from:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_HOME \- the root of the Ice installation
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The environment variable \fBICE_HOME\fP may also be used; the
Ice_HOME variable takes precedence.
.sp
The following cache variables may also be set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_<P>_EXECUTABLE \- the path to executable <P>
Ice_INCLUDE_DIR \- the directory containing the Ice headers
Ice_SLICE_DIR \- the directory containing the Ice slice interface
definitions
Ice_<C>_LIBRARY \- the library for component <C>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
In most cases none of the above variables will require setting,
unless multiple Ice versions are available and a specific version
is required. On Windows, the most recent version of Ice will be
found through the registry. On Unix, the programs, headers and
libraries will usually be in standard locations, but Ice_SLICE_DIRS
might not be automatically detected (commonly known locations are
searched). All the other variables are defaulted using Ice_HOME,
if set. It\(aqs possible to set Ice_HOME and selectively specify
alternative locations for the other components; this might be
required for e.g. newer versions of Visual Studio if the
heuristics are not sufficient to identify the correct programs and
libraries for the specific Visual Studio version.
.UNINDENT
.UNINDENT
.sp
Other variables one may set to control this module are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Ice_DEBUG \- Set to ON to enable debug output from FindIce.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindIcotool
.sp
Find icotool
.sp
This module looks for icotool. This module defines the following
values:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICOTOOL_EXECUTABLE: the full path to the icotool tool.
ICOTOOL_FOUND: True if icotool has been found.
ICOTOOL_VERSION_STRING: the version of icotool found.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindICU
.sp
Find the International Components for Unicode (ICU) libraries and
programs.
.sp
This module supports multiple components.
Components can include any of: \fBdata\fP, \fBi18n\fP, \fBio\fP, \fBle\fP,
\fBlx\fP, \fBtest\fP, \fBtu\fP and \fBuc\fP\&.
.sp
Note that on Windows \fBdata\fP is named \fBdt\fP and \fBi18n\fP is named
\fBin\fP; any of the names may be used, and the appropriate
platform\-specific library name will be automatically selected.
.sp
This module reports information about the ICU installation in
several variables. General variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICU_VERSION \- ICU release version
ICU_FOUND \- true if the main programs and libraries were found
ICU_LIBRARIES \- component libraries to be linked
ICU_INCLUDE_DIRS \- the directories containing the ICU headers
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Imported targets:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICU::<C>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Where \fB<C>\fP is the name of an ICU component, for example
\fBICU::i18n\fP\&.
.sp
ICU programs are reported in:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICU_GENCNVAL_EXECUTABLE \- path to gencnval executable
ICU_ICUINFO_EXECUTABLE \- path to icuinfo executable
ICU_GENBRK_EXECUTABLE \- path to genbrk executable
ICU_ICU\-CONFIG_EXECUTABLE \- path to icu\-config executable
ICU_GENRB_EXECUTABLE \- path to genrb executable
ICU_GENDICT_EXECUTABLE \- path to gendict executable
ICU_DERB_EXECUTABLE \- path to derb executable
ICU_PKGDATA_EXECUTABLE \- path to pkgdata executable
ICU_UCONV_EXECUTABLE \- path to uconv executable
ICU_GENCFU_EXECUTABLE \- path to gencfu executable
ICU_MAKECONV_EXECUTABLE \- path to makeconv executable
ICU_GENNORM2_EXECUTABLE \- path to gennorm2 executable
ICU_GENCCODE_EXECUTABLE \- path to genccode executable
ICU_GENSPREP_EXECUTABLE \- path to gensprep executable
ICU_ICUPKG_EXECUTABLE \- path to icupkg executable
ICU_GENCMN_EXECUTABLE \- path to gencmn executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
ICU component libraries are reported in:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICU_<C>_FOUND \- ON if component was found
ICU_<C>_LIBRARIES \- libraries for component
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that \fB<C>\fP is the uppercased name of the component.
.sp
This module reads hints about search results from:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICU_ROOT \- the root of the ICU installation
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The environment variable \fBICU_ROOT\fP may also be used; the
ICU_ROOT variable takes precedence.
.sp
The following cache variables may also be set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICU_<P>_EXECUTABLE \- the path to executable <P>
ICU_INCLUDE_DIR \- the directory containing the ICU headers
ICU_<C>_LIBRARY \- the library for component <C>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
In most cases none of the above variables will require setting,
unless multiple ICU versions are available and a specific version
is required.
.UNINDENT
.UNINDENT
.sp
Other variables one may set to control this module are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ICU_DEBUG \- Set to ON to enable debug output from FindICU.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindImageMagick
.sp
Find the ImageMagick binary suite.
.sp
This module will search for a set of ImageMagick tools specified as
components in the FIND_PACKAGE call. Typical components include, but
are not limited to (future versions of ImageMagick might have
additional components not listed here):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
animate
compare
composite
conjure
convert
display
identify
import
mogrify
montage
stream
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If no component is specified in the FIND_PACKAGE call, then it only
searches for the ImageMagick executable directory. This code defines
the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ImageMagick_FOUND \- TRUE if all components are found.
ImageMagick_EXECUTABLE_DIR \- Full path to executables directory.
ImageMagick_<component>_FOUND \- TRUE if <component> is found.
ImageMagick_<component>_EXECUTABLE \- Full path to <component> executable.
ImageMagick_VERSION_STRING \- the version of ImageMagick found
(since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
ImageMagick_VERSION_STRING will not work for old versions like 5.2.3.
.sp
There are also components for the following ImageMagick APIs:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Magick++
MagickWand
MagickCore
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For these components the following variables are set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ImageMagick_FOUND \- TRUE if all components are found.
ImageMagick_INCLUDE_DIRS \- Full paths to all include dirs.
ImageMagick_LIBRARIES \- Full paths to all libraries.
ImageMagick_<component>_FOUND \- TRUE if <component> is found.
ImageMagick_<component>_INCLUDE_DIRS \- Full path to <component> include dirs.
ImageMagick_<component>_LIBRARIES \- Full path to <component> libraries.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example Usages:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(ImageMagick)
find_package(ImageMagick COMPONENTS convert)
find_package(ImageMagick COMPONENTS convert mogrify display)
find_package(ImageMagick COMPONENTS Magick++)
find_package(ImageMagick COMPONENTS Magick++ convert)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that the standard FIND_PACKAGE features are supported (i.e.,
QUIET, REQUIRED, etc.).
.SS FindIntl
.sp
Find the Gettext libintl headers and libraries.
.sp
This module reports information about the Gettext libintl
installation in several variables. General variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Intl_FOUND \- true if the libintl headers and libraries were found
Intl_INCLUDE_DIRS \- the directory containing the libintl headers
Intl_LIBRARIES \- libintl libraries to be linked
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following cache variables may also be set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Intl_INCLUDE_DIR \- the directory containing the libintl headers
Intl_LIBRARY \- the libintl library (if any)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
On some platforms, such as Linux with GNU libc, the gettext
functions are present in the C standard library and libintl
is not required. \fBIntl_LIBRARIES\fP will be empty in this
case.
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
If you wish to use the Gettext tools (\fBmsgmerge\fP,
\fBmsgfmt\fP, etc.), use \fBFindGettext\fP\&.
.UNINDENT
.UNINDENT
.SS FindITK
.sp
This module no longer exists.
.sp
This module existed in versions of CMake prior to 3.1, but became
only a thin wrapper around \fBfind_package(ITK NO_MODULE)\fP to
provide compatibility for projects using long\-outdated conventions.
Now \fBfind_package(ITK)\fP will search for \fBITKConfig.cmake\fP
directly.
.SS FindJasper
.sp
Try to find the Jasper JPEG2000 library
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
JASPER_FOUND \- system has Jasper
JASPER_INCLUDE_DIR \- the Jasper include directory
JASPER_LIBRARIES \- the libraries needed to use Jasper
JASPER_VERSION_STRING \- the version of Jasper found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindJava
.sp
Find Java
.sp
This module finds if Java is installed and determines where the
include files and libraries are. The caller may set variable JAVA_HOME
to specify a Java installation prefix explicitly.
.sp
See also the \fBFindJNI\fP module to find Java development tools.
.sp
Specify one or more of the following components as you call this find module. See example below.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Runtime = User just want to execute some Java byte\-compiled
Development = Development tools (java, javac, javah and javadoc), includes Runtime component
IdlJ = idl compiler for Java
JarSigner = signer tool for jar
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This module sets the following result variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Java_JAVA_EXECUTABLE = the full path to the Java runtime
Java_JAVAC_EXECUTABLE = the full path to the Java compiler
Java_JAVAH_EXECUTABLE = the full path to the Java header generator
Java_JAVADOC_EXECUTABLE = the full path to the Java documentation generator
Java_IDLJ_EXECUTABLE = the full path to the Java idl compiler
Java_JAR_EXECUTABLE = the full path to the Java archiver
Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
Java_VERSION_STRING = Version of java found, eg. 1.6.0_12
Java_VERSION_MAJOR = The major version of the package found.
Java_VERSION_MINOR = The minor version of the package found.
Java_VERSION_PATCH = The patch version of the package found.
Java_VERSION_TWEAK = The tweak version of the package found (after \(aq_\(aq)
Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum required version of Java can be specified using the
standard CMake syntax, e.g. find_package(Java 1.5)
.sp
NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to
be identical. For example some java version may return:
Java_VERSION_STRING = 1.5.0_17 and Java_VERSION = 1.5.0.17
.sp
another example is the Java OEM, with: Java_VERSION_STRING = 1.6.0\-oem
and Java_VERSION = 1.6.0
.sp
For these components the following variables are set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Java_FOUND \- TRUE if all components are found.
Java_<component>_FOUND \- TRUE if <component> is found.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example Usages:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Java)
find_package(Java COMPONENTS Runtime)
find_package(Java COMPONENTS Development)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindJNI
.sp
Find JNI java libraries.
.sp
This module finds if Java is installed and determines where the
include files and libraries are. It also determines what the name of
the library is. The caller may set variable JAVA_HOME to specify a
Java installation prefix explicitly.
.sp
This module sets the following result variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
JNI_INCLUDE_DIRS = the include dirs to use
JNI_LIBRARIES = the libraries to use
JNI_FOUND = TRUE if JNI headers and libraries were found.
JAVA_AWT_LIBRARY = the path to the jawt library
JAVA_JVM_LIBRARY = the path to the jvm library
JAVA_INCLUDE_PATH = the include path to jni.h
JAVA_INCLUDE_PATH2 = the include path to jni_md.h
JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindJPEG
.sp
Find JPEG
.sp
Find the native JPEG includes and library This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
JPEG_LIBRARIES, the libraries needed to use JPEG.
JPEG_FOUND, If false, do not try to use JPEG.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
also defined, but not for general use are
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
JPEG_LIBRARY, where to find the JPEG library.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindKDE3
.sp
Find the KDE3 include and library dirs, KDE preprocessors and define a some macros
.sp
This module defines the following variables:
.INDENT 0.0
.TP
.B \fBKDE3_DEFINITIONS\fP
compiler definitions required for compiling KDE software
.TP
.B \fBKDE3_INCLUDE_DIR\fP
the KDE include directory
.TP
.B \fBKDE3_INCLUDE_DIRS\fP
the KDE and the Qt include directory, for use with include_directories()
.TP
.B \fBKDE3_LIB_DIR\fP
the directory where the KDE libraries are installed, for use with link_directories()
.TP
.B \fBQT_AND_KDECORE_LIBS\fP
this contains both the Qt and the kdecore library
.TP
.B \fBKDE3_DCOPIDL_EXECUTABLE\fP
the dcopidl executable
.TP
.B \fBKDE3_DCOPIDL2CPP_EXECUTABLE\fP
the dcopidl2cpp executable
.TP
.B \fBKDE3_KCFGC_EXECUTABLE\fP
the kconfig_compiler executable
.TP
.B \fBKDE3_FOUND\fP
set to TRUE if all of the above has been found
.UNINDENT
.sp
The following user adjustable options are provided:
.INDENT 0.0
.TP
.B \fBKDE3_BUILD_TESTS\fP
enable this to build KDE testcases
.UNINDENT
.sp
It also adds the following macros (from KDE3Macros.cmake) SRCS_VAR is
always the variable which contains the list of source files for your
application or library.
.sp
KDE3_AUTOMOC(file1 ... fileN)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Call this if you want to have automatic moc file handling.
This means if you include "foo.moc" in the source file foo.cpp
a moc file for the header foo.h will be created automatically.
You can set the property SKIP_AUTOMAKE using set_source_files_properties()
to exclude some files in the list from being processed.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
If you don\(aqt use the KDE3_AUTOMOC() macro, for the files
listed here moc files will be created (named "foo.moc.cpp")
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ... headerN.h )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Use this to generate DCOP skeletions from the listed headers.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ... headerN.h )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Use this to generate DCOP stubs from the listed headers.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ... fileN.ui )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Use this to add the Qt designer ui files to your application/library.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ... fileN.kcfgc )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Use this to add KDE kconfig compiler files to your application/library.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_INSTALL_LIBTOOL_FILE(target)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
This will create and install a simple libtool file for the given target.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_EXECUTABLE(name file1 ... fileN )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Currently identical to add_executable(), may provide some advanced
features in the future.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
If WITH_PREFIX is given, the resulting plugin will have the prefix "lib",
otherwise it won\(aqt.
It creates and installs an appropriate libtool la\-file.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ... fileN )
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Create a KDE application in the form of a module loadable via kdeinit.
A library named kdeinit_<name> will be created and a small executable
which links to it.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The option KDE3_ENABLE_FINAL to enable all\-in\-one compilation is no
longer supported.
.sp
Author: Alexander Neundorf <\fI\%neundorf@kde.org\fP>
.SS FindKDE4
.sp
Find KDE4 and provide all necessary variables and macros to compile
software for it. It looks for KDE 4 in the following directories in
the given order:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_INSTALL_PREFIX
KDEDIRS
/opt/kde4
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for more
information. They are installed with the KDE 4 libraries in
$KDEDIRS/share/apps/cmake/modules/.
.sp
Author: Alexander Neundorf <\fI\%neundorf@kde.org\fP>
.SS FindLAPACK
.sp
Find LAPACK library
.sp
This module finds an installed fortran library that implements the
LAPACK linear\-algebra interface (see \fI\%http://www.netlib.org/lapack/\fP).
.sp
The approach follows that taken for the autoconf macro file,
acx_lapack.m4 (distributed at
\fI\%http://ac\-archive.sourceforge.net/ac\-archive/acx_lapack.html\fP).
.sp
This module sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LAPACK_FOUND \- set to true if a library implementing the LAPACK interface
is found
LAPACK_LINKER_FLAGS \- uncached list of required linker flags (excluding \-l
and \-L).
LAPACK_LIBRARIES \- uncached list of libraries (using full path name) to
link against to use LAPACK
LAPACK95_LIBRARIES \- uncached list of libraries (using full path name) to
link against to use LAPACK95
LAPACK95_FOUND \- set to true if a library implementing the LAPACK f95
interface is found
BLA_STATIC if set on this determines what kind of linkage we do (static)
BLA_VENDOR if set checks only the specified vendor, if not set checks
all the possibilities
BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
List of vendors (BLA_VENDOR) valid in this module:
.INDENT 0.0
.IP \(bu 2
Intel(mkl)
.IP \(bu 2
OpenBLAS
.IP \(bu 2
ACML
.IP \(bu 2
Apple
.IP \(bu 2
NAS
.IP \(bu 2
Generic
.UNINDENT
.SS FindLATEX
.sp
Find Latex
.sp
This module finds an installed Latex and determines the location
of the compiler. Additionally the module looks for Latex\-related
software like BibTeX.
.sp
This module sets the following result variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LATEX_FOUND: whether found Latex and requested components
LATEX_<component>_FOUND: whether found <component>
LATEX_COMPILER: path to the LaTeX compiler
PDFLATEX_COMPILER: path to the PdfLaTeX compiler
XELATEX_COMPILER: path to the XeLaTeX compiler
LUALATEX_COMPILER: path to the LuaLaTeX compiler
BIBTEX_COMPILER: path to the BibTeX compiler
BIBER_COMPILER: path to the Biber compiler
MAKEINDEX_COMPILER: path to the MakeIndex compiler
XINDY_COMPILER: path to the xindy compiler
DVIPS_CONVERTER: path to the DVIPS converter
DVIPDF_CONVERTER: path to the DVIPDF converter
PS2PDF_CONVERTER: path to the PS2PDF converter
PDFTOPS_CONVERTER: path to the pdftops converter
LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
HTLATEX_COMPILER: path to the htlatex compiler
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Possible components are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PDFLATEX
XELATEX
LUALATEX
BIBTEX
BIBER
MAKEINDEX
XINDY
DVIPS
DVIPDF
PS2PDF
PDFTOPS
LATEX2HTML
HTLATEX
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example Usages:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(LATEX)
find_package(LATEX COMPONENTS PDFLATEX)
find_package(LATEX COMPONENTS BIBTEX PS2PDF)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindLibArchive
.sp
Find libarchive library and headers
.sp
The module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LibArchive_FOUND \- true if libarchive was found
LibArchive_INCLUDE_DIRS \- include search path
LibArchive_LIBRARIES \- libraries to link
LibArchive_VERSION \- libarchive 3\-component version number
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindLibLZMA
.sp
Find LibLZMA
.sp
Find LibLZMA headers and library
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LIBLZMA_FOUND \- True if liblzma is found.
LIBLZMA_INCLUDE_DIRS \- Directory where liblzma headers are located.
LIBLZMA_LIBRARIES \- Lzma libraries to link against.
LIBLZMA_HAS_AUTO_DECODER \- True if lzma_auto_decoder() is found (required).
LIBLZMA_HAS_EASY_ENCODER \- True if lzma_easy_encoder() is found (required).
LIBLZMA_HAS_LZMA_PRESET \- True if lzma_lzma_preset() is found (required).
LIBLZMA_VERSION_MAJOR \- The major version of lzma
LIBLZMA_VERSION_MINOR \- The minor version of lzma
LIBLZMA_VERSION_PATCH \- The patch version of lzma
LIBLZMA_VERSION_STRING \- version number as a string (ex: "5.0.3")
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindLibXml2
.sp
Try to find the LibXml2 xml processing library
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LIBXML2_FOUND \- System has LibXml2
LIBXML2_INCLUDE_DIR \- The LibXml2 include directory
LIBXML2_LIBRARIES \- The libraries needed to use LibXml2
LIBXML2_DEFINITIONS \- Compiler switches required for using LibXml2
LIBXML2_XMLLINT_EXECUTABLE \- The XML checking tool xmllint coming with LibXml2
LIBXML2_VERSION_STRING \- the version of LibXml2 found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindLibXslt
.sp
Try to find the LibXslt library
.sp
Once done this will define
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LIBXSLT_FOUND \- system has LibXslt
LIBXSLT_INCLUDE_DIR \- the LibXslt include directory
LIBXSLT_LIBRARIES \- Link these to LibXslt
LIBXSLT_DEFINITIONS \- Compiler switches required for using LibXslt
LIBXSLT_VERSION_STRING \- version of LibXslt found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Additionally, the following two variables are set (but not required
for using xslt):
.INDENT 0.0
.TP
.B \fBLIBXSLT_EXSLT_LIBRARIES\fP
Link to these if you need to link against the exslt library.
.TP
.B \fBLIBXSLT_XSLTPROC_EXECUTABLE\fP
Contains the full path to the xsltproc executable if found.
.UNINDENT
.SS FindLTTngUST
.sp
This module finds the \fI\%LTTng\-UST\fP library.
.SS Imported target
.sp
This module defines the following \fBIMPORTED\fP target:
.INDENT 0.0
.TP
.B \fBLTTng::UST\fP
The LTTng\-UST library, if found
.UNINDENT
.SS Result variables
.sp
This module sets the following
.INDENT 0.0
.TP
.B \fBLTTNGUST_FOUND\fP
\fBTRUE\fP if system has LTTng\-UST
.TP
.B \fBLTTNGUST_INCLUDE_DIRS\fP
The LTTng\-UST include directories
.TP
.B \fBLTTNGUST_LIBRARIES\fP
The libraries needed to use LTTng\-UST
.TP
.B \fBLTTNGUST_VERSION_STRING\fP
The LTTng\-UST version
.TP
.B \fBLTTNGUST_HAS_TRACEF\fP
\fBTRUE\fP if the \fBtracef()\fP API is available in the system\(aqs LTTng\-UST
.TP
.B \fBLTTNGUST_HAS_TRACELOG\fP
\fBTRUE\fP if the \fBtracelog()\fP API is available in the system\(aqs LTTng\-UST
.UNINDENT
.SS FindLua50
.sp
Locate Lua library This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LUA50_FOUND, if false, do not try to link to Lua
LUA_LIBRARIES, both lua and lualib
LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that the expected include convention is
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include "lua.h"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
and not
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include <lua/lua.h>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This is because, the lua location is not standardized and may exist in
locations other than lua/
.SS FindLua51
.sp
Locate Lua library This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LUA51_FOUND, if false, do not try to link to Lua
LUA_LIBRARIES
LUA_INCLUDE_DIR, where to find lua.h
LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that the expected include convention is
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include "lua.h"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
and not
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include <lua/lua.h>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This is because, the lua location is not standardized and may exist in
locations other than lua/
.SS FindLua
.sp
Locate Lua library This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LUA_FOUND \- if false, do not try to link to Lua
LUA_LIBRARIES \- both lua and lualib
LUA_INCLUDE_DIR \- where to find lua.h
LUA_VERSION_STRING \- the version of Lua found
LUA_VERSION_MAJOR \- the major version of Lua
LUA_VERSION_MINOR \- the minor version of Lua
LUA_VERSION_PATCH \- the patch version of Lua
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that the expected include convention is
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include "lua.h"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
and not
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include <lua/lua.h>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This is because, the lua location is not standardized and may exist in
locations other than lua/
.SS FindMatlab
.sp
Finds Matlab installations and provides Matlab tools and libraries to cmake.
.sp
This package first intention is to find the libraries associated with Matlab
in order to be able to build Matlab extensions (mex files). It can also be
used:
.INDENT 0.0
.IP \(bu 2
run specific commands in Matlab
.IP \(bu 2
declare Matlab unit test
.IP \(bu 2
retrieve various information from Matlab (mex extensions, versions and
release queries, ...)
.UNINDENT
.sp
The module supports the following components:
.INDENT 0.0
.IP \(bu 2
\fBMX_LIBRARY\fP, \fBENG_LIBRARY\fP and \fBMAT_LIBRARY\fP: respectively the MX,
ENG and MAT libraries of Matlab
.IP \(bu 2
\fBMAIN_PROGRAM\fP the Matlab binary program.
.IP \(bu 2
\fBMEX_COMPILER\fP the MEX compiler.
.IP \(bu 2
\fBSIMULINK\fP the Simulink environment.
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
The version given to the \fBfind_package()\fP directive is the Matlab
\fBversion\fP, which should not be confused with the Matlab \fIrelease\fP name
(eg. \fIR2014\fP).
The \fI\%matlab_get_version_from_release_name()\fP and
\fI\%matlab_get_release_name_from_version()\fP allow a mapping
from the release name to the version.
.UNINDENT
.UNINDENT
.sp
The variable \fI\%Matlab_ROOT_DIR\fP may be specified in order to give
the path of the desired Matlab version. Otherwise, the behaviour is platform
specific:
.INDENT 0.0
.IP \(bu 2
Windows: The installed versions of Matlab are retrieved from the
Windows registry
.IP \(bu 2
OS X: The installed versions of Matlab are given by the MATLAB
paths in \fB/Application\fP\&. If no such application is found, it falls back
to the one that might be accessible from the PATH.
.IP \(bu 2
Unix: The desired Matlab should be accessible from the PATH.
.UNINDENT
.sp
Additional information is provided when \fI\%MATLAB_FIND_DEBUG\fP is set.
When a Matlab binary is found automatically and the \fBMATLAB_VERSION\fP
is not given, the version is queried from Matlab directly.
On Windows, it can make a window running Matlab appear.
.sp
The mapping of the release names and the version of Matlab is performed by
defining pairs (name, version). The variable
\fI\%MATLAB_ADDITIONAL_VERSIONS\fP may be provided before the call to
the \fBfind_package()\fP in order to handle additional versions.
.sp
A Matlab scripts can be added to the set of tests using the
\fI\%matlab_add_unit_test()\fP\&. By default, the Matlab unit test framework
will be used (>= 2013a) to run this script, but regular \fB\&.m\fP files
returning an exit code can be used as well (0 indicating a success).
.SS Module Input Variables
.sp
Users or projects may set the following variables to configure the module
behaviour:
.INDENT 0.0
.TP
.B \fI\%Matlab_ROOT_DIR\fP
the root of the Matlab installation.
.TP
.B \fI\%MATLAB_FIND_DEBUG\fP
outputs debug information
.TP
.B \fI\%MATLAB_ADDITIONAL_VERSIONS\fP
additional versions of Matlab for the automatic retrieval of the installed
versions.
.UNINDENT
.SS Variables defined by the module
.SS Result variables
.INDENT 0.0
.TP
.B \fBMatlab_FOUND\fP
\fBTRUE\fP if the Matlab installation is found, \fBFALSE\fP
otherwise. All variable below are defined if Matlab is found.
.TP
.B \fBMatlab_ROOT_DIR\fP
the final root of the Matlab installation determined by the FindMatlab
module.
.TP
.B \fBMatlab_MAIN_PROGRAM\fP
the Matlab binary program. Available only if the component \fBMAIN_PROGRAM\fP
is given in the \fBfind_package()\fP directive.
.TP
.B \fBMatlab_INCLUDE_DIRS\fP
the path of the Matlab libraries headers
.TP
.B \fBMatlab_MEX_LIBRARY\fP
library for mex, always available.
.TP
.B \fBMatlab_MX_LIBRARY\fP
mx library of Matlab (arrays). Available only if the component
\fBMX_LIBRARY\fP has been requested.
.TP
.B \fBMatlab_ENG_LIBRARY\fP
Matlab engine library. Available only if the component \fBENG_LIBRARY\fP
is requested.
.TP
.B \fBMatlab_MAT_LIBRARY\fP
Matlab matrix library. Available only if the component \fBMAT_LIBRARY\fP
is requested.
.TP
.B \fBMatlab_LIBRARIES\fP
the whole set of libraries of Matlab
.TP
.B \fBMatlab_MEX_COMPILER\fP
the mex compiler of Matlab. Currently not used.
Available only if the component \fBMEX_COMPILER\fP is asked
.UNINDENT
.SS Cached variables
.INDENT 0.0
.TP
.B \fBMatlab_MEX_EXTENSION\fP
the extension of the mex files for the current platform (given by Matlab).
.TP
.B \fBMatlab_ROOT_DIR\fP
the location of the root of the Matlab installation found. If this value
is changed by the user, the result variables are recomputed.
.UNINDENT
.SS Provided macros
.INDENT 0.0
.TP
.B \fI\%matlab_get_version_from_release_name()\fP
returns the version from the release name
.TP
.B \fI\%matlab_get_release_name_from_version()\fP
returns the release name from the Matlab version
.UNINDENT
.SS Provided functions
.INDENT 0.0
.TP
.B \fI\%matlab_add_mex()\fP
adds a target compiling a MEX file.
.TP
.B \fI\%matlab_add_unit_test()\fP
adds a Matlab unit test file as a test to the project.
.TP
.B \fI\%matlab_extract_all_installed_versions_from_registry()\fP
parses the registry for all Matlab versions. Available on Windows only.
The part of the registry parsed is dependent on the host processor
.TP
.B \fI\%matlab_get_all_valid_matlab_roots_from_registry()\fP
returns all the possible Matlab paths, according to a previously
given list. Only the existing/accessible paths are kept. This is mainly
useful for the searching all possible Matlab installation.
.TP
.B \fI\%matlab_get_mex_suffix()\fP
returns the suffix to be used for the mex files
(platform/architecture dependent)
.TP
.B \fI\%matlab_get_version_from_matlab_run()\fP
returns the version of Matlab, given the full directory of the Matlab
program.
.UNINDENT
.SS Known issues
.INDENT 0.0
.TP
\fBSymbol clash in a MEX target\fP
By default, every symbols inside a MEX
file defined with the command \fI\%matlab_add_mex()\fP have hidden
visibility, except for the entry point. This is the default behaviour of
the MEX compiler, which lowers the risk of symbol collision between the
libraries shipped with Matlab, and the libraries to which the MEX file is
linking to. This is also the default on Windows platforms.
.sp
However, this is not sufficient in certain case, where for instance your
MEX file is linking against libraries that are already loaded by Matlab,
even if those libraries have different SONAMES.
A possible solution is to hide the symbols of the libraries to which the
MEX target is linking to. This can be achieved in GNU GCC compilers with
the linker option \fB\-Wl,\-\-exclude\-libs,ALL\fP\&.
.TP
\fBTests using GPU resources\fP
in case your MEX file is using the GPU and
in order to be able to run unit tests on this MEX file, the GPU resources
should be properly released by Matlab. A possible solution is to make
Matlab aware of the use of the GPU resources in the session, which can be
performed by a command such as \fBD = gpuDevice()\fP at the beginning of
the test script (or via a fixture).
.UNINDENT
.SS Reference
.INDENT 0.0
.TP
.B Matlab_ROOT_DIR
The root folder of the Matlab installation. If set before the call to
\fBfind_package()\fP, the module will look for the components in that
path. If not set, then an automatic search of Matlab
will be performed. If set, it should point to a valid version of Matlab.
.UNINDENT
.INDENT 0.0
.TP
.B MATLAB_FIND_DEBUG
If set, the lookup of Matlab and the intermediate configuration steps are
outputted to the console.
.UNINDENT
.INDENT 0.0
.TP
.B MATLAB_ADDITIONAL_VERSIONS
If set, specifies additional versions of Matlab that may be looked for.
The variable should be a list of strings, organised by pairs of release
name and versions, such as follows:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(MATLAB_ADDITIONAL_VERSIONS
"release_name1=corresponding_version1"
"release_name2=corresponding_version2"
...
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
set(MATLAB_ADDITIONAL_VERSIONS
"R2013b=8.2"
"R2013a=8.1"
"R2012b=8.0")
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The order of entries in this list matters when several versions of
Matlab are installed. The priority is set according to the ordering in
this list.
.UNINDENT
.INDENT 0.0
.TP
.B matlab_get_version_from_release_name
Returns the version of Matlab (17.58) from a release name (R2017k)
.UNINDENT
.INDENT 0.0
.TP
.B matlab_get_release_name_from_version
Returns the release name (R2017k) from the version of Matlab (17.58)
.UNINDENT
.INDENT 0.0
.TP
.B matlab_extract_all_installed_versions_from_registry
This function parses the registry and founds the Matlab versions that are
installed. The found versions are returned in \fImatlab_versions\fP\&.
Set \fIwin64\fP to \fITRUE\fP if the 64 bit version of Matlab should be looked for
The returned list contains all versions under
\fBHKLM\e\eSOFTWARE\e\eMathworks\e\eMATLAB\fP or an empty list in case an error
occurred (or nothing found).
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Only the versions are provided. No check is made over the existence of the
installation referenced in the registry,
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B matlab_get_all_valid_matlab_roots_from_registry
Populates the Matlab root with valid versions of Matlab.
The returned matlab_roots is organized in pairs
\fB(version_number,matlab_root_path)\fP\&.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
matlab_get_all_valid_matlab_roots_from_registry(
matlab_versions
matlab_roots)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBmatlab_versions\fP
the versions of each of the Matlab installations
.TP
.B \fBmatlab_roots\fP
the location of each of the Matlab installations
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B matlab_get_mex_suffix
Returns the extension of the mex files (the suffixes).
This function should not be called before the appropriate Matlab root has
been found.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
matlab_get_mex_suffix(
matlab_root
mex_suffix)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBmatlab_root\fP
the root of the Matlab installation
.TP
.B \fBmex_suffix\fP
the variable name in which the suffix will be returned.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B matlab_get_version_from_matlab_run
This function runs Matlab program specified on arguments and extracts its
version.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
matlab_get_version_from_matlab_run(
matlab_binary_path
matlab_list_versions)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBmatlab_binary_path\fP
the location of the \fImatlab\fP binary executable
.TP
.B \fBmatlab_list_versions\fP
the version extracted from Matlab
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B matlab_add_unit_test
Adds a Matlab unit test to the test set of cmake/ctest.
This command requires the component \fBMAIN_PROGRAM\fP\&.
The unit test uses the Matlab unittest framework (default, available
starting Matlab 2013b+) except if the option \fBNO_UNITTEST_FRAMEWORK\fP
is given.
.sp
The function expects one Matlab test script file to be given.
In the case \fBNO_UNITTEST_FRAMEWORK\fP is given, the unittest script file
should contain the script to be run, plus an exit command with the exit
value. This exit value will be passed to the ctest framework (0 success,
non 0 failure). Additional arguments accepted by \fBadd_test()\fP can be
passed through \fBTEST_ARGS\fP (eg. \fBCONFIGURATION <config> ...\fP).
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
matlab_add_unit_test(
NAME <name>
UNITTEST_FILE matlab_file_containing_unittest.m
[CUSTOM_MATLAB_COMMAND matlab_command_to_run_as_test]
[UNITTEST_PRECOMMAND matlab_command_to_run]
[TIMEOUT timeout]
[ADDITIONAL_PATH path1 [path2 ...]]
[MATLAB_ADDITIONAL_STARTUP_OPTIONS option1 [option2 ...]]
[TEST_ARGS arg1 [arg2 ...]]
[NO_UNITTEST_FRAMEWORK]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The function arguments are:
.INDENT 7.0
.TP
.B \fBNAME\fP
name of the unittest in ctest.
.TP
.B \fBUNITTEST_FILE\fP
the matlab unittest file. Its path will be automatically
added to the Matlab path.
.TP
.B \fBCUSTOM_MATLAB_COMMAND\fP
Matlab script command to run as the test.
If this is not set, then the following is run:
\fBruntests(\(aqmatlab_file_name\(aq), exit(max([ans(1,:).Failed]))\fP
where \fBmatlab_file_name\fP is the \fBUNITTEST_FILE\fP without the extension.
.TP
.B \fBUNITTEST_PRECOMMAND\fP
Matlab script command to be ran before the file
containing the test (eg. GPU device initialisation based on CMake
variables).
.TP
.B \fBTIMEOUT\fP
the test timeout in seconds. Defaults to 180 seconds as the
Matlab unit test may hang.
.TP
.B \fBADDITIONAL_PATH\fP
a list of paths to add to the Matlab path prior to
running the unit test.
.TP
.B \fBMATLAB_ADDITIONAL_STARTUP_OPTIONS\fP
a list of additional option in order
to run Matlab from the command line.
\fB\-nosplash \-nodesktop \-nodisplay\fP are always added.
.TP
.B \fBTEST_ARGS\fP
Additional options provided to the add_test command. These
options are added to the default options (eg. "CONFIGURATIONS Release")
.TP
.B \fBNO_UNITTEST_FRAMEWORK\fP
when set, indicates that the test should not
use the unittest framework of Matlab (available for versions >= R2013a).
.TP
.B \fBWORKING_DIRECTORY\fP
This will be the working directory for the test. If specified it will
also be the output directory used for the log file of the test run.
If not specifed the temporary directory \fB${CMAKE_BINARY_DIR}/Matlab\fP will
be used as the working directory and the log location.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B matlab_add_mex
Adds a Matlab MEX target.
This commands compiles the given sources with the current tool\-chain in
order to produce a MEX file. The final name of the produced output may be
specified, as well as additional link libraries, and a documentation entry
for the MEX file. Remaining arguments of the call are passed to the
\fBadd_library()\fP or \fBadd_executable()\fP command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
matlab_add_mex(
NAME <name>
[EXECUTABLE | MODULE | SHARED]
SRC src1 [src2 ...]
[OUTPUT_NAME output_name]
[DOCUMENTATION file.txt]
[LINK_TO target1 target2 ...]
[...]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBNAME\fP
name of the target.
.TP
.B \fBSRC\fP
list of source files.
.TP
.B \fBLINK_TO\fP
a list of additional link dependencies. The target links to \fBlibmex\fP
by default. If \fBMatlab_MX_LIBRARY\fP is defined, it also
links to \fBlibmx\fP\&.
.TP
.B \fBOUTPUT_NAME\fP
if given, overrides the default name. The default name is
the name of the target without any prefix and
with \fBMatlab_MEX_EXTENSION\fP suffix.
.TP
.B \fBDOCUMENTATION\fP
if given, the file \fBfile.txt\fP will be considered as
being the documentation file for the MEX file. This file is copied into
the same folder without any processing, with the same name as the final
mex file, and with extension \fI\&.m\fP\&. In that case, typing \fBhelp <name>\fP
in Matlab prints the documentation contained in this file.
.TP
.B \fBMODULE\fP or \fBSHARED\fP may be given to specify the type of library to be
created. \fBEXECUTABLE\fP may be given to create an executable instead of
a library. If no type is given explicitly, the type is \fBSHARED\fP\&.
.UNINDENT
.sp
The documentation file is not processed and should be in the following
format:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
% This is the documentation
function ret = mex_target_output_name(input1)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS FindMFC
.sp
Find MFC on Windows
.sp
Find the native MFC \- i.e. decide if an application can link to the
MFC libraries.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MFC_FOUND \- Was MFC support found
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You don\(aqt need to include anything or link anything to use it.
.SS FindMotif
.sp
Try to find Motif (or lesstif)
.sp
Once done this will define:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MOTIF_FOUND \- system has MOTIF
MOTIF_INCLUDE_DIR \- include paths to use Motif
MOTIF_LIBRARIES \- Link these to use Motif
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindMPEG2
.sp
Find the native MPEG2 includes and library
.sp
This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
MPEG2_LIBRARIES, the libraries required to use MPEG2.
MPEG2_FOUND, If false, do not try to use MPEG2.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
also defined, but not for general use are
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
MPEG2_vo_LIBRARY, where to find the vo library.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindMPEG
.sp
Find the native MPEG includes and library
.sp
This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
MPEG_LIBRARIES, the libraries required to use MPEG.
MPEG_FOUND, If false, do not try to use MPEG.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
also defined, but not for general use are
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MPEG_mpeg2_LIBRARY, where to find the MPEG library.
MPEG_vo_LIBRARY, where to find the vo library.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindMPI
.sp
Find a Message Passing Interface (MPI) implementation
.sp
The Message Passing Interface (MPI) is a library used to write
high\-performance distributed\-memory parallel applications, and is
typically deployed on a cluster. MPI is a standard interface (defined
by the MPI forum) for which many implementations are available. All
of them have somewhat different include paths, libraries to link
against, etc., and this module tries to smooth out those differences.
.SS Variables
.sp
This module will set the following variables per language in your
project, where <lang> is one of C, CXX, or Fortran:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang>
MPI_<lang>_COMPILER MPI Compiler wrapper for <lang>
MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs
MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header
MPI_<lang>_LINK_FLAGS Linking flags for MPI programs
MPI_<lang>_LIBRARIES All libraries to link MPI programs against
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Additionally, FindMPI sets the following variables for running MPI
programs from the command line:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MPIEXEC Executable for running MPI programs
MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving
it the number of processors to run on
MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly
before the executable to run.
MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Usage
.sp
To use this module, simply call FindMPI from a CMakeLists.txt file, or
run \fBfind_package(MPI)\fP, then run CMake. If you are happy with the
auto\-detected configuration for your language, then you\(aqre done. If
not, you have two options:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
1. Set MPI_<lang>_COMPILER to the MPI wrapper (mpicc, etc.) of your
choice and reconfigure. FindMPI will attempt to determine all the
necessary variables using THAT compiler\(aqs compile and link flags.
2. If this fails, or if your MPI implementation does not come with
a compiler wrapper, then set both MPI_<lang>_LIBRARIES and
MPI_<lang>_INCLUDE_PATH. You may also set any other variables
listed above, but these two are required. This will circumvent
autodetection entirely.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
When configuration is successful, \fBMPI_<lang>_COMPILER\fP will be set to
the compiler wrapper for <lang>, if it was found. \fBMPI_<lang>_FOUND\fP
and other variables above will be set if any MPI implementation was
found for <lang>, regardless of whether a compiler was found.
.sp
When using \fBMPIEXEC\fP to execute MPI applications, you should typically
use all of the \fBMPIEXEC\fP flags as follows:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
where \fBPROCS\fP is the number of processors on which to execute the
program, \fBEXECUTABLE\fP is the MPI program, and \fBARGS\fP are the arguments to
pass to the MPI program.
.SS Backward Compatibility
.sp
For backward compatibility with older versions of FindMPI, these
variables are set, but deprecated:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MPI_FOUND MPI_COMPILER MPI_LIBRARY
MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY
MPI_LINK_FLAGS MPI_LIBRARIES
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In new projects, please use the \fBMPI_<lang>_XXX\fP equivalents.
.SS FindOpenAL
.sp
Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
the headers
.sp
$OPENALDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OPENALDIR used in building OpenAL.
.sp
Created by Eric Wing. This was influenced by the FindSDL.cmake
module.
.SS FindOpenCL
.sp
Try to find OpenCL
.SS IMPORTED Targets
.sp
This module defines \fBIMPORTED\fP target \fBOpenCL::OpenCL\fP, if
OpenCL has been found.
.SS Result Variables
.sp
This module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OpenCL_FOUND \- True if OpenCL was found
OpenCL_INCLUDE_DIRS \- include directories for OpenCL
OpenCL_LIBRARIES \- link against this library to use OpenCL
OpenCL_VERSION_STRING \- Highest supported OpenCL version (eg. 1.2)
OpenCL_VERSION_MAJOR \- The major version of the OpenCL implementation
OpenCL_VERSION_MINOR \- The minor version of the OpenCL implementation
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The module will also define two cache variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OpenCL_INCLUDE_DIR \- the OpenCL include directory
OpenCL_LIBRARY \- the path to the OpenCL library
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindOpenGL
.sp
FindModule for OpenGL and GLU.
.SS IMPORTED Targets
.sp
This module defines the \fBIMPORTED\fP targets:
.INDENT 0.0
.TP
.B \fBOpenGL::GL\fP
Defined if the system has OpenGL.
.TP
.B \fBOpenGL::GLU\fP
Defined if the system has GLU.
.UNINDENT
.SS Result Variables
.sp
This module sets the following variables:
.INDENT 0.0
.TP
.B \fBOPENGL_FOUND\fP
True, if the system has OpenGL.
.TP
.B \fBOPENGL_XMESA_FOUND\fP
True, if the system has XMESA.
.TP
.B \fBOPENGL_GLU_FOUND\fP
True, if the system has GLU.
.TP
.B \fBOPENGL_INCLUDE_DIR\fP
Path to the OpenGL include directory.
.TP
.B \fBOPENGL_LIBRARIES\fP
Paths to the OpenGL and GLU libraries.
.UNINDENT
.sp
If you want to use just GL you can use these values:
.INDENT 0.0
.TP
.B \fBOPENGL_gl_LIBRARY\fP
Path to the OpenGL library.
.TP
.B \fBOPENGL_glu_LIBRARY\fP
Path to the GLU library.
.UNINDENT
.SS OSX Specific
.sp
On OSX default to using the framework version of OpenGL. People will
have to change the cache values of OPENGL_glu_LIBRARY and
OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
.SS FindOpenMP
.sp
Finds OpenMP support
.sp
This module can be used to detect OpenMP support in a compiler. If
the compiler supports OpenMP, the flags required to compile with
OpenMP support are returned in variables for the different languages.
The variables may be empty if the compiler does not need a special
flag to support OpenMP.
.sp
The following variables are set:
.INDENT 0.0
.TP
.B \fBOpenMP_C_FLAGS\fP
Flags to add to the C compiler for OpenMP support.
.TP
.B \fBOpenMP_CXX_FLAGS\fP
Flags to add to the CXX compiler for OpenMP support.
.TP
.B \fBOpenMP_Fortran_FLAGS\fP
Flags to add to the Fortran compiler for OpenMP support.
.TP
.B \fBOPENMP_FOUND\fP
True if openmp is detected.
.UNINDENT
.sp
The following internal variables are set, if detected:
.INDENT 0.0
.TP
.B \fBOpenMP_C_SPEC_DATE\fP
Specification date of OpenMP version of C compiler.
.TP
.B \fBOpenMP_CXX_SPEC_DATE\fP
Specification date of OpenMP version of CXX compiler.
.TP
.B \fBOpenMP_Fortran_SPEC_DATE\fP
Specification date of OpenMP version of Fortran compiler.
.UNINDENT
.sp
The specification dates are formatted as integers of the form
\fBCCYYMM\fP where these represent the decimal digits of the century,
year, and month.
.SS FindOpenSceneGraph
.sp
Find OpenSceneGraph
.sp
This module searches for the OpenSceneGraph core "osg" library as well
as OpenThreads, and whatever additional COMPONENTS (nodekits) that you
specify.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
See http://www.openscenegraph.org
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
NOTE: To use this module effectively you must either require CMake >=
2.6.3 with cmake_minimum_required(VERSION 2.6.3) or download and place
FindOpenThreads.cmake, Findosg_functions.cmake, Findosg.cmake, and
Find<etc>.cmake files into your CMAKE_MODULE_PATH.
.sp
.ce
----
.ce 0
.sp
.sp
This module accepts the following variables (note mixed case)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OpenSceneGraph_DEBUG \- Enable debugging output
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OpenSceneGraph_MARK_AS_ADVANCED \- Mark cache variables as advanced
automatically
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following environment variables are also respected for finding the
OSG and it\(aqs various components. CMAKE_PREFIX_PATH can also be used
for this (see find_library() CMake documentation).
.INDENT 0.0
.TP
.B \fB<MODULE>_DIR\fP
(where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file)
.TP
.B \fBOSG_DIR\fP
.TP
.B \fBOSGDIR\fP
.TP
.B \fBOSG_ROOT\fP
.UNINDENT
.sp
[CMake 2.8.10]: The CMake variable OSG_DIR can now be used as well to
influence detection, instead of needing to specify an environment
variable.
.sp
This module defines the following output variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OPENSCENEGRAPH_FOUND \- Was the OSG and all of the specified components found?
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OPENSCENEGRAPH_VERSION \- The version of the OSG which was found
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OPENSCENEGRAPH_INCLUDE_DIRS \- Where to find the headers
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
OPENSCENEGRAPH_LIBRARIES \- The OSG libraries
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
================================== Example Usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgUtil)
# libOpenThreads & libosg automatically searched
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_executable(foo foo.cc)
target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindOpenSSL
.sp
Find the OpenSSL encryption library.
.SS Imported Targets
.sp
This module defines the following \fBIMPORTED\fP targets:
.INDENT 0.0
.TP
.B \fBOpenSSL::SSL\fP
The OpenSSL \fBssl\fP library, if found.
.TP
.B \fBOpenSSL::Crypto\fP
The OpenSSL \fBcrypto\fP library, if found.
.UNINDENT
.SS Result Variables
.sp
This module will set the following variables in your project:
.INDENT 0.0
.TP
.B \fBOPENSSL_FOUND\fP
System has the OpenSSL library.
.TP
.B \fBOPENSSL_INCLUDE_DIR\fP
The OpenSSL include directory.
.TP
.B \fBOPENSSL_CRYPTO_LIBRARY\fP
The OpenSSL crypto library.
.TP
.B \fBOPENSSL_SSL_LIBRARY\fP
The OpenSSL SSL library.
.TP
.B \fBOPENSSL_LIBRARIES\fP
All OpenSSL libraries.
.TP
.B \fBOPENSSL_VERSION\fP
This is set to \fB$major.$minor.$revision$patch\fP (e.g. \fB0.9.8s\fP).
.UNINDENT
.SS Hints
.sp
Set \fBOPENSSL_ROOT_DIR\fP to the root directory of an OpenSSL installation.
Set \fBOPENSSL_USE_STATIC_LIBS\fP to \fBTRUE\fP to look for static libraries.
Set \fBOPENSSL_MSVC_STATIC_RT\fP set \fBTRUE\fP to choose the MT version of the lib.
.SS FindOpenThreads
.sp
OpenThreads is a C++ based threading library. Its largest userbase
seems to OpenSceneGraph so you might notice I accept OSGDIR as an
environment path. I consider this part of the Findosg* suite used to
find OpenSceneGraph components. Each component is separate and you
must opt in to each module.
.sp
Locate OpenThreads This module defines OPENTHREADS_LIBRARY
OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
OPENTHREADS_INCLUDE_DIR, where to find the headers
.sp
$OPENTHREADS_DIR is an environment variable that would correspond to
the ./configure \-\-prefix=$OPENTHREADS_DIR used in building osg.
.sp
[CMake 2.8.10]: The CMake variables OPENTHREADS_DIR or OSG_DIR can now
be used as well to influence detection, instead of needing to specify
an environment variable.
.sp
Created by Eric Wing.
.SS FindosgAnimation
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgAnimation This module defines
.sp
OSGANIMATION_FOUND \- Was osgAnimation found? OSGANIMATION_INCLUDE_DIR
\- Where to find the headers OSGANIMATION_LIBRARIES \- The libraries to
link against for the OSG (use this)
.sp
OSGANIMATION_LIBRARY \- The OSG library OSGANIMATION_LIBRARY_DEBUG \-
The OSG debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgDB
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgDB This module defines
.sp
OSGDB_FOUND \- Was osgDB found? OSGDB_INCLUDE_DIR \- Where to find the
headers OSGDB_LIBRARIES \- The libraries to link against for the osgDB
(use this)
.sp
OSGDB_LIBRARY \- The osgDB library OSGDB_LIBRARY_DEBUG \- The osgDB
debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS Findosg_functions
.sp
This CMake file contains two macros to assist with searching for OSG
libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
documentation.
.SS FindosgFX
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgFX This module defines
.sp
OSGFX_FOUND \- Was osgFX found? OSGFX_INCLUDE_DIR \- Where to find the
headers OSGFX_LIBRARIES \- The libraries to link against for the osgFX
(use this)
.sp
OSGFX_LIBRARY \- The osgFX library OSGFX_LIBRARY_DEBUG \- The osgFX
debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgGA
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgGA This module defines
.sp
OSGGA_FOUND \- Was osgGA found? OSGGA_INCLUDE_DIR \- Where to find the
headers OSGGA_LIBRARIES \- The libraries to link against for the osgGA
(use this)
.sp
OSGGA_LIBRARY \- The osgGA library OSGGA_LIBRARY_DEBUG \- The osgGA
debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgIntrospection
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgINTROSPECTION This module defines
.sp
OSGINTROSPECTION_FOUND \- Was osgIntrospection found?
OSGINTROSPECTION_INCLUDE_DIR \- Where to find the headers
OSGINTROSPECTION_LIBRARIES \- The libraries to link for
osgIntrospection (use this)
.sp
OSGINTROSPECTION_LIBRARY \- The osgIntrospection library
OSGINTROSPECTION_LIBRARY_DEBUG \- The osgIntrospection debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgManipulator
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgManipulator This module defines
.sp
OSGMANIPULATOR_FOUND \- Was osgManipulator found?
OSGMANIPULATOR_INCLUDE_DIR \- Where to find the headers
OSGMANIPULATOR_LIBRARIES \- The libraries to link for osgManipulator
(use this)
.sp
OSGMANIPULATOR_LIBRARY \- The osgManipulator library
OSGMANIPULATOR_LIBRARY_DEBUG \- The osgManipulator debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgParticle
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgParticle This module defines
.sp
OSGPARTICLE_FOUND \- Was osgParticle found? OSGPARTICLE_INCLUDE_DIR \-
Where to find the headers OSGPARTICLE_LIBRARIES \- The libraries to
link for osgParticle (use this)
.sp
OSGPARTICLE_LIBRARY \- The osgParticle library
OSGPARTICLE_LIBRARY_DEBUG \- The osgParticle debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgPresentation
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgPresentation This module defines
.sp
OSGPRESENTATION_FOUND \- Was osgPresentation found?
OSGPRESENTATION_INCLUDE_DIR \- Where to find the headers
OSGPRESENTATION_LIBRARIES \- The libraries to link for osgPresentation
(use this)
.sp
OSGPRESENTATION_LIBRARY \- The osgPresentation library
OSGPRESENTATION_LIBRARY_DEBUG \- The osgPresentation debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing. Modified to work with osgPresentation by Robert
Osfield, January 2012.
.SS FindosgProducer
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgProducer This module defines
.sp
OSGPRODUCER_FOUND \- Was osgProducer found? OSGPRODUCER_INCLUDE_DIR \-
Where to find the headers OSGPRODUCER_LIBRARIES \- The libraries to
link for osgProducer (use this)
.sp
OSGPRODUCER_LIBRARY \- The osgProducer library
OSGPRODUCER_LIBRARY_DEBUG \- The osgProducer debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgQt
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgQt This module defines
.sp
OSGQT_FOUND \- Was osgQt found? OSGQT_INCLUDE_DIR \- Where to find the
headers OSGQT_LIBRARIES \- The libraries to link for osgQt (use this)
.sp
OSGQT_LIBRARY \- The osgQt library OSGQT_LIBRARY_DEBUG \- The osgQt
debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing. Modified to work with osgQt by Robert Osfield,
January 2012.
.SS Findosg
.sp
NOTE: It is highly recommended that you use the new
FindOpenSceneGraph.cmake introduced in CMake 2.6.3 and not use this
Find module directly.
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osg This module defines
.sp
OSG_FOUND \- Was the Osg found? OSG_INCLUDE_DIR \- Where to find the
headers OSG_LIBRARIES \- The libraries to link against for the OSG (use
this)
.sp
OSG_LIBRARY \- The OSG library OSG_LIBRARY_DEBUG \- The OSG debug
library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgShadow
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgShadow This module defines
.sp
OSGSHADOW_FOUND \- Was osgShadow found? OSGSHADOW_INCLUDE_DIR \- Where
to find the headers OSGSHADOW_LIBRARIES \- The libraries to link for
osgShadow (use this)
.sp
OSGSHADOW_LIBRARY \- The osgShadow library OSGSHADOW_LIBRARY_DEBUG \-
The osgShadow debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgSim
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgSim This module defines
.sp
OSGSIM_FOUND \- Was osgSim found? OSGSIM_INCLUDE_DIR \- Where to find
the headers OSGSIM_LIBRARIES \- The libraries to link for osgSim (use
this)
.sp
OSGSIM_LIBRARY \- The osgSim library OSGSIM_LIBRARY_DEBUG \- The osgSim
debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgTerrain
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgTerrain This module defines
.sp
OSGTERRAIN_FOUND \- Was osgTerrain found? OSGTERRAIN_INCLUDE_DIR \-
Where to find the headers OSGTERRAIN_LIBRARIES \- The libraries to link
for osgTerrain (use this)
.sp
OSGTERRAIN_LIBRARY \- The osgTerrain library OSGTERRAIN_LIBRARY_DEBUG \-
The osgTerrain debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgText
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgText This module defines
.sp
OSGTEXT_FOUND \- Was osgText found? OSGTEXT_INCLUDE_DIR \- Where to find
the headers OSGTEXT_LIBRARIES \- The libraries to link for osgText (use
this)
.sp
OSGTEXT_LIBRARY \- The osgText library OSGTEXT_LIBRARY_DEBUG \- The
osgText debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgUtil
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgUtil This module defines
.sp
OSGUTIL_FOUND \- Was osgUtil found? OSGUTIL_INCLUDE_DIR \- Where to find
the headers OSGUTIL_LIBRARIES \- The libraries to link for osgUtil (use
this)
.sp
OSGUTIL_LIBRARY \- The osgUtil library OSGUTIL_LIBRARY_DEBUG \- The
osgUtil debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgViewer
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgViewer This module defines
.sp
OSGVIEWER_FOUND \- Was osgViewer found? OSGVIEWER_INCLUDE_DIR \- Where
to find the headers OSGVIEWER_LIBRARIES \- The libraries to link for
osgViewer (use this)
.sp
OSGVIEWER_LIBRARY \- The osgViewer library OSGVIEWER_LIBRARY_DEBUG \-
The osgViewer debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgVolume
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgVolume This module defines
.sp
OSGVOLUME_FOUND \- Was osgVolume found? OSGVOLUME_INCLUDE_DIR \- Where
to find the headers OSGVOLUME_LIBRARIES \- The libraries to link for
osgVolume (use this)
.sp
OSGVOLUME_LIBRARY \- The osgVolume library OSGVOLUME_LIBRARY_DEBUG \-
The osgVolume debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
Created by Eric Wing.
.SS FindosgWidget
.sp
This is part of the Findosg* suite used to find OpenSceneGraph
components. Each component is separate and you must opt in to each
module. You must also opt into OpenGL and OpenThreads (and Producer
if needed) as these modules won\(aqt do it for you. This is to allow you
control over your own system piece by piece in case you need to opt
out of certain components or change the Find behavior for a particular
module (perhaps because the default FindOpenGL.cmake module doesn\(aqt
work with your system as an example). If you want to use a more
convenient module that includes everything, use the
FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
.sp
Locate osgWidget This module defines
.sp
OSGWIDGET_FOUND \- Was osgWidget found? OSGWIDGET_INCLUDE_DIR \- Where
to find the headers OSGWIDGET_LIBRARIES \- The libraries to link for
osgWidget (use this)
.sp
OSGWIDGET_LIBRARY \- The osgWidget library OSGWIDGET_LIBRARY_DEBUG \-
The osgWidget debug library
.sp
$OSGDIR is an environment variable that would correspond to the
./configure \-\-prefix=$OSGDIR used in building osg.
.sp
FindosgWidget.cmake tweaked from Findosg* suite as created by Eric
Wing.
.SS FindPackageHandleStandardArgs
.sp
This module provides a function intended to be used in Find Modules
implementing \fBfind_package(<PackageName>)\fP calls. It handles the
\fBREQUIRED\fP, \fBQUIET\fP and version\-related arguments of \fBfind_package\fP\&.
It also sets the \fB<PackageName>_FOUND\fP variable. The package is
considered found if all variables listed contain valid results, e.g.
valid filepaths.
.INDENT 0.0
.TP
.B find_package_handle_standard_args
There are two signatures:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
find_package_handle_standard_args(<PackageName>
(DEFAULT_MSG|<custom\-failure\-message>)
<required\-var>...
)
find_package_handle_standard_args(<PackageName>
[FOUND_VAR <result\-var>]
[REQUIRED_VARS <required\-var>...]
[VERSION_VAR <version\-var>]
[HANDLE_COMPONENTS]
[CONFIG_MODE]
[FAIL_MESSAGE <custom\-failure\-message>]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fB<PackageName>_FOUND\fP variable will be set to \fBTRUE\fP if all
the variables \fB<required\-var>...\fP are valid and any optional
constraints are satisfied, and \fBFALSE\fP otherwise. A success or
failure message may be displayed based on the results and on
whether the \fBREQUIRED\fP and/or \fBQUIET\fP option was given to
the \fBfind_package()\fP call.
.sp
The options are:
.INDENT 7.0
.TP
.B \fB(DEFAULT_MSG|<custom\-failure\-message>)\fP
In the simple signature this specifies the failure message.
Use \fBDEFAULT_MSG\fP to ask for a default message to be computed
(recommended). Not valid in the full signature.
.TP
.B \fBFOUND_VAR <result\-var>\fP
Obsolete. Specifies either \fB<PackageName>_FOUND\fP or
\fB<PACKAGENAME>_FOUND\fP as the result variable. This exists only
for compatibility with older versions of CMake and is now ignored.
Result variables of both names are always set for compatibility.
.TP
.B \fBREQUIRED_VARS <required\-var>...\fP
Specify the variables which are required for this package.
These may be named in the generated failure message asking the
user to set the missing variable values. Therefore these should
typically be cache entries such as \fBFOO_LIBRARY\fP and not output
variables like \fBFOO_LIBRARIES\fP\&.
.TP
.B \fBVERSION_VAR <version\-var>\fP
Specify the name of a variable that holds the version of the package
that has been found. This version will be checked against the
(potentially) specified required version given to the
\fBfind_package()\fP call, including its \fBEXACT\fP option.
The default messages include information about the required
version and the version which has been actually found, both
if the version is ok or not.
.TP
.B \fBHANDLE_COMPONENTS\fP
Enable handling of package components. In this case, the command
will report which components have been found and which are missing,
and the \fB<PackageName>_FOUND\fP variable will be set to \fBFALSE\fP
if any of the required components (i.e. not the ones listed after
the \fBOPTIONAL_COMPONENTS\fP option of \fBfind_package()\fP) are
missing.
.TP
.B \fBCONFIG_MODE\fP
Specify that the calling find module is a wrapper around a
call to \fBfind_package(<PackageName> NO_MODULE)\fP\&. This implies
a \fBVERSION_VAR\fP value of \fB<PackageName>_VERSION\fP\&. The command
will automatically check whether the package configuration file
was found.
.TP
.B \fBFAIL_MESSAGE <custom\-failure\-message>\fP
Specify a custom failure message instead of using the default
generated message. Not recommended.
.UNINDENT
.UNINDENT
.sp
Example for the simple signature:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package_handle_standard_args(LibXml2 DEFAULT_MSG
LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBLibXml2\fP package is considered to be found if both
\fBLIBXML2_LIBRARY\fP and \fBLIBXML2_INCLUDE_DIR\fP are valid.
Then also \fBLibXml2_FOUND\fP is set to \fBTRUE\fP\&. If it is not found
and \fBREQUIRED\fP was used, it fails with a
\fBmessage(FATAL_ERROR)\fP, independent whether \fBQUIET\fP was
used or not. If it is found, success will be reported, including
the content of the first \fB<required\-var>\fP\&. On repeated CMake runs,
the same message will not be printed again.
.sp
Example for the full signature:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package_handle_standard_args(LibArchive
REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
VERSION_VAR LibArchive_VERSION)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In this case, the \fBLibArchive\fP package is considered to be found if
both \fBLibArchive_LIBRARY\fP and \fBLibArchive_INCLUDE_DIR\fP are valid.
Also the version of \fBLibArchive\fP will be checked by using the version
contained in \fBLibArchive_VERSION\fP\&. Since no \fBFAIL_MESSAGE\fP is given,
the default messages will be printed.
.sp
Another example for the full signature:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
find_package_handle_standard_args(Automoc4 CONFIG_MODE)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In this case, a \fBFindAutmoc4.cmake\fP module wraps a call to
\fBfind_package(Automoc4 NO_MODULE)\fP and adds an additional search
directory for \fBautomoc4\fP\&. Then the call to
\fBfind_package_handle_standard_args\fP produces a proper success/failure
message.
.SS FindPackageMessage
.sp
FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
.sp
This macro is intended to be used in FindXXX.cmake modules files. It
will print a message once for each unique find result. This is useful
for telling the user where a package was found. The first argument
specifies the name (XXX) of the package. The second argument
specifies the message to display. The third argument lists details
about the find result so that if they change the message will be
displayed again. The macro also obeys the QUIET argument to the
find_package command.
.sp
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
if(X11_FOUND)
FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
"[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
else()
...
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindPerlLibs
.sp
Find Perl libraries
.sp
This module finds if PERL is installed and determines where the
include files and libraries are. It also determines what the name of
the library is. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PERLLIBS_FOUND = True if perl.h & libperl were found
PERL_INCLUDE_PATH = path to where perl.h is found
PERL_LIBRARY = path to libperl
PERL_EXECUTABLE = full path to the perl binary
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum required version of Perl can be specified using the
standard syntax, e.g. find_package(PerlLibs 6.0)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
The following variables are also available if needed
(introduced after CMake 2.6.4)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PERL_SITESEARCH = path to the sitesearch install dir
PERL_SITELIB = path to the sitelib install directory
PERL_VENDORARCH = path to the vendor arch install directory
PERL_VENDORLIB = path to the vendor lib install directory
PERL_ARCHLIB = path to the arch lib install directory
PERL_PRIVLIB = path to the priv lib install directory
PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindPerl
.sp
Find perl
.sp
this module looks for Perl
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PERL_EXECUTABLE \- the full path to perl
PERL_FOUND \- If false, don\(aqt attempt to use perl.
PERL_VERSION_STRING \- version of perl found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindPHP4
.sp
Find PHP4
.sp
This module finds if PHP4 is installed and determines where the
include files and libraries are. It also determines what the name of
the library is. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PHP4_INCLUDE_PATH = path to where php.h can be found
PHP4_EXECUTABLE = full path to the php4 binary
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindPhysFS
.sp
Locate PhysFS library This module defines PHYSFS_LIBRARY, the name of
the library to link against PHYSFS_FOUND, if false, do not try to link
to PHYSFS PHYSFS_INCLUDE_DIR, where to find physfs.h
.sp
$PHYSFSDIR is an environment variable that would correspond to the
./configure \-\-prefix=$PHYSFSDIR used in building PHYSFS.
.sp
Created by Eric Wing.
.SS FindPike
.sp
Find Pike
.sp
This module finds if PIKE is installed and determines where the
include files and libraries are. It also determines what the name of
the library is. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PIKE_INCLUDE_PATH = path to where program.h is found
PIKE_EXECUTABLE = full path to the pike binary
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindPkgConfig
.sp
A \fIpkg\-config\fP module for CMake.
.sp
Finds the \fBpkg\-config\fP executable and add the
\fI\%pkg_check_modules()\fP and \fI\%pkg_search_module()\fP
commands.
.sp
In order to find the \fBpkg\-config\fP executable, it uses the
\fI\%PKG_CONFIG_EXECUTABLE\fP variable or the \fBPKG_CONFIG\fP
environment variable first.
.INDENT 0.0
.TP
.B pkg_get_variable
Retrieves the value of a variable from a package:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_get_variable(<RESULT> <MODULE> <VARIABLE>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_get_variable(GI_GIRDIR gobject\-introspection\-1.0 girdir)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B pkg_check_modules
Checks for all the given modules.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
[IMPORTED_TARGET]
<MODULE> [<MODULE>]*)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
When the \fBREQUIRED\fP argument was set, macros will fail with an error
when module(s) could not be found.
.sp
When the \fBQUIET\fP argument is set, no status messages will be printed.
.sp
By default, if \fBCMAKE_MINIMUM_REQUIRED_VERSION\fP is 3.1 or
later, or if \fI\%PKG_CONFIG_USE_CMAKE_PREFIX_PATH\fP is set, the
\fBCMAKE_PREFIX_PATH\fP, \fBCMAKE_FRAMEWORK_PATH\fP, and
\fBCMAKE_APPBUNDLE_PATH\fP cache and environment variables will
be added to \fBpkg\-config\fP search path.
The \fBNO_CMAKE_PATH\fP and \fBNO_CMAKE_ENVIRONMENT_PATH\fP arguments
disable this behavior for the cache variables and the environment
variables, respectively.
The \fBIMPORTED_TARGET\fP argument will create an imported target named
PkgConfig::<PREFIX>> that can be passed directly as an argument to
\fBtarget_link_libraries()\fP\&.
.sp
It sets the following variables:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
PKG_CONFIG_FOUND ... if pkg\-config executable was found
PKG_CONFIG_EXECUTABLE ... pathname of the pkg\-config program
PKG_CONFIG_VERSION_STRING ... the version of the pkg\-config program found
(since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For the following variables two sets of values exist; first one is the
common one and has the given PREFIX. The second set contains flags
which are given out when \fBpkg\-config\fP was called with the \fB\-\-static\fP
option.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<XPREFIX>_FOUND ... set to 1 if module(s) exist
<XPREFIX>_LIBRARIES ... only the libraries (w/o the \(aq\-l\(aq)
<XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the \(aq\-L\(aq)
<XPREFIX>_LDFLAGS ... all required linker flags
<XPREFIX>_LDFLAGS_OTHER ... all other linker flags
<XPREFIX>_INCLUDE_DIRS ... the \(aq\-I\(aq preprocessor flags (w/o the \(aq\-I\(aq)
<XPREFIX>_CFLAGS ... all required cflags
<XPREFIX>_CFLAGS_OTHER ... the other compiler flags
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<XPREFIX> = <PREFIX> for common case
<XPREFIX> = <PREFIX>_STATIC for static linking
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
There are some special variables whose prefix depends on the count of
given modules. When there is only one module, <PREFIX> stays
unchanged. When there are multiple modules, the prefix will be
changed to <PREFIX>_<MODNAME>:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<XPREFIX>_VERSION ... version of the module
<XPREFIX>_PREFIX ... prefix\-directory of the module
<XPREFIX>_INCLUDEDIR ... include\-dir of the module
<XPREFIX>_LIBDIR ... lib\-dir of the module
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<XPREFIX> = <PREFIX> when |MODULES| == 1, else
<XPREFIX> = <PREFIX>_<MODNAME>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
A <MODULE> parameter can have the following formats:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
{MODNAME} ... matches any version
{MODNAME}>={VERSION} ... at least version <VERSION> is required
{MODNAME}={VERSION} ... exactly version <VERSION> is required
{MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Examples
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_check_modules (GLIB2 glib\-2.0)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_check_modules (GLIB2 glib\-2.0>=2.10)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Requires at least version 2.10 of glib2 and defines e.g.
\fBGLIB2_VERSION=2.10.3\fP
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_check_modules (FOO glib\-2.0>=2.10 gtk+\-2.0)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Requires both glib2 and gtk2, and defines e.g.
\fBFOO_glib\-2.0_VERSION=2.10.3\fP and \fBFOO_gtk+\-2.0_VERSION=2.8.20\fP
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_check_modules (XRENDER REQUIRED xrender)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Defines for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
XRENDER_LIBRARIES=Xrender;X11\(ga\(ga
XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B pkg_search_module
Same as \fI\%pkg_check_modules()\fP, but instead it checks for given
modules and uses the first working one.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
[IMPORTED_TARGET]
<MODULE> [<MODULE>]*)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Examples
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
pkg_search_module (BAR libxml\-2.0 libxml2 libxml>=2)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B PKG_CONFIG_EXECUTABLE
Path to the pkg\-config executable.
.UNINDENT
.INDENT 0.0
.TP
.B PKG_CONFIG_USE_CMAKE_PREFIX_PATH
Whether \fI\%pkg_check_modules()\fP and \fI\%pkg_search_module()\fP
should add the paths in \fBCMAKE_PREFIX_PATH\fP,
\fBCMAKE_FRAMEWORK_PATH\fP, and \fBCMAKE_APPBUNDLE_PATH\fP
cache and environment variables to \fBpkg\-config\fP search path.
.sp
If this variable is not set, this behavior is enabled by default if
\fBCMAKE_MINIMUM_REQUIRED_VERSION\fP is 3.1 or later, disabled
otherwise.
.UNINDENT
.SS FindPNG
.sp
Find libpng, the official reference library for the PNG image format.
.SS Imported targets
.sp
This module defines the following \fBIMPORTED\fP target:
.INDENT 0.0
.TP
.B \fBPNG::PNG\fP
The libpng library, if found.
.UNINDENT
.SS Result variables
.sp
This module will set the following variables in your project:
.INDENT 0.0
.TP
.B \fBPNG_INCLUDE_DIRS\fP
where to find png.h, etc.
.TP
.B \fBPNG_LIBRARIES\fP
the libraries to link against to use PNG.
.TP
.B \fBPNG_DEFINITIONS\fP
You should add_definitions(${PNG_DEFINITIONS}) before compiling code
that includes png library files.
.TP
.B \fBPNG_FOUND\fP
If false, do not try to use PNG.
.TP
.B \fBPNG_VERSION_STRING\fP
the version of the PNG library found (since CMake 2.8.8)
.UNINDENT
.SS Obsolete variables
.sp
The following variables may also be set, for backwards compatibility:
.INDENT 0.0
.TP
.B \fBPNG_LIBRARY\fP
where to find the PNG library.
.TP
.B \fBPNG_INCLUDE_DIR\fP
where to find the PNG headers (same as PNG_INCLUDE_DIRS)
.UNINDENT
.sp
Since PNG depends on the ZLib compression library, none of the above
will be defined unless ZLib can be found.
.SS FindPostgreSQL
.sp
Find the PostgreSQL installation.
.sp
This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PostgreSQL_LIBRARIES \- the PostgreSQL libraries needed for linking
PostgreSQL_INCLUDE_DIRS \- the directories of the PostgreSQL headers
PostgreSQL_LIBRARY_DIRS \- the link directories for PostgreSQL libraries
PostgreSQL_VERSION_STRING \- the version of PostgreSQL found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindProducer
.sp
Though Producer isn\(aqt directly part of OpenSceneGraph, its primary
user is OSG so I consider this part of the Findosg* suite used to find
OpenSceneGraph components. You\(aqll notice that I accept OSGDIR as an
environment path.
.sp
Each component is separate and you must opt in to each module. You
must also opt into OpenGL (and OpenThreads?) as these modules won\(aqt do
it for you. This is to allow you control over your own system piece
by piece in case you need to opt out of certain components or change
the Find behavior for a particular module (perhaps because the default
FindOpenGL.cmake module doesn\(aqt work with your system as an example).
If you want to use a more convenient module that includes everything,
use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake
modules.
.sp
Locate Producer This module defines PRODUCER_LIBRARY PRODUCER_FOUND,
if false, do not try to link to Producer PRODUCER_INCLUDE_DIR, where
to find the headers
.sp
$PRODUCER_DIR is an environment variable that would correspond to the
./configure \-\-prefix=$PRODUCER_DIR used in building osg.
.sp
Created by Eric Wing.
.SS FindProtobuf
.sp
Locate and configure the Google Protocol Buffers library.
.sp
The following variables can be set and are optional:
.INDENT 0.0
.TP
.B \fBProtobuf_SRC_ROOT_FOLDER\fP
When compiling with MSVC, if this cache variable is set
the protobuf\-default VS project build locations
(vsprojects/Debug and vsprojects/Release
or vsprojects/x64/Debug and vsprojects/x64/Release)
will be searched for libraries and binaries.
.TP
.B \fBProtobuf_IMPORT_DIRS\fP
List of additional directories to be searched for
imported .proto files.
.TP
.B \fBProtobuf_DEBUG\fP
Show debug messages.
.UNINDENT
.sp
Defines the following variables:
.INDENT 0.0
.TP
.B \fBProtobuf_FOUND\fP
Found the Google Protocol Buffers library
(libprotobuf & header files)
.TP
.B \fBProtobuf_VERSION\fP
Version of package found.
.TP
.B \fBProtobuf_INCLUDE_DIRS\fP
Include directories for Google Protocol Buffers
.TP
.B \fBProtobuf_LIBRARIES\fP
The protobuf libraries
.TP
.B \fBProtobuf_PROTOC_LIBRARIES\fP
The protoc libraries
.TP
.B \fBProtobuf_LITE_LIBRARIES\fP
The protobuf\-lite libraries
.UNINDENT
.sp
The following cache variables are also available to set or use:
.INDENT 0.0
.TP
.B \fBProtobuf_LIBRARY\fP
The protobuf library
.TP
.B \fBProtobuf_PROTOC_LIBRARY\fP
The protoc library
.TP
.B \fBProtobuf_INCLUDE_DIR\fP
The include directory for protocol buffers
.TP
.B \fBProtobuf_PROTOC_EXECUTABLE\fP
The protoc compiler
.TP
.B \fBProtobuf_LIBRARY_DEBUG\fP
The protobuf library (debug)
.TP
.B \fBProtobuf_PROTOC_LIBRARY_DEBUG\fP
The protoc library (debug)
.TP
.B \fBProtobuf_LITE_LIBRARY\fP
The protobuf lite library
.TP
.B \fBProtobuf_LITE_LIBRARY_DEBUG\fP
The protobuf lite library (debug)
.UNINDENT
.sp
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto)
protobuf_generate_python(PROTO_PY foo.proto)
add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
target_link_libraries(bar ${Protobuf_LIBRARIES})
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
The \fBprotobuf_generate_cpp\fP and \fBprotobuf_generate_python\fP
functions and \fBadd_executable()\fP or \fBadd_library()\fP
calls only work properly within the same directory.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B protobuf_generate_cpp
Add custom commands to process \fB\&.proto\fP files to C++:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
protobuf_generate_cpp (<SRCS> <HDRS> [<ARGN>...])
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBSRCS\fP
Variable to define with autogenerated source files
.TP
.B \fBHDRS\fP
Variable to define with autogenerated header files
.TP
.B \fBARGN\fP
\fB\&.proto\fP files
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B protobuf_generate_python
Add custom commands to process \fB\&.proto\fP files to Python:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
protobuf_generate_python (<PY> [<ARGN>...])
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 7.0
.TP
.B \fBPY\fP
Variable to define with autogenerated Python files
.TP
.B \fBARGN\fP
\fB\&.proto\fP filess
.UNINDENT
.UNINDENT
.SS FindPythonInterp
.sp
Find python interpreter
.sp
This module finds if Python interpreter is installed and determines
where the executables are. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PYTHONINTERP_FOUND \- Was the Python executable found
PYTHON_EXECUTABLE \- path to the Python interpreter
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PYTHON_VERSION_STRING \- Python version found e.g. 2.5.2
PYTHON_VERSION_MAJOR \- Python major version found e.g. 2
PYTHON_VERSION_MINOR \- Python minor version found e.g. 5
PYTHON_VERSION_PATCH \- Python patch version found e.g. 2
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
of version numbers that should be taken into account when searching
for Python. You need to set this variable before calling
find_package(PythonInterp).
.sp
If calling both \fBfind_package(PythonInterp)\fP and
\fBfind_package(PythonLibs)\fP, call \fBfind_package(PythonInterp)\fP first to
get the currently active Python version by default with a consistent version
of PYTHON_LIBRARIES.
.SS FindPythonLibs
.sp
Find python libraries
.sp
This module finds if Python is installed and determines where the
include files and libraries are. It also determines what the name of
the library is. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PYTHONLIBS_FOUND \- have the Python libs been found
PYTHON_LIBRARIES \- path to the python library
PYTHON_INCLUDE_PATH \- path to where Python.h is found (deprecated)
PYTHON_INCLUDE_DIRS \- path to where Python.h is found
PYTHON_DEBUG_LIBRARIES \- path to the debug library (deprecated)
PYTHONLIBS_VERSION_STRING \- version of the Python libs found (since CMake 2.8.8)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
of version numbers that should be taken into account when searching
for Python. You need to set this variable before calling
find_package(PythonLibs).
.sp
If you\(aqd like to specify the installation of Python to use, you should
modify the following cache variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
PYTHON_LIBRARY \- path to the python library
PYTHON_INCLUDE_DIR \- path to where Python.h is found
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If calling both \fBfind_package(PythonInterp)\fP and
\fBfind_package(PythonLibs)\fP, call \fBfind_package(PythonInterp)\fP first to
get the currently active Python version by default with a consistent version
of PYTHON_LIBRARIES.
.SS FindQt3
.sp
Locate Qt include paths and libraries
.sp
This module defines:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
QT_INCLUDE_DIR \- where to find qt.h, etc.
QT_LIBRARIES \- the libraries to link against to use Qt.
QT_DEFINITIONS \- definitions to use when
compiling code that uses Qt.
QT_FOUND \- If false, don\(aqt try to use Qt.
QT_VERSION_STRING \- the version of Qt found
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If you need the multithreaded version of Qt, set QT_MT_REQUIRED to
TRUE
.sp
Also defined, but not for general use are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
QT_MOC_EXECUTABLE, where to find the moc tool.
QT_UIC_EXECUTABLE, where to find the uic tool.
QT_QT_LIBRARY, where to find the Qt library.
QT_QTMAIN_LIBRARY, where to find the qtmain
library. This is only required by Qt3 on Windows.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindQt4
.SS Finding and Using Qt4
.sp
This module can be used to find Qt4. The most important issue is that
the Qt4 qmake is available via the system path. This qmake is then
used to detect basically everything else. This module defines a
number of \fBIMPORTED\fP targets, macros and variables.
.sp
Typical usage could be something like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
add_executable(myexe main.cpp)
target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
When using \fBIMPORTED\fP targets, the qtmain.lib static library is
automatically linked on Windows for \fBWIN32\fP
executables. To disable that globally, set the
\fBQT4_NO_LINK_QTMAIN\fP variable before finding Qt4. To disable that
for a particular executable, set the \fBQT4_NO_LINK_QTMAIN\fP target
property to \fBTRUE\fP on the executable.
.UNINDENT
.UNINDENT
.SS Qt Build Tools
.sp
Qt relies on some bundled tools for code generation, such as \fBmoc\fP for
meta\-object code generation,\(ga\(gauic\(ga\(ga for widget layout and population,
and \fBrcc\fP for virtual filesystem content generation. These tools may be
automatically invoked by \fBcmake(1)\fP if the appropriate conditions
are met. See \fBcmake\-qt(7)\fP for more.
.SS Qt Macros
.sp
In some cases it can be necessary or useful to invoke the Qt build tools in a
more\-manual way. Several macros are available to add targets for such uses.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_WRAP_CPP(outfiles inputfile ... [TARGET tgt] OPTIONS ...)
create moc code from a list of files containing Qt class with
the Q_OBJECT declaration. Per\-directory preprocessor definitions
are also added. If the <tgt> is specified, the
INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
the <tgt> are passed to moc. Options may be given to moc, such as
those found when executing "moc \-help".
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
create code from a list of Qt designer ui files.
Options may be given to uic, such as those found
when executing "uic \-help"
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
create code from a list of Qt resource files.
Options may be given to rcc, such as those found
when executing "rcc \-help"
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_GENERATE_MOC(inputfile outputfile [TARGET tgt])
creates a rule to run moc on infile and create outfile.
Use this if for some reason QT4_WRAP_CPP() isn\(aqt appropriate, e.g.
because you need a custom filename for the moc file or something
similar. If the <tgt> is specified, the
INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
the <tgt> are passed to moc.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
Create the interface header and implementation files with the
given basename from the given interface xml file and add it to
the list of sources.
You can pass additional parameters to the qdbusxml2cpp call by setting
properties on the input file:
INCLUDE the given file will be included in the generate interface header
CLASSNAME the generated class is named accordingly
NO_NAMESPACE the generated class is not wrapped in a namespace
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
Create the interface header and implementation files
for all listed interface xml files.
The basename will be automatically determined from the name
of the xml file.
The source file properties described for
QT4_ADD_DBUS_INTERFACE also apply here.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname
[basename] [classname])
create a dbus adaptor (header and implementation file) from the xml file
describing the interface, and add it to the list of sources. The adaptor
forwards the calls to a parent class, defined in parentheader and named
parentclassname. The name of the generated files will be
<basename>adaptor.{cpp,h} where basename defaults to the basename of the
xml file.
If <classname> is provided, then it will be used as the classname of the
adaptor itself.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
generate the xml interface file from the given header.
If the optional argument interfacename is omitted, the name of the
interface file is constructed from the basename of the header with
the suffix .xml appended.
Options may be given to qdbuscpp2xml, such as those found when
executing "qdbuscpp2xml \-\-help"
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
ts_files ... OPTIONS ...)
out: qm_files
in: directories sources ts_files
options: flags to pass to lupdate, such as \-extensions to specify
extensions for a directory scan.
generates commands to create .ts (vie lupdate) and .qm
(via lrelease) \- files from directories and/or sources. The ts files are
created and/or updated in the source tree (unless given with full paths).
The qm files are generated in the build tree.
Updating the translations can be done by adding the qm_files
to the source list of your library/executable, so they are
always updated, or by adding a custom target to control when
they get updated/generated.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
out: qm_files
in: ts_files
generates commands to create .qm from .ts \- files. The generated
filenames can be found in qm_files. The ts_files
must exist and are not updated in any way.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... [TARGET tgt])
The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.
This macro is still experimental.
It can be used to have moc automatically handled.
So if you have the files foo.h and foo.cpp, and in foo.h a
a class uses the Q_OBJECT macro, moc has to run on it. If you don\(aqt
want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
#include "foo.moc"
in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will
scan all listed files at cmake\-time for such included moc files and if it
finds them cause a rule to be generated to run moc at build time on the
accompanying header file foo.h.
If a source file has the SKIP_AUTOMOC property set it will be ignored by
this macro.
If the <tgt> is specified, the INTERFACE_INCLUDE_DIRECTORIES and
INTERFACE_COMPILE_DEFINITIONS from the <tgt> are passed to moc.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
function QT4_USE_MODULES( target [link_type] modules...)
This function is obsolete. Use target_link_libraries with IMPORTED targets
instead.
Make <target> use the <modules> from Qt. Using a Qt module means
to link to the library, add the relevant include directories for the
module, and add the relevant compiler defines for using the module.
Modules are roughly equivalent to components of Qt4, so usage would be
something like:
qt4_use_modules(myexe Core Gui Declarative)
to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument
can be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the
same argument to the target_link_libraries call.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS IMPORTED Targets
.sp
A particular Qt library may be used by using the corresponding
\fBIMPORTED\fP target with the \fBtarget_link_libraries()\fP
command:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Using a target in this way causes :cmake(1)\(ga to use the appropriate include
directories and compile definitions for the target when compiling \fBmyexe\fP\&.
.sp
Targets are aware of their dependencies, so for example it is not necessary
to list \fBQt4::QtCore\fP if another Qt library is listed, and it is not
necessary to list \fBQt4::QtGui\fP if \fBQt4::QtDeclarative\fP is listed.
Targets may be tested for existence in the usual way with the
\fBif(TARGET)\fP command.
.sp
The Qt toolkit may contain both debug and release libraries.
\fBcmake(1)\fP will choose the appropriate version based on the build
configuration.
.INDENT 0.0
.TP
.B \fBQt4::QtCore\fP
The QtCore target
.TP
.B \fBQt4::QtGui\fP
The QtGui target
.TP
.B \fBQt4::Qt3Support\fP
The Qt3Support target
.TP
.B \fBQt4::QtAssistant\fP
The QtAssistant target
.TP
.B \fBQt4::QtAssistantClient\fP
The QtAssistantClient target
.TP
.B \fBQt4::QAxContainer\fP
The QAxContainer target (Windows only)
.TP
.B \fBQt4::QAxServer\fP
The QAxServer target (Windows only)
.TP
.B \fBQt4::QtDBus\fP
The QtDBus target
.TP
.B \fBQt4::QtDeclarative\fP
The QtDeclarative target
.TP
.B \fBQt4::QtDesigner\fP
The QtDesigner target
.TP
.B \fBQt4::QtDesignerComponents\fP
The QtDesignerComponents target
.TP
.B \fBQt4::QtHelp\fP
The QtHelp target
.TP
.B \fBQt4::QtMotif\fP
The QtMotif target
.TP
.B \fBQt4::QtMultimedia\fP
The QtMultimedia target
.TP
.B \fBQt4::QtNetwork\fP
The QtNetwork target
.TP
.B \fBQt4::QtNsPLugin\fP
The QtNsPLugin target
.TP
.B \fBQt4::QtOpenGL\fP
The QtOpenGL target
.TP
.B \fBQt4::QtScript\fP
The QtScript target
.TP
.B \fBQt4::QtScriptTools\fP
The QtScriptTools target
.TP
.B \fBQt4::QtSql\fP
The QtSql target
.TP
.B \fBQt4::QtSvg\fP
The QtSvg target
.TP
.B \fBQt4::QtTest\fP
The QtTest target
.TP
.B \fBQt4::QtUiTools\fP
The QtUiTools target
.TP
.B \fBQt4::QtWebKit\fP
The QtWebKit target
.TP
.B \fBQt4::QtXml\fP
The QtXml target
.TP
.B \fBQt4::QtXmlPatterns\fP
The QtXmlPatterns target
.TP
.B \fBQt4::phonon\fP
The phonon target
.UNINDENT
.SS Result Variables
.INDENT 0.0
.INDENT 3.5
Below is a detailed list of variables that FindQt4.cmake sets.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \fBQt4_FOUND\fP
If false, don\(aqt try to use Qt 4.
.TP
.B \fBQT_FOUND\fP
If false, don\(aqt try to use Qt. This variable is for compatibility only.
.TP
.B \fBQT4_FOUND\fP
If false, don\(aqt try to use Qt 4. This variable is for compatibility only.
.TP
.B \fBQT_VERSION_MAJOR\fP
The major version of Qt found.
.TP
.B \fBQT_VERSION_MINOR\fP
The minor version of Qt found.
.TP
.B \fBQT_VERSION_PATCH\fP
The patch version of Qt found.
.UNINDENT
.SS FindQt
.sp
Searches for all installed versions of Qt.
.sp
This should only be used if your project can work with multiple
versions of Qt. If not, you should just directly use FindQt4 or
FindQt3. If multiple versions of Qt are found on the machine, then
The user must set the option DESIRED_QT_VERSION to the version they
want to use. If only one version of qt is found on the machine, then
the DESIRED_QT_VERSION is set to that version and the matching FindQt3
or FindQt4 module is included. Once the user sets DESIRED_QT_VERSION,
then the FindQt3 or FindQt4 module is included.
.sp
This module can only detect and switch between Qt versions 3 and 4. It
cannot handle Qt5 or any later versions.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
QT_REQUIRED if this is set to TRUE then if CMake can
not find Qt4 or Qt3 an error is raised
and a message is sent to the user.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
DESIRED_QT_VERSION OPTION is created
QT4_INSTALLED is set to TRUE if qt4 is found.
QT3_INSTALLED is set to TRUE if qt3 is found.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindQuickTime
.sp
Locate QuickTime This module defines QUICKTIME_LIBRARY
QUICKTIME_FOUND, if false, do not try to link to gdal
QUICKTIME_INCLUDE_DIR, where to find the headers
.sp
$QUICKTIME_DIR is an environment variable that would correspond to the
./configure \-\-prefix=$QUICKTIME_DIR
.sp
Created by Eric Wing.
.SS FindRTI
.sp
Try to find M&S HLA RTI libraries
.sp
This module finds if any HLA RTI is installed and locates the standard
RTI include files and libraries.
.sp
RTI is a simulation infrastructure standardized by IEEE and SISO. It
has a well defined C++ API that assures that simulation applications
are independent on a particular RTI implementation.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
http://en.wikipedia.org/wiki/Run\-Time_Infrastructure_(simulation)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
RTI_INCLUDE_DIR = the directory where RTI includes file are found
RTI_LIBRARIES = The libraries to link against to use RTI
RTI_DEFINITIONS = \-DRTI_USES_STD_FSTREAM
RTI_FOUND = Set to FALSE if any HLA RTI was not found
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Report problems to <\fI\%certi\-devel@nongnu.org\fP>
.SS FindRuby
.sp
Find Ruby
.sp
This module finds if Ruby is installed and determines where the
include files and libraries are. Ruby 1.8, 1.9, 2.0 and 2.1 are
supported.
.sp
The minimum required version of Ruby can be specified using the
standard syntax, e.g. find_package(Ruby 1.8)
.sp
It also determines what the name of the library is. This code sets
the following variables:
.INDENT 0.0
.TP
.B \fBRUBY_EXECUTABLE\fP
full path to the ruby binary
.TP
.B \fBRUBY_INCLUDE_DIRS\fP
include dirs to be used when using the ruby library
.TP
.B \fBRUBY_LIBRARY\fP
full path to the ruby library
.TP
.B \fBRUBY_VERSION\fP
the version of ruby which was found, e.g. "1.8.7"
.TP
.B \fBRUBY_FOUND\fP
set to true if ruby ws found successfully
.UNINDENT
.sp
Also:
.INDENT 0.0
.TP
.B \fBRUBY_INCLUDE_PATH\fP
same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don\(aqt use it
.UNINDENT
.SS FindSDL_image
.sp
Locate SDL_image library
.sp
This module defines:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_IMAGE_LIBRARIES, the name of the library to link against
SDL_IMAGE_INCLUDE_DIRS, where to find the headers
SDL_IMAGE_FOUND, if false, do not try to link against
SDL_IMAGE_VERSION_STRING \- human\-readable string containing the
version of SDL_image
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For backward compatibility the following variables are also set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
$SDLDIR is an environment variable that would correspond to the
./configure \-\-prefix=$SDLDIR used in building SDL.
.sp
Created by Eric Wing. This was influenced by the FindSDL.cmake
module, but with modifications to recognize OS X frameworks and
additional Unix paths (FreeBSD, etc).
.SS FindSDL_mixer
.sp
Locate SDL_mixer library
.sp
This module defines:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_MIXER_LIBRARIES, the name of the library to link against
SDL_MIXER_INCLUDE_DIRS, where to find the headers
SDL_MIXER_FOUND, if false, do not try to link against
SDL_MIXER_VERSION_STRING \- human\-readable string containing the
version of SDL_mixer
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For backward compatibility the following variables are also set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
$SDLDIR is an environment variable that would correspond to the
./configure \-\-prefix=$SDLDIR used in building SDL.
.sp
Created by Eric Wing. This was influenced by the FindSDL.cmake
module, but with modifications to recognize OS X frameworks and
additional Unix paths (FreeBSD, etc).
.SS FindSDL_net
.sp
Locate SDL_net library
.sp
This module defines:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_NET_LIBRARIES, the name of the library to link against
SDL_NET_INCLUDE_DIRS, where to find the headers
SDL_NET_FOUND, if false, do not try to link against
SDL_NET_VERSION_STRING \- human\-readable string containing the version of SDL_net
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For backward compatibility the following variables are also set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
SDLNET_FOUND (same value as SDL_NET_FOUND)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
$SDLDIR is an environment variable that would correspond to the
./configure \-\-prefix=$SDLDIR used in building SDL.
.sp
Created by Eric Wing. This was influenced by the FindSDL.cmake
module, but with modifications to recognize OS X frameworks and
additional Unix paths (FreeBSD, etc).
.SS FindSDL
.sp
Locate SDL library
.sp
This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_LIBRARY, the name of the library to link against
SDL_FOUND, if false, do not try to link to SDL
SDL_INCLUDE_DIR, where to find SDL.h
SDL_VERSION_STRING, human\-readable string containing the version of SDL
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This module responds to the flag:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_BUILDING_LIBRARY
If this is defined, then no SDL_main will be linked in because
only applications need main().
Otherwise, it is assumed you are building an application and this
module will attempt to locate and set the proper link flags
as part of the returned SDL_LIBRARY variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Don\(aqt forget to include SDLmain.h and SDLmain.m your project for the
OS X framework based version. (Other versions link to \-lSDLmain which
this module will try to find on your behalf.) Also for OS X, this
module will automatically add the \-framework Cocoa on your behalf.
.sp
Additional Note: If you see an empty SDL_LIBRARY_TEMP in your
configuration and no SDL_LIBRARY, it means CMake did not find your SDL
library (SDL.dll, libsdl.so, SDL.framework, etc). Set
SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this
value as appropriate. These values are used to generate the final
SDL_LIBRARY variable, but when these values are unset, SDL_LIBRARY
does not get created.
.sp
$SDLDIR is an environment variable that would correspond to the
./configure \-\-prefix=$SDLDIR used in building SDL. l.e.galup 9\-20\-02
.sp
Modified by Eric Wing. Added code to assist with automated building
by using environmental variables and providing a more
controlled/consistent search behavior. Added new modifications to
recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
Also corrected the header search path to follow "proper" SDL
guidelines. Added a search for SDLmain which is needed by some
platforms. Added a search for threads which is needed by some
platforms. Added needed compile switches for MinGW.
.sp
On OSX, this will prefer the Framework version (if found) over others.
People will have to manually change the cache values of SDL_LIBRARY to
override this selection or set the CMake environment
CMAKE_INCLUDE_PATH to modify the search paths.
.sp
Note that the header path has changed from SDL/SDL.h to just SDL.h
This needed to change because "proper" SDL convention is #include
"SDL.h", not <SDL/SDL.h>. This is done for portability reasons
because not all systems place things in SDL/ (see FreeBSD).
.SS FindSDL_sound
.sp
Locates the SDL_sound library
.sp
This module depends on SDL being found and must be called AFTER
FindSDL.cmake is called.
.sp
This module defines
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
to link against.
SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
This is available mostly for cases this module failed to anticipate for
and you must add additional flags. This is marked as ADVANCED.
SDL_SOUND_VERSION_STRING, human\-readable string containing the
version of SDL_sound
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This module also defines (but you shouldn\(aqt need to use directly)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
And might define the following as needed
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
MIKMOD_LIBRARY
MODPLUG_LIBRARY
OGG_LIBRARY
VORBIS_LIBRARY
SMPEG_LIBRARY
FLAC_LIBRARY
SPEEX_LIBRARY
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Typically, you should not use these variables directly, and you should
use SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other
audio libraries (if needed) to successfully compile on your system.
.sp
Created by Eric Wing. This module is a bit more complicated than the
other FindSDL* family modules. The reason is that SDL_sound can be
compiled in a large variety of different ways which are independent of
platform. SDL_sound may dynamically link against other 3rd party
libraries to get additional codec support, such as Ogg Vorbis, SMPEG,
ModPlug, MikMod, FLAC, Speex, and potentially others. Under some
circumstances which I don\(aqt fully understand, there seems to be a
requirement that dependent libraries of libraries you use must also be
explicitly linked against in order to successfully compile. SDL_sound
does not currently have any system in place to know how it was
compiled. So this CMake module does the hard work in trying to
discover which 3rd party libraries are required for building (if any).
This module uses a brute force approach to create a test program that
uses SDL_sound, and then tries to build it. If the build fails, it
parses the error output for known symbol names to figure out which
libraries are needed.
.sp
Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable that
would correspond to the ./configure \-\-prefix=$SDLDIR used in building
SDL.
.sp
On OSX, this will prefer the Framework version (if found) over others.
People will have to manually change the cache values of SDL_LIBRARY to
override this selectionor set the CMake environment CMAKE_INCLUDE_PATH
to modify the search paths.
.SS FindSDL_ttf
.sp
Locate SDL_ttf library
.sp
This module defines:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDL_TTF_LIBRARIES, the name of the library to link against
SDL_TTF_INCLUDE_DIRS, where to find the headers
SDL_TTF_FOUND, if false, do not try to link against
SDL_TTF_VERSION_STRING \- human\-readable string containing the version of SDL_ttf
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For backward compatibility the following variables are also set:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
SDLTTF_FOUND (same value as SDL_TTF_FOUND)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
$SDLDIR is an environment variable that would correspond to the
./configure \-\-prefix=$SDLDIR used in building SDL.
.sp
Created by Eric Wing. This was influenced by the FindSDL.cmake
module, but with modifications to recognize OS X frameworks and
additional Unix paths (FreeBSD, etc).
.SS FindSelfPackers
.sp
Find upx
.sp
This module looks for some executable packers (i.e. software that
compress executables or shared libs into on\-the\-fly self\-extracting
executables or shared libs. Examples:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
UPX: http://wildsau.idv.uni\-linz.ac.at/mfx/upx.html
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindSquish
.sp
\-\- Typical Use
.sp
This module can be used to find Squish. Currently Squish versions 3
and 4 are supported.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SQUISH_FOUND If false, don\(aqt try to use Squish
SQUISH_VERSION The full version of Squish found
SQUISH_VERSION_MAJOR The major version of Squish found
SQUISH_VERSION_MINOR The minor version of Squish found
SQUISH_VERSION_PATCH The patch version of Squish found
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SQUISH_INSTALL_DIR The Squish installation directory
(containing bin, lib, etc)
SQUISH_SERVER_EXECUTABLE The squishserver executable
SQUISH_CLIENT_EXECUTABLE The squishrunner executable
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SQUISH_INSTALL_DIR_FOUND Was the install directory found?
SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It provides the function squish_v4_add_test() for adding a squish test
to cmake using Squish 4.x:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
squish_v4_add_test(cmakeTestName
AUT targetName SUITE suiteName TEST squishTestName
[SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The arguments have the following meaning:
.INDENT 0.0
.TP
.B \fBcmakeTestName\fP
this will be used as the first argument for add_test()
.TP
.B \fBAUT targetName\fP
the name of the cmake target which will be used as AUT, i.e. the
executable which will be tested.
.TP
.B \fBSUITE suiteName\fP
this is either the full path to the squish suite, or just the
last directory of the suite, i.e. the suite name. In this case
the CMakeLists.txt which calls squish_add_test() must be located
in the parent directory of the suite directory.
.TP
.B \fBTEST squishTestName\fP
the name of the squish test, i.e. the name of the subdirectory
of the test inside the suite directory.
.TP
.B \fBSETTINGSGROUP group\fP
if specified, the given settings group will be used for executing the test.
If not specified, the groupname will be "CTest_<username>"
.TP
.B \fBPRE_COMMAND command\fP
if specified, the given command will be executed before starting the squish test.
.TP
.B \fBPOST_COMMAND command\fP
same as PRE_COMMAND, but after the squish test has been executed.
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
enable_testing()
find_package(Squish 4.0)
if (SQUISH_FOUND)
squish_v4_add_test(myTestName
AUT myApp
SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite
TEST someSquishTest
SETTINGSGROUP myGroup
)
endif ()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For users of Squish version 3.x the macro squish_v3_add_test() is
provided:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
squish_v3_add_test(testName applicationUnderTest testCase envVars testWrapper)
Use this macro to add a test using Squish 3.x.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
enable_testing()
find_package(Squish)
if (SQUISH_FOUND)
squish_v3_add_test(myTestName myApplication testCase envVars testWrapper)
endif ()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
macro SQUISH_ADD_TEST(testName applicationUnderTest testCase envVars
testWrapper)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
This is deprecated. Use SQUISH_V3_ADD_TEST() if you are using Squish 3.x instead.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindSubversion
.sp
Extract information from a subversion working copy
.sp
The module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Subversion_SVN_EXECUTABLE \- path to svn command line client
Subversion_VERSION_SVN \- version of svn command line client
Subversion_FOUND \- true if the command line client was found
SUBVERSION_FOUND \- same as Subversion_FOUND, set for compatibility reasons
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum required version of Subversion can be specified using the
standard syntax, e.g. find_package(Subversion 1.4)
.sp
If the command line client executable is found two macros are defined:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Subversion_WC_INFO(<dir> <var\-prefix>)
Subversion_WC_LOG(<dir> <var\-prefix>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Subversion_WC_INFO extracts information of a subversion working copy
at a given location. This macro defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<var\-prefix>_WC_URL \- url of the repository (at <dir>)
<var\-prefix>_WC_ROOT \- root url of the repository
<var\-prefix>_WC_REVISION \- current revision
<var\-prefix>_WC_LAST_CHANGED_AUTHOR \- author of last commit
<var\-prefix>_WC_LAST_CHANGED_DATE \- date of last commit
<var\-prefix>_WC_LAST_CHANGED_REV \- revision of last commit
<var\-prefix>_WC_INFO \- output of command \(gasvn info <dir>\(aq
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Subversion_WC_LOG retrieves the log message of the base revision of a
subversion working copy at a given location. This macro defines the
variable:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
<var\-prefix>_LAST_CHANGED_LOG \- last log of base revision
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(Subversion)
if(SUBVERSION_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
message("Current revision is ${Project_WC_REVISION}")
Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
message("Last changed log is ${Project_LAST_CHANGED_LOG}")
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindSWIG
.sp
Find SWIG
.sp
This module finds an installed SWIG. It sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SWIG_FOUND \- set to true if SWIG is found
SWIG_DIR \- the directory where swig is installed
SWIG_EXECUTABLE \- the path to the swig executable
SWIG_VERSION \- the version number of the swig executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum required version of SWIG can be specified using the
standard syntax, e.g. find_package(SWIG 1.1)
.sp
All information is collected from the SWIG_EXECUTABLE so the version
to be found can be changed from the command line by means of setting
SWIG_EXECUTABLE
.SS FindTCL
.sp
TK_INTERNAL_PATH was removed.
.sp
This module finds if Tcl is installed and determines where the include
files and libraries are. It also determines what the name of the
library is. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
TCL_FOUND = Tcl was found
TK_FOUND = Tk was found
TCLTK_FOUND = Tcl and Tk were found
TCL_LIBRARY = path to Tcl library (tcl tcl80)
TCL_INCLUDE_PATH = path to where tcl.h can be found
TCL_TCLSH = path to tclsh binary (tcl tcl80)
TK_LIBRARY = path to Tk library (tk tk80 etc)
TK_INCLUDE_PATH = path to where tk.h can be found
TK_WISH = full path to the wish executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In an effort to remove some clutter and clear up some issues for
people who are not necessarily Tcl/Tk gurus/developpers, some
variables were moved or removed. Changes compared to CMake 2.4 are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
=> they were only useful for people writing Tcl/Tk extensions.
=> these libs are not packaged by default with Tcl/Tk distributions.
Even when Tcl/Tk is built from source, several flavors of debug libs
are created and there is no real reason to pick a single one
specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
Let\(aqs leave that choice to the user by allowing him to assign
TCL_LIBRARY to any Tcl library, debug or not.
=> this ended up being only a Win32 variable, and there is a lot of
confusion regarding the location of this file in an installed Tcl/Tk
tree anyway (see 8.5 for example). If you need the internal path at
this point it is safer you ask directly where the *source* tree is
and dig from there.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindTclsh
.sp
Find tclsh
.sp
This module finds if TCL is installed and determines where the include
files and libraries are. It also determines what the name of the
library is. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
TCLSH_FOUND = TRUE if tclsh has been found
TCL_TCLSH = the path to the tclsh executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In cygwin, look for the cygwin version first. Don\(aqt look for it later
to avoid finding the cygwin version on a Win32 build.
.SS FindTclStub
.sp
TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
.sp
This module finds Tcl stub libraries. It first finds Tcl include
files and libraries by calling FindTCL.cmake. How to Use the Tcl
Stubs Library:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
http://tcl.activestate.com/doc/howto/stubs.html
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Using Stub Libraries:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
http://safari.oreilly.com/0130385603/ch48lev1sec3
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
TCL_STUB_LIBRARY = path to Tcl stub library
TK_STUB_LIBRARY = path to Tk stub library
TTK_STUB_LIBRARY = path to ttk stub library
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
In an effort to remove some clutter and clear up some issues for
people who are not necessarily Tcl/Tk gurus/developpers, some
variables were moved or removed. Changes compared to CMake 2.4 are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
=> these libs are not packaged by default with Tcl/Tk distributions.
Even when Tcl/Tk is built from source, several flavors of debug libs
are created and there is no real reason to pick a single one
specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
Let\(aqs leave that choice to the user by allowing him to assign
TCL_STUB_LIBRARY to any Tcl library, debug or not.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindThreads
.sp
This module determines the thread library of the system.
.sp
The following variables are set
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_THREAD_LIBS_INIT \- the thread library
CMAKE_USE_SPROC_INIT \- are we using sproc?
CMAKE_USE_WIN32_THREADS_INIT \- using WIN32 threads?
CMAKE_USE_PTHREADS_INIT \- are we using pthreads
CMAKE_HP_PTHREADS_INIT \- are we using hp pthreads
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following import target is created
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Threads::Threads
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For systems with multiple thread libraries, caller can set
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_THREAD_PREFER_PTHREAD
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If the use of the \-pthread compiler and linker flag is preferred then the
caller can set
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
THREADS_PREFER_PTHREAD_FLAG
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Please note that the compiler flag can only be used with the imported
target. Use of both the imported target as well as this switch is highly
recommended for new code.
.SS FindTIFF
.sp
Find the TIFF library (libtiff).
.SS Imported targets
.sp
This module defines the following \fBIMPORTED\fP targets:
.INDENT 0.0
.TP
.B \fBTIFF::TIFF\fP
The TIFF library, if found.
.UNINDENT
.SS Result variables
.sp
This module will set the following variables in your project:
.INDENT 0.0
.TP
.B \fBTIFF_FOUND\fP
true if the TIFF headers and libraries were found
.TP
.B \fBTIFF_INCLUDE_DIR\fP
the directory containing the TIFF headers
.TP
.B \fBTIFF_INCLUDE_DIRS\fP
the directory containing the TIFF headers
.TP
.B \fBTIFF_LIBRARIES\fP
TIFF libraries to be linked
.UNINDENT
.SS Cache variables
.sp
The following cache variables may also be set:
.INDENT 0.0
.TP
.B \fBTIFF_INCLUDE_DIR\fP
the directory containing the TIFF headers
.TP
.B \fBTIFF_LIBRARY\fP
the path to the TIFF library
.UNINDENT
.SS FindUnixCommands
.sp
Find Unix commands, including the ones from Cygwin
.sp
This module looks for the Unix commands bash, cp, gzip, mv, rm, and tar
and stores the result in the variables BASH, CP, GZIP, MV, RM, and TAR.
.SS FindVTK
.sp
This module no longer exists.
.sp
This module existed in versions of CMake prior to 3.1, but became
only a thin wrapper around \fBfind_package(VTK NO_MODULE)\fP to
provide compatibility for projects using long\-outdated conventions.
Now \fBfind_package(VTK)\fP will search for \fBVTKConfig.cmake\fP
directly.
.SS FindVulkan
.sp
Try to find Vulkan
.SS IMPORTED Targets
.sp
This module defines \fBIMPORTED\fP target \fBVulkan::Vulkan\fP, if
Vulkan has been found.
.SS Result Variables
.sp
This module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Vulkan_FOUND \- True if Vulkan was found
Vulkan_INCLUDE_DIRS \- include directories for Vulkan
Vulkan_LIBRARIES \- link against this library to use Vulkan
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The module will also define two cache variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Vulkan_INCLUDE_DIR \- the Vulkan include directory
Vulkan_LIBRARY \- the path to the Vulkan library
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindWget
.sp
Find wget
.sp
This module looks for wget. This module defines the following values:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
WGET_EXECUTABLE: the full path to the wget tool.
WGET_FOUND: True if wget has been found.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindWish
.sp
Find wish installation
.sp
This module finds if TCL is installed and determines where the include
files and libraries are. It also determines what the name of the
library is. This code sets the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
TK_WISH = the path to the wish executable
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
if UNIX is defined, then it will look for the cygwin version first
.SS FindwxWidgets
.sp
Find a wxWidgets (a.k.a., wxWindows) installation.
.sp
This module finds if wxWidgets is installed and selects a default
configuration to use. wxWidgets is a modular library. To specify the
modules that you will use, you need to name them as components to the
package:
.sp
find_package(wxWidgets COMPONENTS core base ...)
.sp
There are two search branches: a windows style and a unix style. For
windows, the following variables are searched for and set to defaults
in case of multiple choices. Change them if the defaults are not
desired (i.e., these are the only variables you should change to
select a configuration):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
wxWidgets_ROOT_DIR \- Base wxWidgets directory
(e.g., C:/wxWidgets\-2.6.3).
wxWidgets_LIB_DIR \- Path to wxWidgets libraries
(e.g., C:/wxWidgets\-2.6.3/lib/vc_lib).
wxWidgets_CONFIGURATION \- Configuration to use
(e.g., msw, mswd, mswu, mswunivud, etc.)
wxWidgets_EXCLUDE_COMMON_LIBRARIES
\- Set to TRUE to exclude linking of
commonly required libs (e.g., png tiff
jpeg zlib regex expat).
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For unix style it uses the wx\-config utility. You can select between
debug/release, unicode/ansi, universal/non\-universal, and
static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
wxWidgets_USE_DEBUG
wxWidgets_USE_UNICODE
wxWidgets_USE_UNIVERSAL
wxWidgets_USE_STATIC
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
There is also a wxWidgets_CONFIG_OPTIONS variable for all other
options that need to be passed to the wx\-config utility. For example,
to use the base toolkit found in the /usr/local path, set the variable
(before calling the FIND_PACKAGE command) as such:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(wxWidgets_CONFIG_OPTIONS \-\-toolkit=base \-\-prefix=/usr)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following are set after the configuration is done for both windows
and unix style:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
wxWidgets_FOUND \- Set to TRUE if wxWidgets was found.
wxWidgets_INCLUDE_DIRS \- Include directories for WIN32
i.e., where to find "wx/wx.h" and
"wx/setup.h"; possibly empty for unices.
wxWidgets_LIBRARIES \- Path to the wxWidgets libraries.
wxWidgets_LIBRARY_DIRS \- compile time link dirs, useful for
rpath on UNIX. Typically an empty string
in WIN32 environment.
wxWidgets_DEFINITIONS \- Contains defines required to compile/link
against WX, e.g. WXUSINGDLL
wxWidgets_DEFINITIONS_DEBUG\- Contains defines required to compile/link
against WX debug builds, e.g. __WXDEBUG__
wxWidgets_CXX_FLAGS \- Include dirs and compiler flags for
unices, empty on WIN32. Essentially
"\(gawx\-config \-\-cxxflags\(ga".
wxWidgets_USE_FILE \- Convenience include file.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Sample usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# Note that for MinGW users the order of libs is important!
find_package(wxWidgets COMPONENTS net gl core base)
if(wxWidgets_FOUND)
include(${wxWidgets_USE_FILE})
# and for each of your dependent executable/library targets:
target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If wxWidgets is required (i.e., not an optional part):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(wxWidgets REQUIRED net gl core base)
include(${wxWidgets_USE_FILE})
# and for each of your dependent executable/library targets:
target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindwxWindows
.sp
Find wxWindows (wxWidgets) installation
.sp
This module finds if wxWindows/wxWidgets is installed and determines
where the include files and libraries are. It also determines what
the name of the library is. Please note this file is DEPRECATED and
replaced by FindwxWidgets.cmake. This code sets the following
variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
WXWINDOWS_FOUND = system has WxWindows
WXWINDOWS_LIBRARIES = path to the wxWindows libraries
on Unix/Linux with additional
linker flags from
"wx\-config \-\-libs"
CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
essentially "\(gawx\-config \-\-cxxflags\(ga"
on Linux
WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
Unix
WXWINDOWS_DEFINITIONS = extra defines
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
OPTIONS If you need OpenGL support please
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(WXWINDOWS_USE_GL 1)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
in your CMakeLists.txt \fIbefore\fP you include this file.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
HAVE_ISYSTEM \- true required to replace \-I by \-isystem on g++
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For convenience include Use_wxWindows.cmake in your project\(aqs
CMakeLists.txt using
include(${CMAKE_CURRENT_LIST_DIR}/Use_wxWindows.cmake).
.sp
USAGE
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(WXWINDOWS_USE_GL 1)
find_package(wxWindows)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
NOTES wxWidgets 2.6.x is supported for monolithic builds e.g.
compiled in wx/build/msw dir as:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
nmake \-f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
DEPRECATED
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_WX_CAN_COMPILE
WXWINDOWS_LIBRARY
CMAKE_WX_CXX_FLAGS
WXWINDOWS_INCLUDE_PATH
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
AUTHOR Jan Woetzel <\fI\%http://www.mip.informatik.uni\-kiel.de/~jw\fP>
(07/2003\-01/2006)
.SS FindXCTest
.sp
Functions to help creating and executing XCTest bundles.
.sp
An XCTest bundle is a CFBundle with a special product\-type
and bundle extension. The Mac Developer Library provides more
information in the \fI\%Testing with Xcode\fP document.
.SS Module Functions
.INDENT 0.0
.TP
.B xctest_add_bundle
The \fBxctest_add_bundle\fP function creates a XCTest bundle named
<target> which will test the target <testee>. Supported target types
for testee are Frameworks and App Bundles:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
xctest_add_bundle(
<target> # Name of the XCTest bundle
<testee> # Target name of the testee
)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B xctest_add_test
The \fBxctest_add_test\fP function adds an XCTest bundle to the
project to be run by \fBctest(1)\fP\&. The test will be named
<name> and tests <bundle>:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
xctest_add_test(
<name> # Test name
<bundle> # Target name of XCTest bundle
)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS Module Variables
.sp
The following variables are set by including this module:
.INDENT 0.0
.TP
.B XCTest_FOUND
True if the XCTest Framework and executable were found.
.UNINDENT
.INDENT 0.0
.TP
.B XCTest_EXECUTABLE
The path to the xctest command line tool used to execute XCTest bundles.
.UNINDENT
.INDENT 0.0
.TP
.B XCTest_INCLUDE_DIRS
The directory containing the XCTest Framework headers.
.UNINDENT
.INDENT 0.0
.TP
.B XCTest_LIBRARIES
The location of the XCTest Framework.
.UNINDENT
.SS FindXalanC
.sp
Find the Apache Xalan\-C++ XSL transform processor headers and libraries.
.SS Imported targets
.sp
This module defines the following \fBIMPORTED\fP targets:
.INDENT 0.0
.TP
.B \fBXalanC::XalanC\fP
The Xalan\-C++ \fBxalan\-c\fP library, if found.
.UNINDENT
.SS Result variables
.sp
This module will set the following variables in your project:
.INDENT 0.0
.TP
.B \fBXalanC_FOUND\fP
true if the Xalan headers and libraries were found
.TP
.B \fBXalanC_VERSION\fP
Xalan release version
.TP
.B \fBXalanC_INCLUDE_DIRS\fP
the directory containing the Xalan headers; note
\fBXercesC_INCLUDE_DIRS\fP is also required
.TP
.B \fBXalanC_LIBRARIES\fP
Xalan libraries to be linked; note \fBXercesC_LIBRARIES\fP is also
required
.UNINDENT
.SS Cache variables
.sp
The following cache variables may also be set:
.INDENT 0.0
.TP
.B \fBXalanC_INCLUDE_DIR\fP
the directory containing the Xalan headers
.TP
.B \fBXalanC_LIBRARY\fP
the Xalan library
.UNINDENT
.SS FindXercesC
.sp
Find the Apache Xerces\-C++ validating XML parser headers and libraries.
.SS Imported targets
.sp
This module defines the following \fBIMPORTED\fP targets:
.INDENT 0.0
.TP
.B \fBXercesC::XercesC\fP
The Xerces\-C++ \fBxerces\-c\fP library, if found.
.UNINDENT
.SS Result variables
.sp
This module will set the following variables in your project:
.INDENT 0.0
.TP
.B \fBXercesC_FOUND\fP
true if the Xerces headers and libraries were found
.TP
.B \fBXercesC_VERSION\fP
Xerces release version
.TP
.B \fBXercesC_INCLUDE_DIRS\fP
the directory containing the Xerces headers
.TP
.B \fBXercesC_LIBRARIES\fP
Xerces libraries to be linked
.UNINDENT
.SS Cache variables
.sp
The following cache variables may also be set:
.INDENT 0.0
.TP
.B \fBXercesC_INCLUDE_DIR\fP
the directory containing the Xerces headers
.TP
.B \fBXercesC_LIBRARY\fP
the Xerces library
.UNINDENT
.SS FindX11
.sp
Find X11 installation
.sp
Try to find X11 on UNIX systems. The following values are defined
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
X11_FOUND \- True if X11 is available
X11_INCLUDE_DIR \- include directories to use X11
X11_LIBRARIES \- link against these to use X11
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
and also the following more fine grained variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND
X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND
X11_X11_INCLUDE_PATH, X11_X11_LIB
X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
X11_Xext_LIB, X11_Xext_FOUND
X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND
X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND
X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindXMLRPC
.sp
Find xmlrpc
.sp
Find the native XMLRPC headers and libraries.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
XMLRPC_INCLUDE_DIRS \- where to find xmlrpc.h, etc.
XMLRPC_LIBRARIES \- List of libraries when using xmlrpc.
XMLRPC_FOUND \- True if xmlrpc found.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
XMLRPC modules may be specified as components for this find module.
Modules may be listed by running "xmlrpc\-c\-config". Modules include:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
c++ C++ wrapper code
libwww\-client libwww\-based client
cgi\-server CGI\-based server
abyss\-server ABYSS\-based server
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Typical usage:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_package(XMLRPC REQUIRED libwww\-client)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS FindZLIB
.sp
Find the native ZLIB includes and library.
.SS IMPORTED Targets
.sp
This module defines \fBIMPORTED\fP target \fBZLIB::ZLIB\fP, if
ZLIB has been found.
.SS Result Variables
.sp
This module defines the following variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ZLIB_INCLUDE_DIRS \- where to find zlib.h, etc.
ZLIB_LIBRARIES \- List of libraries when using zlib.
ZLIB_FOUND \- True if zlib found.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ZLIB_VERSION_STRING \- The version of zlib found (x.y.z)
ZLIB_VERSION_MAJOR \- The major version of zlib
ZLIB_VERSION_MINOR \- The minor version of zlib
ZLIB_VERSION_PATCH \- The patch version of zlib
ZLIB_VERSION_TWEAK \- The tweak version of zlib
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Backward Compatibility
.sp
The following variable are provided for backward compatibility
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ZLIB_MAJOR_VERSION \- The major version of zlib
ZLIB_MINOR_VERSION \- The minor version of zlib
ZLIB_PATCH_VERSION \- The patch version of zlib
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Hints
.sp
A user may set \fBZLIB_ROOT\fP to a zlib installation root to tell this
module where to look.
.SS FortranCInterface
.sp
Fortran/C Interface Detection
.sp
This module automatically detects the API by which C and Fortran
languages interact.
.SS Module Variables
.sp
Variables that indicate if the mangling is found:
.INDENT 0.0
.TP
.B \fBFortranCInterface_GLOBAL_FOUND\fP
Global subroutines and functions.
.TP
.B \fBFortranCInterface_MODULE_FOUND\fP
Module subroutines and functions (declared by "MODULE PROCEDURE").
.UNINDENT
.sp
This module also provides the following variables to specify
the detected mangling, though a typical use case does not need
to reference them and can use the \fI\%Module Functions\fP below.
.INDENT 0.0
.TP
.B \fBFortranCInterface_GLOBAL_PREFIX\fP
Prefix for a global symbol without an underscore.
.TP
.B \fBFortranCInterface_GLOBAL_SUFFIX\fP
Suffix for a global symbol without an underscore.
.TP
.B \fBFortranCInterface_GLOBAL_CASE\fP
The case for a global symbol without an underscore,
either \fBUPPER\fP or \fBLOWER\fP\&.
.TP
.B \fBFortranCInterface_GLOBAL__PREFIX\fP
Prefix for a global symbol with an underscore.
.TP
.B \fBFortranCInterface_GLOBAL__SUFFIX\fP
Suffix for a global symbol with an underscore.
.TP
.B \fBFortranCInterface_GLOBAL__CASE\fP
The case for a global symbol with an underscore,
either \fBUPPER\fP or \fBLOWER\fP\&.
.TP
.B \fBFortranCInterface_MODULE_PREFIX\fP
Prefix for a module symbol without an underscore.
.TP
.B \fBFortranCInterface_MODULE_MIDDLE\fP
Middle of a module symbol without an underscore that appears
between the name of the module and the name of the symbol.
.TP
.B \fBFortranCInterface_MODULE_SUFFIX\fP
Suffix for a module symbol without an underscore.
.TP
.B \fBFortranCInterface_MODULE_CASE\fP
The case for a module symbol without an underscore,
either \fBUPPER\fP or \fBLOWER\fP\&.
.TP
.B \fBFortranCInterface_MODULE__PREFIX\fP
Prefix for a module symbol with an underscore.
.TP
.B \fBFortranCInterface_MODULE__MIDDLE\fP
Middle of a module symbol with an underscore that appears
between the name of the module and the name of the symbol.
.TP
.B \fBFortranCInterface_MODULE__SUFFIX\fP
Suffix for a module symbol with an underscore.
.TP
.B \fBFortranCInterface_MODULE__CASE\fP
The case for a module symbol with an underscore,
either \fBUPPER\fP or \fBLOWER\fP\&.
.UNINDENT
.SS Module Functions
.INDENT 0.0
.TP
.B FortranCInterface_HEADER
The \fBFortranCInterface_HEADER\fP function is provided to generate a
C header file containing macros to mangle symbol names:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
FortranCInterface_HEADER(<file>
[MACRO_NAMESPACE <macro\-ns>]
[SYMBOL_NAMESPACE <ns>]
[SYMBOLS [<module>:]<function> ...])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It generates in \fB<file>\fP definitions of the following macros:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
#define FortranCInterface_GLOBAL (name,NAME) ...
#define FortranCInterface_GLOBAL_(name,NAME) ...
#define FortranCInterface_MODULE (mod,name, MOD,NAME) ...
#define FortranCInterface_MODULE_(mod,name, MOD,NAME) ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
These macros mangle four categories of Fortran symbols, respectively:
.INDENT 7.0
.IP \(bu 2
Global symbols without \(aq_\(aq: \fBcall mysub()\fP
.IP \(bu 2
Global symbols with \(aq_\(aq : \fBcall my_sub()\fP
.IP \(bu 2
Module symbols without \(aq_\(aq: \fBuse mymod; call mysub()\fP
.IP \(bu 2
Module symbols with \(aq_\(aq : \fBuse mymod; call my_sub()\fP
.UNINDENT
.sp
If mangling for a category is not known, its macro is left undefined.
All macros require raw names in both lower case and upper case.
.sp
The options are:
.INDENT 7.0
.TP
.B \fBMACRO_NAMESPACE\fP
Replace the default \fBFortranCInterface_\fP prefix with a given
namespace \fB<macro\-ns>\fP\&.
.TP
.B \fBSYMBOLS\fP
List symbols to mangle automatically with C preprocessor definitions:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
<function> ==> #define <ns><function> ...
<module>:<function> ==> #define <ns><module>_<function> ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If the mangling for some symbol is not known then no preprocessor
definition is created, and a warning is displayed.
.TP
.B \fBSYMBOL_NAMESPACE\fP
Prefix all preprocessor definitions generated by the \fBSYMBOLS\fP
option with a given namespace \fB<ns>\fP\&.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B FortranCInterface_VERIFY
The \fBFortranCInterface_VERIFY\fP function is provided to verify
that the Fortran and C/C++ compilers work together:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
FortranCInterface_VERIFY([CXX] [QUIET])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
It tests whether a simple test executable using Fortran and C (and C++
when the CXX option is given) compiles and links successfully. The
result is stored in the cache entry \fBFortranCInterface_VERIFIED_C\fP
(or \fBFortranCInterface_VERIFIED_CXX\fP if \fBCXX\fP is given) as a boolean.
If the check fails and \fBQUIET\fP is not given the function terminates with a
fatal error message describing the problem. The purpose of this check
is to stop a build early for incompatible compiler combinations. The
test is built in the \fBRelease\fP configuration.
.UNINDENT
.SS Example Usage
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include(FortranCInterface)
FortranCInterface_HEADER(FC.h MACRO_NAMESPACE "FC_")
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This creates a "FC.h" header that defines mangling macros \fBFC_GLOBAL()\fP,
\fBFC_GLOBAL_()\fP, \fBFC_MODULE()\fP, and \fBFC_MODULE_()\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include(FortranCInterface)
FortranCInterface_HEADER(FCMangle.h
MACRO_NAMESPACE "FC_"
SYMBOL_NAMESPACE "FC_"
SYMBOLS mysub mymod:my_sub)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This creates a "FCMangle.h" header that defines the same \fBFC_*()\fP
mangling macros as the previous example plus preprocessor symbols
\fBFC_mysub\fP and \fBFC_mymod_my_sub\fP\&.
.SS Additional Manglings
.sp
FortranCInterface is aware of possible \fBGLOBAL\fP and \fBMODULE\fP manglings
for many Fortran compilers, but it also provides an interface to specify
new possible manglings. Set the variables:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
FortranCInterface_GLOBAL_SYMBOLS
FortranCInterface_MODULE_SYMBOLS
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
before including FortranCInterface to specify manglings of the symbols
\fBMySub\fP, \fBMy_Sub\fP, \fBMyModule:MySub\fP, and \fBMy_Module:My_Sub\fP\&.
For example, the code:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(FortranCInterface_GLOBAL_SYMBOLS mysub_ my_sub__ MYSUB_)
# ^^^^^ ^^^^^^ ^^^^^
set(FortranCInterface_MODULE_SYMBOLS
__mymodule_MOD_mysub __my_module_MOD_my_sub)
# ^^^^^^^^ ^^^^^ ^^^^^^^^^ ^^^^^^
include(FortranCInterface)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
tells FortranCInterface to try given \fBGLOBAL\fP and \fBMODULE\fP manglings.
(The carets point at raw symbol names for clarity in this example but
are not needed.)
.SS GenerateExportHeader
.sp
Function for generation of export macros for libraries
.sp
This module provides the function GENERATE_EXPORT_HEADER().
.sp
The \fBGENERATE_EXPORT_HEADER\fP function can be used to generate a file
suitable for preprocessor inclusion which contains EXPORT macros to be
used in library classes:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GENERATE_EXPORT_HEADER( LIBRARY_TARGET
[BASE_NAME <base_name>]
[EXPORT_MACRO_NAME <export_macro_name>]
[EXPORT_FILE_NAME <export_file_name>]
[DEPRECATED_MACRO_NAME <deprecated_macro_name>]
[NO_EXPORT_MACRO_NAME <no_export_macro_name>]
[STATIC_DEFINE <static_define>]
[NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
[DEFINE_NO_DEPRECATED]
[PREFIX_NAME <prefix_name>]
[CUSTOM_CONTENT_FROM_VARIABLE <variable>]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The target properties \fBCXX_VISIBILITY_PRESET\fP
and \fBVISIBILITY_INLINES_HIDDEN\fP can be used to add the appropriate
compile flags for targets. See the documentation of those target properties,
and the convenience variables
\fBCMAKE_CXX_VISIBILITY_PRESET\fP and
\fBCMAKE_VISIBILITY_INLINES_HIDDEN\fP\&.
.sp
By default \fBGENERATE_EXPORT_HEADER()\fP generates macro names in a file
name determined by the name of the library. This means that in the
simplest case, users of \fBGenerateExportHeader\fP will be equivalent to:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
add_library(somelib someclass.cpp)
generate_export_header(somelib)
install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
install(FILES
someclass.h
${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
And in the ABI header files:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include "somelib_export.h"
class SOMELIB_EXPORT SomeClass {
...
};
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The CMake fragment will generate a file in the
\fB${CMAKE_CURRENT_BINARY_DIR}\fP called \fBsomelib_export.h\fP containing the
macros \fBSOMELIB_EXPORT\fP, \fBSOMELIB_NO_EXPORT\fP, \fBSOMELIB_DEPRECATED\fP,
\fBSOMELIB_DEPRECATED_EXPORT\fP and \fBSOMELIB_DEPRECATED_NO_EXPORT\fP\&.
They will be followed by content taken from the variable specified by
the \fBCUSTOM_CONTENT_FROM_VARIABLE\fP option, if any.
The resulting file should be installed with other headers in the library.
.sp
The \fBBASE_NAME\fP argument can be used to override the file name and the
names used for the macros:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_library(somelib someclass.cpp)
generate_export_header(somelib
BASE_NAME other_name
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Generates a file called \fBother_name_export.h\fP containing the macros
\fBOTHER_NAME_EXPORT\fP, \fBOTHER_NAME_NO_EXPORT\fP and \fBOTHER_NAME_DEPRECATED\fP
etc.
.sp
The \fBBASE_NAME\fP may be overridden by specifying other options in the
function. For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_library(somelib someclass.cpp)
generate_export_header(somelib
EXPORT_MACRO_NAME OTHER_NAME_EXPORT
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
creates the macro \fBOTHER_NAME_EXPORT\fP instead of \fBSOMELIB_EXPORT\fP, but
other macros and the generated file name is as default:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_library(somelib someclass.cpp)
generate_export_header(somelib
DEPRECATED_MACRO_NAME KDE_DEPRECATED
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
creates the macro \fBKDE_DEPRECATED\fP instead of \fBSOMELIB_DEPRECATED\fP\&.
.sp
If \fBLIBRARY_TARGET\fP is a static library, macros are defined without
values.
.sp
If the same sources are used to create both a shared and a static
library, the uppercased symbol \fB${BASE_NAME}_STATIC_DEFINE\fP should be
used when building the static library:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_library(shared_variant SHARED ${lib_SRCS})
add_library(static_variant ${lib_SRCS})
generate_export_header(shared_variant BASE_NAME libshared_and_static)
set_target_properties(static_variant PROPERTIES
COMPILE_FLAGS \-DLIBSHARED_AND_STATIC_STATIC_DEFINE)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This will cause the export macros to expand to nothing when building
the static library.
.sp
If \fBDEFINE_NO_DEPRECATED\fP is specified, then a macro
\fB${BASE_NAME}_NO_DEPRECATED\fP will be defined This macro can be used to
remove deprecated code from preprocessor output:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
if (EXCLUDE_DEPRECATED)
set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
endif()
generate_export_header(somelib ${NO_BUILD_DEPRECATED})
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
And then in somelib:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
class SOMELIB_EXPORT SomeClass
{
public:
#ifndef SOMELIB_NO_DEPRECATED
SOMELIB_DEPRECATED void oldMethod();
#endif
};
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#ifndef SOMELIB_NO_DEPRECATED
void SomeClass::oldMethod() { }
#endif
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If \fBPREFIX_NAME\fP is specified, the argument will be used as a prefix to
all generated macros.
.sp
For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
generate_export_header(somelib PREFIX_NAME VTK_)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Generates the macros \fBVTK_SOMELIB_EXPORT\fP etc.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBADD_COMPILER_EXPORT_FLAGS\fP function adds \fB\-fvisibility=hidden\fP to
\fBCMAKE_CXX_FLAGS\fP if supported, and is a no\-op
on Windows which does not need extra compiler flags for exporting support.
You may optionally pass a single argument to \fBADD_COMPILER_EXPORT_FLAGS\fP
that will be populated with the \fBCXX_FLAGS\fP required to enable visibility
support for the compiler/architecture in use.
.sp
This function is deprecated. Set the target properties
\fBCXX_VISIBILITY_PRESET\fP and
\fBVISIBILITY_INLINES_HIDDEN\fP instead.
.SS GetPrerequisites
.sp
Functions to analyze and list executable file prerequisites.
.sp
This module provides functions to list the .dll, .dylib or .so files
that an executable or shared library file depends on. (Its
prerequisites.)
.sp
It uses various tools to obtain the list of required shared library
files:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
dumpbin (Windows)
objdump (MinGW on Windows)
ldd (Linux/Unix)
otool (Mac OSX)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The following functions are provided by this module:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
get_prerequisites
list_prerequisites
list_prerequisites_by_glob
gp_append_unique
is_file_executable
gp_item_default_embedded_path
(projects can override with gp_item_default_embedded_path_override)
gp_resolve_item
(projects can override with gp_resolve_item_override)
gp_resolved_file_type
(projects can override with gp_resolved_file_type_override)
gp_file_type
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Requires CMake 2.6 or greater because it uses function, break, return
and PARENT_SCOPE.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
<exepath> <dirs> [<rpaths>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Get the list of shared library files required by <target>. The list
in the variable named <prerequisites_var> should be empty on first
entry to this function. On exit, <prerequisites_var> will contain the
list of required shared library files.
.sp
<target> is the full path to an executable file. <prerequisites_var>
is the name of a CMake variable to contain the results.
<exclude_system> must be 0 or 1 indicating whether to include or
exclude "system" prerequisites. If <recurse> is set to 1 all
prerequisites will be found recursively, if set to 0 only direct
prerequisites are listed. <exepath> is the path to the top level
executable used for @executable_path replacment on the Mac. <dirs> is
a list of paths where libraries might be found: these paths are
searched first when a target without any path info is given. Then
standard system locations are also searched: PATH, Framework
locations, /usr/lib...
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Print a message listing the prerequisites of <target>.
.sp
<target> is the name of a shared library or executable target or the
full path to a shared library or executable file. If <recurse> is set
to 1 all prerequisites will be found recursively, if set to 0 only
direct prerequisites are listed. <exclude_system> must be 0 or 1
indicating whether to include or exclude "system" prerequisites. With
<verbose> set to 0 only the full path names of the prerequisites are
printed, set to 1 extra informatin will be displayed.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Print the prerequisites of shared library and executable files
matching a globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE and
<glob_exp> is a globbing expression used with "file(GLOB" or
"file(GLOB_RECURSE" to retrieve a list of matching files. If a
matching file is executable, its prerequisites are listed.
.sp
Any additional (optional) arguments provided are passed along as the
optional arguments to the list_prerequisites calls.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GP_APPEND_UNIQUE(<list_var> <value>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Append <value> to the list variable <list_var> only if the value is
not already in the list.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
IS_FILE_EXECUTABLE(<file> <result_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Return 1 in <result_var> if <file> is a binary executable, 0
otherwise.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Return the path that others should refer to the item by when the item
is embedded inside a bundle.
.sp
Override on a per\-project basis by providing a project\-specific
gp_item_default_embedded_path_override function.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>
[<rpaths>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Resolve an item into an existing full path file.
.sp
Override on a per\-project basis by providing a project\-specific
gp_resolve_item_override function.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>
[<rpaths>])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Return the type of <file> with respect to <original_file>. String
describing type of prerequisite is returned in variable named
<type_var>.
.sp
Use <exepath> and <dirs> if necessary to resolve non\-absolute <file>
values \-\- but only for non\-embedded items.
.sp
Possible types are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
system
local
embedded
other
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Override on a per\-project basis by providing a project\-specific
gp_resolved_file_type_override function.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
GP_FILE_TYPE(<original_file> <file> <type_var>)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Return the type of <file> with respect to <original_file>. String
describing type of prerequisite is returned in variable named
<type_var>.
.sp
Possible types are:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
system
local
embedded
other
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GNUInstallDirs
.sp
Define GNU standard installation directories
.sp
Provides install directory variables as defined by the
\fI\%GNU Coding Standards\fP\&.
.SS Result Variables
.sp
Inclusion of this module defines the following variables:
.sp
\fBCMAKE_INSTALL_<dir>\fP
.INDENT 0.0
.INDENT 3.5
Destination for files of a given type. This value may be passed to
the \fBDESTINATION\fP options of \fBinstall()\fP commands for the
corresponding file type.
.UNINDENT
.UNINDENT
.sp
\fBCMAKE_INSTALL_FULL_<dir>\fP
.INDENT 0.0
.INDENT 3.5
The absolute path generated from the corresponding \fBCMAKE_INSTALL_<dir>\fP
value. If the value is not already an absolute path, an absolute path
is constructed typically by prepending the value of the
\fBCMAKE_INSTALL_PREFIX\fP variable. However, there are some
\fI\%special cases\fP as documented below.
.UNINDENT
.UNINDENT
.sp
where \fB<dir>\fP is one of:
.INDENT 0.0
.TP
.B \fBBINDIR\fP
user executables (\fBbin\fP)
.TP
.B \fBSBINDIR\fP
system admin executables (\fBsbin\fP)
.TP
.B \fBLIBEXECDIR\fP
program executables (\fBlibexec\fP)
.TP
.B \fBSYSCONFDIR\fP
read\-only single\-machine data (\fBetc\fP)
.TP
.B \fBSHAREDSTATEDIR\fP
modifiable architecture\-independent data (\fBcom\fP)
.TP
.B \fBLOCALSTATEDIR\fP
modifiable single\-machine data (\fBvar\fP)
.TP
.B \fBLIBDIR\fP
object code libraries (\fBlib\fP or \fBlib64\fP
or \fBlib/<multiarch\-tuple>\fP on Debian)
.TP
.B \fBINCLUDEDIR\fP
C header files (\fBinclude\fP)
.TP
.B \fBOLDINCLUDEDIR\fP
C header files for non\-gcc (\fB/usr/include\fP)
.TP
.B \fBDATAROOTDIR\fP
read\-only architecture\-independent data root (\fBshare\fP)
.TP
.B \fBDATADIR\fP
read\-only architecture\-independent data (\fBDATAROOTDIR\fP)
.TP
.B \fBINFODIR\fP
info documentation (\fBDATAROOTDIR/info\fP)
.TP
.B \fBLOCALEDIR\fP
locale\-dependent data (\fBDATAROOTDIR/locale\fP)
.TP
.B \fBMANDIR\fP
man documentation (\fBDATAROOTDIR/man\fP)
.TP
.B \fBDOCDIR\fP
documentation root (\fBDATAROOTDIR/doc/PROJECT_NAME\fP)
.UNINDENT
.sp
If the includer does not define a value the above\-shown default will be
used and the value will appear in the cache for editing by the user.
.SS Special Cases
.sp
The following values of \fBCMAKE_INSTALL_PREFIX\fP are special:
.sp
\fB/\fP
.INDENT 0.0
.INDENT 3.5
For \fB<dir>\fP other than the \fBSYSCONFDIR\fP and \fBLOCALSTATEDIR\fP,
the value of \fBCMAKE_INSTALL_<dir>\fP is prefixed with \fBusr/\fP if
it is not user\-specified as an absolute path. For example, the
\fBINCLUDEDIR\fP value \fBinclude\fP becomes \fBusr/include\fP\&.
This is required by the \fI\%GNU Coding Standards\fP, which state:
.INDENT 0.0
.INDENT 3.5
When building the complete GNU system, the prefix will be empty
and \fB/usr\fP will be a symbolic link to \fB/\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.sp
\fB/usr\fP
.INDENT 0.0
.INDENT 3.5
For \fB<dir>\fP equal to \fBSYSCONFDIR\fP or \fBLOCALSTATEDIR\fP, the
\fBCMAKE_INSTALL_FULL_<dir>\fP is computed by prepending just \fB/\fP
to the value of \fBCMAKE_INSTALL_<dir>\fP if it is not user\-specified
as an absolute path. For example, the \fBSYSCONFDIR\fP value \fBetc\fP
becomes \fB/etc\fP\&. This is required by the \fI\%GNU Coding Standards\fP\&.
.UNINDENT
.UNINDENT
.sp
\fB/opt/...\fP
.INDENT 0.0
.INDENT 3.5
For \fB<dir>\fP equal to \fBSYSCONFDIR\fP or \fBLOCALSTATEDIR\fP, the
\fBCMAKE_INSTALL_FULL_<dir>\fP is computed by \fIappending\fP the prefix
to the value of \fBCMAKE_INSTALL_<dir>\fP if it is not user\-specified
as an absolute path. For example, the \fBSYSCONFDIR\fP value \fBetc\fP
becomes \fB/etc/opt/...\fP\&. This is defined by the
\fI\%Filesystem Hierarchy Standard\fP\&.
.UNINDENT
.UNINDENT
.SS Macros
.INDENT 0.0
.TP
.B GNUInstallDirs_get_absolute_install_dir
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
GNUInstallDirs_get_absolute_install_dir(absvar var)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Set the given variable \fBabsvar\fP to the absolute path contained
within the variable \fBvar\fP\&. This is to allow the computation of an
absolute path, accounting for all the special cases documented
above. While this macro is used to compute the various
\fBCMAKE_INSTALL_FULL_<dir>\fP variables, it is exposed publicly to
allow users who create additional path variables to also compute
absolute paths where necessary, using the same logic.
.UNINDENT
.SS InstallRequiredSystemLibraries
.sp
Include this module to search for compiler\-provided system runtime
libraries and add install rules for them. Some optional variables
may be set prior to including the module to adjust behavior:
.INDENT 0.0
.TP
.B \fBCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS\fP
Specify additional runtime libraries that may not be detected.
After inclusion any detected libraries will be appended to this.
.TP
.B \fBCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP\fP
Set to TRUE to skip calling the \fBinstall(PROGRAMS)\fP command to
allow the includer to specify its own install rule, using the value of
\fBCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS\fP to get the list of libraries.
.TP
.B \fBCMAKE_INSTALL_DEBUG_LIBRARIES\fP
Set to TRUE to install the debug runtime libraries when available
with MSVC tools.
.TP
.B \fBCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY\fP
Set to TRUE to install only the debug runtime libraries with MSVC
tools even if the release runtime libraries are also available.
.TP
.B \fBCMAKE_INSTALL_UCRT_LIBRARIES\fP
Set to TRUE to install the Windows Universal CRT libraries for
app\-local deployment (e.g. to Windows XP). This is meaningful
only with MSVC from Visual Studio 2015 or higher.
.TP
.B \fBCMAKE_INSTALL_MFC_LIBRARIES\fP
Set to TRUE to install the MSVC MFC runtime libraries.
.TP
.B \fBCMAKE_INSTALL_OPENMP_LIBRARIES\fP
Set to TRUE to install the MSVC OpenMP runtime libraries
.TP
.B \fBCMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION\fP
Specify the \fBinstall(PROGRAMS)\fP command \fBDESTINATION\fP
option. If not specified, the default is \fBbin\fP on Windows
and \fBlib\fP elsewhere.
.TP
.B \fBCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS\fP
Set to TRUE to disable warnings about required library files that
do not exist. (For example, Visual Studio Express editions may
not provide the redistributable files.)
.TP
.B \fBCMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT\fP
Specify the \fBinstall(PROGRAMS)\fP command \fBCOMPONENT\fP
option. If not specified, no such option will be used.
.UNINDENT
.SS MacroAddFileDependencies
.sp
MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
.sp
Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There
are usually better ways to specify the correct dependencies.
.sp
MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
convenience wrapper around the OBJECT_DEPENDS source file property.
You can just use set_property(SOURCE <file> APPEND PROPERTY
OBJECT_DEPENDS depend_files) instead.
.SS ProcessorCount
.sp
ProcessorCount(var)
.sp
Determine the number of processors/cores and save value in ${var}
.sp
Sets the variable named ${var} to the number of physical cores
available on the machine if the information can be determined.
Otherwise it is set to 0. Currently this functionality is implemented
for AIX, cygwin, FreeBSD, HPUX, IRIX, Linux, Mac OS X, QNX, Sun and
Windows.
.sp
This function is guaranteed to return a positive integer (>=1) if it
succeeds. It returns 0 if there\(aqs a problem determining the processor
count.
.sp
Example use, in a ctest \-S dashboard script:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
set(CTEST_BUILD_FLAGS \-j${N})
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
endif()
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This function is intended to offer an approximation of the value of
the number of compute cores available on the current machine, such
that you may use that value for parallel building and parallel
testing. It is meant to help utilize as much of the machine as seems
reasonable. Of course, knowledge of what else might be running on the
machine simultaneously should be used when deciding whether to request
a machine\(aqs full capacity all for yourself.
.SS SelectLibraryConfigurations
.sp
select_library_configurations( basename )
.sp
This macro takes a library base name as an argument, and will choose
good values for basename_LIBRARY, basename_LIBRARIES,
basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
has been found and set. If only basename_LIBRARY_RELEASE is defined,
basename_LIBRARY will be set to the release value, and
basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG\-NOTFOUND.
If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
take the debug value, and basename_LIBRARY_RELEASE will be set to
basename_LIBRARY_RELEASE\-NOTFOUND.
.sp
If the generator supports configuration types, then basename_LIBRARY
and basename_LIBRARIES will be set with debug and optimized flags
specifying the library to be used for the given configuration. If no
build type has been set or the generator in use does not support
configuration types, then basename_LIBRARY and basename_LIBRARIES will
take only the release value, or the debug value if the release one is
not set.
.SS SquishTestScript
.sp
This script launches a GUI test using Squish. You should not call the
script directly; instead, you should access it via the SQUISH_ADD_TEST
macro that is defined in FindSquish.cmake.
.sp
This script starts the Squish server, launches the test on the client,
and finally stops the squish server. If any of these steps fail
(including if the tests do not pass) then a fatal error is raised.
.SS TestBigEndian
.sp
Define macro to determine endian type
.sp
Check if the system is big endian or little endian
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
TEST_BIG_ENDIAN(VARIABLE)
VARIABLE \- variable to store the result to
.ft P
.fi
.UNINDENT
.UNINDENT
.SS TestCXXAcceptsFlag
.sp
Deprecated. See \fBCheckCXXCompilerFlag\fP\&.
.sp
Check if the CXX compiler accepts a flag.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CHECK_CXX_ACCEPTS_FLAG(<flags> <variable>)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \fB<flags>\fP
the flags to try
.TP
.B \fB<variable>\fP
variable to store the result
.UNINDENT
.SS TestForANSIForScope
.sp
Check for ANSI for scope support
.sp
Check if the compiler restricts the scope of variables declared in a
for\-init\-statement to the loop body.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_NO_ANSI_FOR_SCOPE \- holds result
.ft P
.fi
.UNINDENT
.UNINDENT
.SS TestForANSIStreamHeaders
.sp
Test for compiler support of ANSI stream headers iostream, etc.
.sp
check if the compiler supports the standard ANSI iostream header
(without the .h)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_NO_ANSI_STREAM_HEADERS \- defined by the results
.ft P
.fi
.UNINDENT
.UNINDENT
.SS TestForSSTREAM
.sp
Test for compiler support of ANSI sstream header
.sp
check if the compiler supports the standard ANSI sstream header
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_NO_ANSI_STRING_STREAM \- defined by the results
.ft P
.fi
.UNINDENT
.UNINDENT
.SS TestForSTDNamespace
.sp
Test for std:: namespace support
.sp
check if the compiler supports std:: on stl classes
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
CMAKE_NO_STD_NAMESPACE \- defined by the results
.ft P
.fi
.UNINDENT
.UNINDENT
.SS UseEcos
.sp
This module defines variables and macros required to build eCos application.
.sp
This file contains the following macros:
ECOS_ADD_INCLUDE_DIRECTORIES() \- add the eCos include dirs
ECOS_ADD_EXECUTABLE(name source1 ... sourceN ) \- create an eCos
executable ECOS_ADJUST_DIRECTORY(VAR source1 ... sourceN ) \- adjusts
the path of the source files and puts the result into VAR
.sp
Macros for selecting the toolchain: ECOS_USE_ARM_ELF_TOOLS() \- enable
the ARM ELF toolchain for the directory where it is called
ECOS_USE_I386_ELF_TOOLS() \- enable the i386 ELF toolchain for the
directory where it is called ECOS_USE_PPC_EABI_TOOLS() \- enable the
PowerPC toolchain for the directory where it is called
.sp
It contains the following variables: ECOS_DEFINITIONS
ECOSCONFIG_EXECUTABLE ECOS_CONFIG_FILE \- defaults to ecos.ecc, if your
eCos configuration file has a different name, adjust this variable for
internal use only:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
ECOS_ADD_TARGET_LIB
.ft P
.fi
.UNINDENT
.UNINDENT
.SS UseJavaClassFilelist
.sp
This script create a list of compiled Java class files to be added to
a jar file. This avoids including cmake files which get created in
the binary directory.
.SS UseJava
.sp
Use Module for Java
.sp
This file provides functions for Java. It is assumed that
FindJava.cmake has already been loaded. See FindJava.cmake for
information on how to load Java into your CMake project.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_jar(target_name
[SOURCES] source1 [source2 ...] [resource1 ...]
[INCLUDE_JARS jar1 [jar2 ...]]
[ENTRY_POINT entry]
[VERSION version]
[OUTPUT_NAME name]
[OUTPUT_DIR dir]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command creates a <target_name>.jar. It compiles the given
source files (source) and adds the given resource files (resource) to
the jar file. Source files can be java files or listing files
(prefixed by \(aq@\(aq). If only resource files are given then just a jar file
is created. The list of include jars are added to the classpath when
compiling the java sources and also to the dependencies of the target.
INCLUDE_JARS also accepts other target names created by add_jar. For
backwards compatibility, jar files listed as sources are ignored (as
they have been since the first version of this module).
.sp
The default OUTPUT_DIR can also be changed by setting the variable
CMAKE_JAVA_TARGET_OUTPUT_DIR.
.sp
Additional instructions:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
To add compile flags to the target you can set these flags with
the following variable:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CMAKE_JAVA_COMPILE_FLAGS \-nowarn)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
To add a path or a jar file to the class path you can do this
with the CMAKE_JAVA_INCLUDE_PATH variable.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
To use a different output name for the target you can set it with:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
To use a different output directory than CMAKE_CURRENT_BINARY_DIR
you can set it with:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
To define an entry point in your jar you can set it with the ENTRY_POINT
named argument:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_jar(example ENTRY_POINT com/examples/MyProject/Main)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
To define a custom manifest for the jar, you can set it with the manifest
named argument:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_jar(example MANIFEST /path/to/manifest)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
To add a VERSION to the target output name you can set it using
the VERSION named argument to add_jar. This will create a jar file with the
name shibboleet\-1.0.0.jar and will create a symlink shibboleet.jar
pointing to the jar with the version information.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
If the target is a JNI library, utilize the following commands to
create a JNI symbolic link:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CMAKE_JNI_TARGET TRUE)
add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
If a single target needs to produce more than one jar from its
java source code, to prevent the accumulation of duplicate class
files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
to calling the add_jar() function:
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
add_jar(foo foo.java)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
add_jar(bar bar.java)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Target Properties:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
The add_jar() function sets some target properties. You can get these
properties with the
get_property(TARGET <target_name> PROPERTY <propery_name>)
command.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
INSTALL_FILES The files which should be installed. This is used by
install_jar().
JNI_SYMLINK The JNI symlink which should be installed.
This is used by install_jni_symlink().
JAR_FILE The location of the jar file so that you can include
it.
CLASSDIR The directory where the class files can be found. For
example to use them with javah.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
find_jar(<VAR>
name | NAMES name1 [name2 ...]
[PATHS path1 [path2 ... ENV var]]
[VERSIONS version1 [version2]]
[DOC "cache documentation string"]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command is used to find a full path to the named jar. A cache
entry named by <VAR> is created to stor the result of this command.
If the full path to a jar is found the result is stored in the
variable and the search will not repeated unless the variable is
cleared. If nothing is found, the result will be <VAR>\-NOTFOUND, and
the search will be attempted again next time find_jar is invoked with
the same variable. The name of the full path to a file that is
searched for is specified by the names listed after NAMES argument.
Additional search locations can be specified after the PATHS argument.
If you require special a version of a jar file you can specify it with
the VERSIONS argument. The argument after DOC will be used for the
documentation string in the cache.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
install_jar(target_name destination)
install_jar(target_name DESTINATION destination [COMPONENT component])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command installs the TARGET_NAME files to the given DESTINATION.
It should be called in the same scope as add_jar() or it will fail.
.sp
Target Properties:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
The install_jar() function sets the INSTALL_DESTINATION target property
on jars so installed. This property holds the DESTINATION as described
above, and is used by install_jar_exports(). You can get this property
with the
get_property(TARGET <target_name> PROPERTY INSTALL_DESTINATION)
command.
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
install_jni_symlink(target_name destination)
install_jni_symlink(target_name DESTINATION destination [COMPONENT component])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command installs the TARGET_NAME JNI symlinks to the given
DESTINATION. It should be called in the same scope as add_jar() or it
will fail.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
install_jar_exports(TARGETS jar1 [jar2 ...]
FILE export_filename
DESTINATION destination [COMPONENT component])
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command installs a target export file export_filename for the named jar
targets to the given DESTINATION. Its function is similar to that of
install(EXPORTS).
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
export_jars(TARGETS jar1 [jar2 ...]
FILE export_filename)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This command writes a target export file export_filename for the named jar
targets. Its function is similar to that of export().
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
create_javadoc(<VAR>
PACKAGES pkg1 [pkg2 ...]
[SOURCEPATH <sourcepath>]
[CLASSPATH <classpath>]
[INSTALLPATH <install path>]
[DOCTITLE "the documentation title"]
[WINDOWTITLE "the title of the document"]
[AUTHOR TRUE|FALSE]
[USE TRUE|FALSE]
[VERSION TRUE|FALSE]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Create java documentation based on files or packages. For more
details please read the javadoc manpage.
.sp
There are two main signatures for create_javadoc. The first signature
works with package names on a path with source files:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Example:
create_javadoc(my_example_doc
PACKAGES com.exmaple.foo com.example.bar
SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
WINDOWTITLE "My example"
DOCTITLE "<h1>My example</h1>"
AUTHOR TRUE
USE TRUE
VERSION TRUE
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The second signature for create_javadoc works on a given list of
files.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
create_javadoc(<VAR>
FILES file1 [file2 ...]
[CLASSPATH <classpath>]
[INSTALLPATH <install path>]
[DOCTITLE "the documentation title"]
[WINDOWTITLE "the title of the document"]
[AUTHOR TRUE|FALSE]
[USE TRUE|FALSE]
[VERSION TRUE|FALSE]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
create_javadoc(my_example_doc
FILES ${example_SRCS}
CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
WINDOWTITLE "My example"
DOCTITLE "<h1>My example</h1>"
AUTHOR TRUE
USE TRUE
VERSION TRUE
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Both signatures share most of the options. These options are the same
as what you can find in the javadoc manpage. Please look at the
manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and VERSION.
.sp
The documentation will be by default installed to
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
if you don\(aqt set the INSTALLPATH.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
create_javah(TARGET <target>
GENERATED_FILES <VAR>
CLASSES <class>...
[CLASSPATH <classpath>...]
[DEPENDS <depend>...]
[OUTPUT_NAME <path>|OUTPUT_DIR <path>]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Create C header files from java classes. These files provide the connective glue
that allow your Java and C code to interact.
.sp
There are two main signatures for create_javah. The first signature
returns generated files through variable specified by GENERATED_FILES option:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Example:
Create_javah(GENERATED_FILES files_headers
CLASSES org.cmake.HelloWorld
CLASSPATH hello.jar
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The second signature for create_javah creates a target which encapsulates
header files generation.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Example:
Create_javah(TARGET target_headers
CLASSES org.cmake.HelloWorld
CLASSPATH hello.jar
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Both signatures share same options.
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.TP
.B \fBCLASSES <class>...\fP
Specifies Java classes used to generate headers.
.TP
.B \fBCLASSPATH <classpath>...\fP
Specifies various paths to look up classes. Here .class files, jar files or targets
created by command add_jar can be used.
.TP
.B \fBDEPENDS <depend>...\fP
Targets on which the javah target depends
.TP
.B \fBOUTPUT_NAME <path>\fP
Concatenates the resulting header files for all the classes listed by option CLASSES
into <path>. Same behavior as option \(aq\-o\(aq of javah tool.
.TP
.B \fBOUTPUT_DIR <path>\fP
Sets the directory where the header files will be generated. Same behavior as option
\(aq\-d\(aq of javah tool. If not specified, ${CMAKE_CURRENT_BINARY_DIR} is used as output directory.
.UNINDENT
.UNINDENT
.UNINDENT
.SS UseJavaSymlinks
.sp
Helper script for UseJava.cmake
.SS UsePkgConfig
.sp
Obsolete pkg\-config module for CMake, use FindPkgConfig instead.
.sp
This module defines the following macro:
.sp
PKGCONFIG(package includedir libdir linkflags cflags)
.sp
Calling PKGCONFIG will fill the desired information into the 4 given
arguments, e.g. PKGCONFIG(libart\-2.0 LIBART_INCLUDE_DIR
LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg\-config was NOT
found or the specified software package doesn\(aqt exist, the variable
will be empty when the function returns, otherwise they will contain
the respective information
.SS UseSWIG
.sp
Defines the following macros for use with SWIG:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
SWIG_ADD_LIBRARY(<name>
[TYPE <SHARED|MODULE|STATIC|USE_BUILD_SHARED_LIBS>]
LANGUAGE <language>
SOURCES <file>...
)
\- Define swig module with given name and specified language
SWIG_LINK_LIBRARIES(name [ libraries ])
\- Link libraries to swig module
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Source files properties on module files can be set before the invocation
of the SWIG_ADD_LIBRARY macro to specify special behavior of SWIG.
.sp
The source file property CPLUSPLUS calls SWIG in c++ mode, e.g.:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set_property(SOURCE mymod.i PROPERTY CPLUSPLUS ON)
swig_add_library(mymod LANGUAGE python SOURCES mymod.i)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The source file property SWIG_FLAGS adds custom flags to the SWIG executable.
.sp
The source\-file property SWIG_MODULE_NAME have to be provided to specify the actual
import name of the module in the target language if it cannot be scanned automatically
from source or different from the module file basename.:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set_property(SOURCE mymod.i PROPERTY SWIG_MODULE_NAME mymod_realname)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To get the name of the swig module target library, use: ${SWIG_MODULE_${name}_REAL_NAME}.
.sp
Also some variables can be set to specify special behavior of SWIG.
.sp
CMAKE_SWIG_FLAGS can be used to add special flags to all swig calls.
.sp
CMAKE_SWIG_OUTDIR allows one to specify where to write
the language specific files (swig \-outdir option).
.sp
SWIG_OUTFILE_DIR allows one to specify where to write the output file
(swig \-o option). If not specified, CMAKE_SWIG_OUTDIR is used.
.sp
The name\-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used to specify extra
dependencies for the generated modules.
.sp
If the source file generated by swig need some special flag you can use:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
set_source_files_properties( ${swig_generated_file_fullname}
PROPERTIES COMPILE_FLAGS "\-bla")
.ft P
.fi
.UNINDENT
.UNINDENT
.SS UsewxWidgets
.sp
Convenience include for using wxWidgets library.
.sp
Determines if wxWidgets was FOUND and sets the appropriate libs,
incdirs, flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are
called.
.sp
USAGE
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# Note that for MinGW users the order of libs is important!
find_package(wxWidgets REQUIRED net gl core base)
include(${wxWidgets_USE_FILE})
# and for each of your dependent executable/library targets:
target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
DEPRECATED
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
LINK_LIBRARIES is not called in favor of adding dependencies per target.
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
AUTHOR
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Jan Woetzel <jw \-at\- mip.informatik.uni\-kiel.de>
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Use_wxWindows
.sp
This convenience include finds if wxWindows is installed and set the
appropriate libs, incdirs, flags etc. author Jan Woetzel <jw \-at\-
mip.informatik.uni\-kiel.de> (07/2003)
.sp
USAGE:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
just include Use_wxWindows.cmake
in your projects CMakeLists.txt
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
if you are sure you need GL then
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
set(WXWINDOWS_USE_GL 1)
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
*before* you include this file.
.ft P
.fi
.UNINDENT
.UNINDENT
.SS WriteBasicConfigVersionFile
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
WRITE_BASIC_CONFIG_VERSION_FILE( filename
[VERSION major.minor.patch]
COMPATIBILITY (AnyNewerVersion|SameMajorVersion)
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Deprecated, see WRITE_BASIC_PACKAGE_VERSION_FILE(), it is identical.
.SS WriteCompilerDetectionHeader
.sp
This module provides the function write_compiler_detection_header().
.sp
The \fBWRITE_COMPILER_DETECTION_HEADER\fP function can be used to generate
a file suitable for preprocessor inclusion which contains macros to be
used in source code:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
write_compiler_detection_header(
FILE <file>
PREFIX <prefix>
[OUTPUT_FILES_VAR <output_files_var> OUTPUT_DIR <output_dir>]
COMPILERS <compiler> [...]
FEATURES <feature> [...]
[VERSION <version>]
[PROLOG <prolog>]
[EPILOG <epilog>]
[ALLOW_UNKNOWN_COMPILERS]
[ALLOW_UNKNOWN_COMPILER_VERSIONS]
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBwrite_compiler_detection_header\fP function generates the
file \fB<file>\fP with macros which all have the prefix \fB<prefix>\fP\&.
.sp
By default, all content is written directly to the \fB<file>\fP\&. The
\fBOUTPUT_FILES_VAR\fP may be specified to cause the compiler\-specific
content to be written to separate files. The separate files are then
available in the \fB<output_files_var>\fP and may be consumed by the caller
for installation for example. The \fBOUTPUT_DIR\fP specifies a relative
path from the main \fB<file>\fP to the compiler\-specific files. For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
write_compiler_detection_header(
FILE climbingstats_compiler_detection.h
PREFIX ClimbingStats
OUTPUT_FILES_VAR support_files
OUTPUT_DIR compilers
COMPILERS GNU Clang MSVC Intel
FEATURES cxx_variadic_templates
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/climbingstats_compiler_detection.h
DESTINATION include
)
install(FILES
${support_files}
DESTINATION include/compilers
)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBVERSION\fP may be used to specify the API version to be generated.
Future versions of CMake may introduce alternative APIs. A given
API is selected by any \fB<version>\fP value greater than or equal
to the version of CMake that introduced the given API and less
than the version of CMake that introduced its succeeding API.
The value of the \fBCMAKE_MINIMUM_REQUIRED_VERSION\fP
variable is used if no explicit version is specified.
(As of CMake version 3.8.2 there is only one API version.)
.sp
\fBPROLOG\fP may be specified as text content to write at the start of the
header. \fBEPILOG\fP may be specified as text content to write at the end
of the header
.sp
At least one \fB<compiler>\fP and one \fB<feature>\fP must be listed. Compilers
which are known to CMake, but not specified are detected and a preprocessor
\fB#error\fP is generated for them. A preprocessor macro matching
\fB<PREFIX>_COMPILER_IS_<compiler>\fP is generated for each compiler
known to CMake to contain the value \fB0\fP or \fB1\fP\&.
.sp
Possible compiler identifiers are documented with the
\fBCMAKE_<LANG>_COMPILER_ID\fP variable.
Available features in this version of CMake are listed in the
\fBCMAKE_C_KNOWN_FEATURES\fP and
\fBCMAKE_CXX_KNOWN_FEATURES\fP global properties.
The \fB{c,cxx}_std_*\fP meta\-features are ignored if requested.
.sp
See the \fBcmake\-compile\-features(7)\fP manual for information on
compile features.
.sp
\fBALLOW_UNKNOWN_COMPILERS\fP and \fBALLOW_UNKNOWN_COMPILER_VERSIONS\fP cause
the module to generate conditions that treat unknown compilers as simply
lacking all features. Without these options the default behavior is to
generate a \fB#error\fP for unknown compilers.
.SS Feature Test Macros
.sp
For each compiler, a preprocessor macro is generated matching
\fB<PREFIX>_COMPILER_IS_<compiler>\fP which has the content either \fB0\fP
or \fB1\fP, depending on the compiler in use. Preprocessor macros for
compiler version components are generated matching
\fB<PREFIX>_COMPILER_VERSION_MAJOR\fP \fB<PREFIX>_COMPILER_VERSION_MINOR\fP
and \fB<PREFIX>_COMPILER_VERSION_PATCH\fP containing decimal values
for the corresponding compiler version components, if defined.
.sp
A preprocessor test is generated based on the compiler version
denoting whether each feature is enabled. A preprocessor macro
matching \fB<PREFIX>_COMPILER_<FEATURE>\fP, where \fB<FEATURE>\fP is the
upper\-case \fB<feature>\fP name, is generated to contain the value
\fB0\fP or \fB1\fP depending on whether the compiler in use supports the
feature:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
write_compiler_detection_header(
FILE climbingstats_compiler_detection.h
PREFIX ClimbingStats
COMPILERS GNU Clang AppleClang MSVC Intel
FEATURES cxx_variadic_templates
)
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#if ClimbingStats_COMPILER_CXX_VARIADIC_TEMPLATES
template<typename... T>
void someInterface(T t...) { /* ... */ }
#else
// Compatibility versions
template<typename T1>
void someInterface(T1 t1) { /* ... */ }
template<typename T1, typename T2>
void someInterface(T1 t1, T2 t2) { /* ... */ }
template<typename T1, typename T2, typename T3>
void someInterface(T1 t1, T2 t2, T3 t3) { /* ... */ }
#endif
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Symbol Macros
.sp
Some additional symbol\-defines are created for particular features for
use as symbols which may be conditionally defined empty:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
class MyClass ClimbingStats_FINAL
{
ClimbingStats_CONSTEXPR int someInterface() { return 42; }
};
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBClimbingStats_FINAL\fP macro will expand to \fBfinal\fP if the
compiler (and its flags) support the \fBcxx_final\fP feature, and the
\fBClimbingStats_CONSTEXPR\fP macro will expand to \fBconstexpr\fP
if \fBcxx_constexpr\fP is supported.
.sp
The following features generate corresponding symbol defines:
.TS
center;
|l|l|l|.
_
T{
Feature
T} T{
Define
T} T{
Symbol
T}
_
T{
\fBc_restrict\fP
T} T{
\fB<PREFIX>_RESTRICT\fP
T} T{
\fBrestrict\fP
T}
_
T{
\fBcxx_constexpr\fP
T} T{
\fB<PREFIX>_CONSTEXPR\fP
T} T{
\fBconstexpr\fP
T}
_
T{
\fBcxx_deleted_functions\fP
T} T{
\fB<PREFIX>_DELETED_FUNCTION\fP
T} T{
\fB= delete\fP
T}
_
T{
\fBcxx_extern_templates\fP
T} T{
\fB<PREFIX>_EXTERN_TEMPLATE\fP
T} T{
\fBextern\fP
T}
_
T{
\fBcxx_final\fP
T} T{
\fB<PREFIX>_FINAL\fP
T} T{
\fBfinal\fP
T}
_
T{
\fBcxx_noexcept\fP
T} T{
\fB<PREFIX>_NOEXCEPT\fP
T} T{
\fBnoexcept\fP
T}
_
T{
\fBcxx_noexcept\fP
T} T{
\fB<PREFIX>_NOEXCEPT_EXPR(X)\fP
T} T{
\fBnoexcept(X)\fP
T}
_
T{
\fBcxx_override\fP
T} T{
\fB<PREFIX>_OVERRIDE\fP
T} T{
\fBoverride\fP
T}
_
.TE
.SS Compatibility Implementation Macros
.sp
Some features are suitable for wrapping in a macro with a backward
compatibility implementation if the compiler does not support the feature.
.sp
When the \fBcxx_static_assert\fP feature is not provided by the compiler,
a compatibility implementation is available via the
\fB<PREFIX>_STATIC_ASSERT(COND)\fP and
\fB<PREFIX>_STATIC_ASSERT_MSG(COND, MSG)\fP function\-like macros. The macros
expand to \fBstatic_assert\fP where that compiler feature is available, and
to a compatibility implementation otherwise. In the first form, the
condition is stringified in the message field of \fBstatic_assert\fP\&. In
the second form, the message \fBMSG\fP is passed to the message field of
\fBstatic_assert\fP, or ignored if using the backward compatibility
implementation.
.sp
The \fBcxx_attribute_deprecated\fP feature provides a macro definition
\fB<PREFIX>_DEPRECATED\fP, which expands to either the standard
\fB[[deprecated]]\fP attribute or a compiler\-specific decorator such
as \fB__attribute__((__deprecated__))\fP used by GNU compilers.
.sp
The \fBcxx_alignas\fP feature provides a macro definition
\fB<PREFIX>_ALIGNAS\fP which expands to either the standard \fBalignas\fP
decorator or a compiler\-specific decorator such as
\fB__attribute__ ((__aligned__))\fP used by GNU compilers.
.sp
The \fBcxx_alignof\fP feature provides a macro definition
\fB<PREFIX>_ALIGNOF\fP which expands to either the standard \fBalignof\fP
decorator or a compiler\-specific decorator such as \fB__alignof__\fP
used by GNU compilers.
.TS
center;
|l|l|l|.
_
T{
Feature
T} T{
Define
T} T{
Symbol
T}
_
T{
\fBcxx_alignas\fP
T} T{
\fB<PREFIX>_ALIGNAS\fP
T} T{
\fBalignas\fP
T}
_
T{
\fBcxx_alignof\fP
T} T{
\fB<PREFIX>_ALIGNOF\fP
T} T{
\fBalignof\fP
T}
_
T{
\fBcxx_nullptr\fP
T} T{
\fB<PREFIX>_NULLPTR\fP
T} T{
\fBnullptr\fP
T}
_
T{
\fBcxx_static_assert\fP
T} T{
\fB<PREFIX>_STATIC_ASSERT\fP
T} T{
\fBstatic_assert\fP
T}
_
T{
\fBcxx_static_assert\fP
T} T{
\fB<PREFIX>_STATIC_ASSERT_MSG\fP
T} T{
\fBstatic_assert\fP
T}
_
T{
\fBcxx_attribute_deprecated\fP
T} T{
\fB<PREFIX>_DEPRECATED\fP
T} T{
\fB[[deprecated]]\fP
T}
_
T{
\fBcxx_attribute_deprecated\fP
T} T{
\fB<PREFIX>_DEPRECATED_MSG\fP
T} T{
\fB[[deprecated]]\fP
T}
_
T{
\fBcxx_thread_local\fP
T} T{
\fB<PREFIX>_THREAD_LOCAL\fP
T} T{
\fBthread_local\fP
T}
_
.TE
.sp
A use\-case which arises with such deprecation macros is the deprecation
of an entire library. In that case, all public API in the library may
be decorated with the \fB<PREFIX>_DEPRECATED\fP macro. This results in
very noisy build output when building the library itself, so the macro
may be may be defined to empty in that case when building the deprecated
library:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
add_library(compat_support ${srcs})
target_compile_definitions(compat_support
PRIVATE
CompatSupport_DEPRECATED=
)
.ft P
.fi
.UNINDENT
.UNINDENT
.SH COPYRIGHT
2000-2017 Kitware, Inc. and Contributors
.\" Generated by docutils manpage writer.
.