code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CPackIFW — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CPackIFWConfigureFile" href="CPackIFWConfigureFile.html" />
    <link rel="prev" title="CPackComponent" href="CPackComponent.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackIFW

CPackIFW¶

New in version 3.1.

This module looks for the location of the command-line utilities supplied with the
Qt Installer Framework
(QtIFW).

The module also defines several commands to control the behavior of the
CPack IFW Generator.

Commands¶

The module defines the following commands:

cpack_ifw_configure_component¶

Sets the arguments specific to the CPack IFW generator.

cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL] [VIRTUAL]
                    [FORCED_INSTALLATION] [REQUIRES_ADMIN_RIGHTS]
                    [NAME <name>]
                    [DISPLAY_NAME <display_name>] # Note: Internationalization supported
                    [DESCRIPTION <description>] # Note: Internationalization supported
                    [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> ...]
                    [REPLACES <comp_id> ...]
                    [CHECKABLE <value>])

This command should be called after cpack_add_component() command.

COMMON

if set, then the component will be packaged and installed as part
of a group to which it belongs.

ESSENTIAL

New in version 3.6.

if set, then the package manager stays disabled until that
component is updated.

VIRTUAL

New in version 3.8.

if set, then the component will be hidden from the installer.
It is a equivalent of the HIDDEN option from the
cpack_add_component() command.

FORCED_INSTALLATION

New in version 3.8.

if set, then the component must always be installed.
It is a equivalent of the REQUIRED option from the
cpack_add_component() command.

REQUIRES_ADMIN_RIGHTS

New in version 3.8.

set it if the component needs to be installed with elevated permissions.

NAME

is used to create domain-like identification for this component.
By default used origin component name.

DISPLAY_NAME

New in version 3.8.

set to rewrite original name configured by
cpack_add_component() command.

DESCRIPTION

New in version 3.8.

set to rewrite original description configured by
cpack_add_component() command.

UPDATE_TEXT

New in version 3.8.

will be added to the component description if this is an update to
the component.

VERSION

is version of component.
By default used CPACK_PACKAGE_VERSION.

RELEASE_DATE

New in version 3.8.

keep empty to auto generate.

SCRIPT

is a relative or absolute path to operations script
for this component.

SORTING_PRIORITY

New in version 3.8.

is priority of the component in the tree.

PRIORITY

Deprecated since version 3.8: Old name for SORTING_PRIORITY.

DEPENDS, DEPENDENCIES

New in version 3.8.

list of dependency component or component group identifiers in
QtIFW style.

New in version 3.21.

Component or group names listed as dependencies may contain hyphens.
This requires QtIFW 3.1 or later.

AUTO_DEPEND_ON

New in version 3.8.

list of identifiers of component or component group in QtIFW style
that this component has an automatic dependency on.

LICENSES

pair of <display_name> and <file_path> of license text for this
component. You can specify more then one license.

DEFAULT

New in version 3.8.

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't forget add the file of the script
as a value of the SCRIPT option).

USER_INTERFACES

New in version 3.7.

is a list of <file_path> ('.ui' files) representing pages to load.

TRANSLATIONS

New in version 3.8.

is a list of <file_path> ('.qm' files) representing translations to load.

REPLACES

New in version 3.10.

list of identifiers of component or component group to replace.

CHECKABLE

New in version 3.10.

Possible values are: TRUE, FALSE.
Set to FALSE if you want to hide the checkbox for an item.
This is useful when only a few subcomponents should be selected
instead of all.

cpack_ifw_configure_component_group¶

Sets the arguments specific to the CPack IFW generator.

cpack_ifw_configure_component_group(<groupname> [VIRTUAL]
                    [FORCED_INSTALLATION] [REQUIRES_ADMIN_RIGHTS]
                    [NAME <name>]
                    [DISPLAY_NAME <display_name>] # Note: Internationalization supported
                    [DESCRIPTION <description>] # Note: Internationalization supported
                    [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> ...]
                    [REPLACES <comp_id> ...]
                    [CHECKABLE <value>])

This command should be called after cpack_add_component_group()
command.

VIRTUAL

New in version 3.8.

if set, then the group will be hidden from the installer.
Note that setting this on a root component does not work.

FORCED_INSTALLATION

New in version 3.8.

if set, then the group must always be installed.

REQUIRES_ADMIN_RIGHTS

New in version 3.8.

set it if the component group needs to be installed with elevated
permissions.

NAME

is used to create domain-like identification for this component group.
By default used origin component group name.

DISPLAY_NAME

New in version 3.8.

set to rewrite original name configured by
cpack_add_component_group() command.

DESCRIPTION

New in version 3.8.

set to rewrite original description configured by
cpack_add_component_group() command.

UPDATE_TEXT

New in version 3.8.

will be added to the component group description if this is an update to
the component group.

VERSION

is version of component group.
By default used CPACK_PACKAGE_VERSION.

RELEASE_DATE

New in version 3.8.

keep empty to auto generate.

SCRIPT

is a relative or absolute path to operations script
for this component group.

SORTING_PRIORITY

is priority of the component group in the tree.

PRIORITY

Deprecated since version 3.8: Old name for SORTING_PRIORITY.

DEPENDS, DEPENDENCIES

New in version 3.8.

list of dependency component or component group identifiers in
QtIFW style.

New in version 3.21.

Component or group names listed as dependencies may contain hyphens.
This requires QtIFW 3.1 or later.

AUTO_DEPEND_ON

New in version 3.8.

list of identifiers of component or component group in QtIFW style
that this component group has an automatic dependency on.

LICENSES

pair of <display_name> and <file_path> of license text for this
component group. You can specify more then one license.

DEFAULT

New in version 3.8.

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't forget add the file of
the script as a value of the SCRIPT option).

USER_INTERFACES

New in version 3.7.

is a list of <file_path> ('.ui' files) representing pages to load.

TRANSLATIONS

New in version 3.8.

is a list of <file_path> ('.qm' files) representing translations to load.

REPLACES

New in version 3.10.

list of identifiers of component or component group to replace.

CHECKABLE

New in version 3.10.

Possible values are: TRUE, FALSE.
Set to FALSE if you want to hide the checkbox for an item.
This is useful when only a few subcomponents should be selected
instead of all.

cpack_ifw_add_repository¶

Add QtIFW specific remote repository to binary installer.

cpack_ifw_add_repository(<reponame> [DISABLED]
                    URL <url>
                    [USERNAME <username>]
                    [PASSWORD <password>]
                    [DISPLAY_NAME <display_name>])

This command will also add the <reponame> repository
to a variable CPACK_IFW_REPOSITORIES_ALL.

DISABLED

if set, then the repository will be disabled by default.

URL

is points to a list of available components.

USERNAME

is used as user on a protected repository.

PASSWORD

is password to use on a protected repository.

DISPLAY_NAME

is string to display instead of the URL.

cpack_ifw_update_repository¶

New in version 3.6.

Update QtIFW specific repository from remote repository.

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>])

This command will also add the <reponame> repository
to a variable CPACK_IFW_REPOSITORIES_ALL.

URL

is points to a list of available components.

OLD_URL

is points to a list that will replaced.

NEW_URL

is points to a list that will replace to.

USERNAME

is used as user on a protected repository.

PASSWORD

is password to use on a protected repository.

DISPLAY_NAME

is string to display instead of the URL.

cpack_ifw_add_package_resources¶

New in version 3.7.

Add additional resources in the installer binary.

cpack_ifw_add_package_resources(<file_path> <file_path> ...)

This command will also add the specified files
to a variable CPACK_IFW_PACKAGE_RESOURCES.

Table of Contents

CPackIFW

Commands

Previous topic

CPackComponent

Next topic

CPackIFWConfigureFile

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackIFW

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CPackIFWConfigureFile — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CSharpUtilities" href="CSharpUtilities.html" />
    <link rel="prev" title="CPackIFW" href="CPackIFW.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackIFWConfigureFile

CPackIFWConfigureFile¶

New in version 3.8.

The module defines configure_file() similar command to
configure file templates prepared in QtIFW/SDK/Creator style.

Commands¶

The module defines the following commands:

cpack_ifw_configure_file¶

Copy a file to another location and modify its contents.

cpack_ifw_configure_file(<input> <output>)

Copies an <input> file to an <output> file and substitutes variable
values referenced as %{VAR} or %VAR% 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.

Table of Contents

CPackIFWConfigureFile

Commands

Previous topic

CPackIFW

Next topic

CSharpUtilities

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackIFWConfigureFile

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

repo_name: lazytadpole/codenamesilverfish

license: mit


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CPackNSIS — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CPackNuGet" href="CPackNuGet.html" />
    <link rel="prev" title="CPackFreeBSD" href="CPackFreeBSD.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackNSIS

CPackNSIS¶

The documentation for the CPack NSIS generator has moved here: CPack NSIS Generator

Previous topic

CPackFreeBSD

Next topic

CPackNuGet

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackNSIS

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CPackNuGet — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CPackProductBuild" href="CPackProductBuild.html" />
    <link rel="prev" title="CPackNSIS" href="CPackNSIS.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackNuGet

CPackNuGet¶

New in version 3.12.

The documentation for the CPack NuGet generator has moved here: CPack NuGet Generator

Previous topic

CPackNSIS

Next topic

CPackProductBuild

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackNuGet

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CPackProductBuild — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CPackRPM" href="CPackRPM.html" />
    <link rel="prev" title="CPackNuGet" href="CPackNuGet.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackProductBuild

CPackProductBuild¶

New in version 3.7.

The documentation for the CPack productbuild generator has moved here: CPack productbuild Generator

Previous topic

CPackNuGet

Next topic

CPackRPM

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackProductBuild

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CPackRPM — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CPackWIX" href="CPackWIX.html" />
    <link rel="prev" title="CPackProductBuild" href="CPackProductBuild.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackRPM

CPackRPM¶

The documentation for the CPack RPM generator has moved here: CPack RPM Generator

Previous topic

CPackProductBuild

Next topic

CPackWIX

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackRPM

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CPackWIX — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="cmake-packages(7)" href="../manual/cmake-packages.7.html" />
    <link rel="prev" title="CPackRPM" href="CPackRPM.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackWIX

CPackWIX¶

The documentation for the CPack WIX generator has moved here:
CPack WIX Generator

Previous topic

CPackRPM

Next topic

cmake-packages(7)

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CPackWIX

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CSharpUtilities — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CTest" href="CTest.html" />
    <link rel="prev" title="CPackIFWConfigureFile" href="CPackIFWConfigureFile.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CSharpUtilities

CSharpUtilities¶

New in version 3.8.

Functions to make configuration of CSharp/.NET targets easier.

A collection of CMake utility functions useful for dealing with CSharp
targets for Visual Studio generators from version 2010 and later.

The following functions are provided by this module:

Main functions

csharp_set_windows_forms_properties()

csharp_set_designer_cs_properties()

csharp_set_xaml_cs_properties()

Helper functions

csharp_get_filename_keys()

csharp_get_filename_key_base()

csharp_get_dependentupon_name()

Main functions provided by the module¶

csharp_set_windows_forms_properties¶

Sets source file properties for use of Windows Forms. Use this, if your CSharp
target uses Windows Forms:

csharp_set_windows_forms_properties([<file1> [<file2> [...]]])

<fileN>

List of all source files which are relevant for setting the
VS_CSHARP_<tagname> properties (including .cs, .resx and
.Designer.cs extensions).

In the list of all given files for all files ending with .Designer.cs and
.resx is searched.  For every designer or resource file a file with the
same base name but only .cs as extension is searched.  If this is found, the
VS_CSHARP_<tagname> properties are set as follows:

for the .cs file:

VS_CSHARP_SubType "Form"

for the .Designer.cs file (if it exists):

VS_CSHARP_DependentUpon <cs-filename>

VS_CSHARP_DesignTime "" (delete tag if previously defined)

VS_CSHARP_AutoGen ""(delete tag if previously defined)

for the .resx file (if it exists):

VS_RESOURCE_GENERATOR "" (delete tag if previously defined)

VS_CSHARP_DependentUpon <cs-filename>

VS_CSHARP_SubType "Designer"

csharp_set_designer_cs_properties¶

Sets source file properties of .Designer.cs files depending on
sibling filenames. Use this, if your CSharp target does not
use Windows Forms (for Windows Forms use
csharp_set_windows_forms_properties() instead):

csharp_set_designer_cs_properties([<file1> [<file2> [...]]])

<fileN>

List of all source files which are relevant for setting the
VS_CSHARP_<tagname> properties (including .cs,
.resx, .settings and .Designer.cs extensions).

In the list of all given files for all files ending with
.Designer.cs is searched. For every designer file all files
with the same base name but different extensions are searched. If
a match is found, the source file properties of the designer file
are set depending on the extension of the matched file:

if match is .resx file:

VS_CSHARP_AutoGen "True"

VS_CSHARP_DesignTime "True"

VS_CSHARP_DependentUpon <resx-filename>

if match is .cs file:

VS_CSHARP_DependentUpon <cs-filename>

if match is .settings file:

VS_CSHARP_AutoGen "True"

VS_CSHARP_DesignTimeSharedInput "True"

VS_CSHARP_DependentUpon <settings-filename>

Note

Because the source file properties of the .Designer.cs file are set according
to the found matches and every match sets the VS_CSHARP_DependentUpon
property, there should only be one match for each Designer.cs file.

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:

csharp_set_xaml_cs_properties([<file1> [<file2> [...]]])

<fileN>

List of all source files which are relevant for setting the
VS_CSHARP_<tagname> properties (including .cs,
.xaml, and .xaml.cs extensions).

In the list of all given files for all files ending with
.xaml.cs is searched. For every xaml-cs file, a file
with the same base name but extension .xaml is searched.
If a match is found, the source file properties of the .xaml.cs
file are set:

VS_CSHARP_DependentUpon <xaml-filename>

Helper functions which are used by the above ones¶

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:

csharp_get_filename_keys(OUT [<file1> [<file2> [...]]])

OUT

Name of the variable in which the list of keys is stored

<fileN>

filename(s) as given to to CSharp target using add_library()
or add_executable()

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:

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.

csharp_get_filename_key_base¶

Returns the full filepath and name without 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:

csharp_get_filename_key_base(BASE KEY)

BASE

Name of the variable with the computed "base" of KEY.

KEY

The key of which the base will be computed. Expected to be a
upper case full filename.

csharp_get_dependentupon_name¶

Computes a string which can be used as value for the source file property
VS_CSHARP_<tagname> with target being DependentUpon:

csharp_get_dependentupon_name(NAME FILE)

NAME

Name of the variable with the result value

FILE

Filename to convert to <DependentUpon> value

Actually this is only the filename without any path given at the moment.

Table of Contents

CSharpUtilities

Main functions provided by the module

Helper functions which are used by the above ones

Previous topic

CPackIFWConfigureFile

Next topic

CTest

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CSharpUtilities

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CTest — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CTestCoverageCollectGCOV" href="CTestCoverageCollectGCOV.html" />
    <link rel="prev" title="CSharpUtilities" href="CSharpUtilities.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTest

CTest¶

Configure a project for testing with CTest/CDash

Include this module in the top CMakeLists.txt file of a project to
enable testing with CTest and dashboard submissions to CDash:

project(MyProject)
...
include(CTest)

The module automatically creates a BUILD_TESTING option that selects
whether to enable testing support (ON by default).  After including
the module, use code like:

if(BUILD_TESTING)
  # ... CMake code to create tests ...
endif()

to creating tests when testing is enabled.

To enable submissions to a CDash server, create a CTestConfig.cmake
file at the top of the project with content such as:

set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_SUBMIT_URL "http://my.cdash.org/submit.php?project=MyProject")

(the CDash server can provide the file to a project administrator who
configures MyProject).  Settings in the config file are shared by
both this CTest module and the ctest(1) command-line
Dashboard Client mode (ctest -S).

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 CTEST_USE_LAUNCHERS variable:

set(CTEST_USE_LAUNCHERS 1)

in the CTestConfig.cmake file.

Previous topic

CSharpUtilities

Next topic

CTestCoverageCollectGCOV

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTest

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CTestCoverageCollectGCOV — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CTestScriptMode" href="CTestScriptMode.html" />
    <link rel="prev" title="CTest" href="CTest.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTestCoverageCollectGCOV

CTestCoverageCollectGCOV¶

New in version 3.2.

This module provides the ctest_coverage_collect_gcov function.

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:

data.json defines the source and build directories for use by CDash.

Labels.json indicates any LABELS that have been set on the
source files.

The uncovered directory holds any uncovered files found by
CTEST_EXTRA_COVERAGE_GLOB.

After generating this tar file, it can be sent to CDash for display with the
ctest_submit(CDASH_UPLOAD) command.

ctest_coverage_collect_gcov¶

ctest_coverage_collect_gcov(TARBALL <tarfile>
  [SOURCE <source_dir>][BUILD <build_dir>]
  [GCOV_COMMAND <gcov_command>]
  [GCOV_OPTIONS <options>...]
  )

Run gcov and package a tar file for CDash.  The options are:

TARBALL <tarfile>

Specify the location of the .tar file to be created for later
upload to CDash.  Relative paths will be interpreted with respect
to the top-level build directory.

TARBALL_COMPRESSION <option>

New in version 3.18.

Specify a compression algorithm for the
TARBALL data file.  Using this option reduces the size of the data file
before it is submitted to CDash.  <option> must be one of GZIP,
BZIP2, XZ, ZSTD, FROM_EXT, or an expression that CMake
evaluates as FALSE. The default value is BZIP2.

If FROM_EXT is specified, the resulting file will be compressed based on
the file extension of the <tarfile> (i.e. .tar.gz will use GZIP
compression). File extensions that will produce compressed output include
.tar.gz, .tgz, .tar.bzip2, .tbz, .tar.xz, and .txz.

SOURCE <source_dir>

Specify the top-level source directory for the build.
Default is the value of CTEST_SOURCE_DIRECTORY.

BUILD <build_dir>

Specify the top-level build directory for the build.
Default is the value of CTEST_BINARY_DIRECTORY.

GCOV_COMMAND <gcov_command>

Specify the full path to the gcov command on the machine.
Default is the value of CTEST_COVERAGE_COMMAND.

GCOV_OPTIONS <options>...

Specify options to be passed to gcov.  The gcov command
is run as gcov <options>... -o <gcov-dir> <file>.gcda.
If not specified, the default option is just -b -x.

GLOB

New in version 3.6.

Recursively search for .gcda files in build_dir rather than
determining search locations by reading TargetDirectories.txt.

DELETE

New in version 3.6.

Delete coverage files after they've been packaged into the .tar.

QUIET

Suppress non-error messages that otherwise would have been
printed out by this function.

New in version 3.3: Added support for the CTEST_CUSTOM_COVERAGE_EXCLUDE variable.

Previous topic

CTest

Next topic

CTestScriptMode

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTestCoverageCollectGCOV

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CTestScriptMode — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CTestUseLaunchers" href="CTestUseLaunchers.html" />
    <link rel="prev" title="CTestCoverageCollectGCOV" href="CTestCoverageCollectGCOV.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTestScriptMode

CTestScriptMode¶

This file is read by ctest in script mode (-S)

Previous topic

CTestCoverageCollectGCOV

Next topic

CTestUseLaunchers

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTestScriptMode

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CTestUseLaunchers — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="DeployQt4" href="DeployQt4.html" />
    <link rel="prev" title="CTestScriptMode" href="CTestScriptMode.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTestUseLaunchers

CTestUseLaunchers¶

Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.

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.

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.

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.

New in version 3.8: 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.

Previous topic

CTestScriptMode

Next topic

DeployQt4

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CTestUseLaunchers

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCCompilerFlag — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckCompilerFlag" href="CheckCompilerFlag.html" />
    <link rel="prev" title="BundleUtilities" href="BundleUtilities.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCCompilerFlag

CheckCCompilerFlag¶

Check whether the C compiler supports a given flag.

check_c_compiler_flag¶

check_c_compiler_flag(<flag> <resultVar>)

Check that the <flag> is accepted by the compiler without
a diagnostic.  Stores the result in an internal cache entry
named <resultVar>.

A positive result from this check indicates only that the compiler did not
issue a diagnostic message when given the flag.  Whether the flag has any
effect or even a specific one is beyond the scope of this module.

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_c_compiler_flag()

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

BundleUtilities

Next topic

CheckCompilerFlag

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCCompilerFlag

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCSourceCompiles — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckCSourceRuns" href="CheckCSourceRuns.html" />
    <link rel="prev" title="CheckCompilerFlag" href="CheckCompilerFlag.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCSourceCompiles

CheckCSourceCompiles¶

Check if given C source compiles and links into an executable.

check_c_source_compiles¶

check_c_source_compiles(<code> <resultVar>
                        [FAIL_REGEX <regex1> [<regex2>...]])

Check that the source supplied in <code> can be compiled as a C source
file and linked as an executable (so it must contain at least a main()
function). The result will be stored in the internal cache variable specified
by <resultVar>, with a boolean true value for success and boolean false
for failure. If FAIL_REGEX is provided, then failure is determined by
checking if anything in the output matches any of the specified regular
expressions.

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_c_source_compiles():

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckCompilerFlag

Next topic

CheckCSourceRuns

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCSourceCompiles

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCSourceRuns — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckCXXCompilerFlag" href="CheckCXXCompilerFlag.html" />
    <link rel="prev" title="CheckCSourceCompiles" href="CheckCSourceCompiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCSourceRuns

CheckCSourceRuns¶

Check if given C source compiles and links into an executable and can
subsequently be run.

check_c_source_runs¶

check_c_source_runs(<code> <resultVar>)

Check that the source supplied in <code> can be compiled as a C source
file, linked as an executable and then run. The <code> must contain at
least a main() function. If the <code> could be built and run
successfully, the internal cache variable specified by <resultVar> will
be set to 1, otherwise it will be set to an value that evaluates to boolean
false (e.g. an empty string or an error message).

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_c_source_runs():

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckCSourceCompiles

Next topic

CheckCXXCompilerFlag

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCSourceRuns

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCXXCompilerFlag — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckCXXSourceCompiles" href="CheckCXXSourceCompiles.html" />
    <link rel="prev" title="CheckCSourceRuns" href="CheckCSourceRuns.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXCompilerFlag

CheckCXXCompilerFlag¶

Check whether the CXX compiler supports a given flag.

check_cxx_compiler_flag¶

check_cxx_compiler_flag(<flag> <var>)

Check that the <flag> is accepted by the compiler without
a diagnostic.  Stores the result in an internal cache entry
named <var>.

A positive result from this check indicates only that the compiler did not
issue a diagnostic message when given the flag.  Whether the flag has any
effect or even a specific one is beyond the scope of this module.

Note

Since the try_compile() command forwards flags from variables
like CMAKE_CXX_FLAGS, unknown flags
in such variables may cause a false negative for this check.

Previous topic

CheckCSourceRuns

Next topic

CheckCXXSourceCompiles

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXCompilerFlag

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCXXSourceCompiles — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckCXXSourceRuns" href="CheckCXXSourceRuns.html" />
    <link rel="prev" title="CheckCXXCompilerFlag" href="CheckCXXCompilerFlag.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXSourceCompiles

CheckCXXSourceCompiles¶

Check if given C++ source compiles and links into an executable.

check_cxx_source_compiles¶

check_cxx_source_compiles(<code> <resultVar>
                          [FAIL_REGEX <regex1> [<regex2>...]])

Check that the source supplied in <code> can be compiled as a C++ source
file and linked as an executable (so it must contain at least a main()
function). The result will be stored in the internal cache variable specified
by <resultVar>, with a boolean true value for success and boolean false
for failure. If FAIL_REGEX is provided, then failure is determined by
checking if anything in the output matches any of the specified regular
expressions.

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_cxx_source_compiles():

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckCXXCompilerFlag

Next topic

CheckCXXSourceRuns

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXSourceCompiles

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCXXSourceRuns — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckCXXSymbolExists" href="CheckCXXSymbolExists.html" />
    <link rel="prev" title="CheckCXXSourceCompiles" href="CheckCXXSourceCompiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXSourceRuns

CheckCXXSourceRuns¶

Check if given C++ source compiles and links into an executable and can
subsequently be run.

check_cxx_source_runs¶

check_cxx_source_runs(<code> <resultVar>)

Check that the source supplied in <code> can be compiled as a C++ source
file, linked as an executable and then run. The <code> must contain at
least a main() function. If the <code> could be built and run
successfully, the internal cache variable specified by <resultVar> will
be set to 1, otherwise it will be set to an value that evaluates to boolean
false (e.g. an empty string or an error message).

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_cxx_source_runs():

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckCXXSourceCompiles

Next topic

CheckCXXSymbolExists

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXSourceRuns

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCXXSymbolExists — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckFortranCompilerFlag" href="CheckFortranCompilerFlag.html" />
    <link rel="prev" title="CheckCXXSourceRuns" href="CheckCXXSourceRuns.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXSymbolExists

CheckCXXSymbolExists¶

Check if a symbol exists as a function, variable, or macro in C++.

check_cxx_symbol_exists¶

check_cxx_symbol_exists(<symbol> <files> <variable>)

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 for symbols as seen by
the C++ compiler, as opposed to check_symbol_exists(), which always
uses the C compiler.

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, enum value, or C++ template it will
not be recognized: consider using the CheckTypeSize
or CheckSourceCompiles module instead.

Note

This command is unreliable when <symbol> is (potentially) an overloaded
function. Since there is no reliable way to predict whether a given function
in the system environment may be defined as an overloaded function or may be
an overloaded function on other systems or will become so in the future, it
is generally advised to use the CheckSourceCompiles module for
checking any function symbol (unless somehow you surely know the checked
function is not overloaded on other systems or will not be so in the
future).

The following variables may be set before calling this macro to modify
the way the check is run:

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

For example:

include(CheckCXXSymbolExists)

# Check for macro SEEK_SET
check_cxx_symbol_exists(SEEK_SET "cstdio" HAVE_SEEK_SET)
# Check for function std::fopen
check_cxx_symbol_exists(std::fopen "cstdio" HAVE_STD_FOPEN)

Previous topic

CheckCXXSourceRuns

Next topic

CheckFortranCompilerFlag

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCXXSymbolExists

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckCompilerFlag — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckCSourceCompiles" href="CheckCSourceCompiles.html" />
    <link rel="prev" title="CheckCCompilerFlag" href="CheckCCompilerFlag.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCompilerFlag

CheckCompilerFlag¶

New in version 3.19.

Check whether the compiler supports a given flag.

check_compiler_flag¶

check_compiler_flag(<lang> <flag> <resultVar>)

Check that the <flag> is accepted by the compiler without a diagnostic.
Stores the result in an internal cache entry named <resultVar>.

A positive result from this check indicates only that the compiler did not
issue a diagnostic message when given the flag.  Whether the flag has any
effect or even a specific one is beyond the scope of this module.

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_compiler_flag()

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckCCompilerFlag

Next topic

CheckCSourceCompiles

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckCompilerFlag

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckFortranCompilerFlag — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckFortranFunctionExists" href="CheckFortranFunctionExists.html" />
    <link rel="prev" title="CheckCXXSymbolExists" href="CheckCXXSymbolExists.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranCompilerFlag

CheckFortranCompilerFlag¶

New in version 3.3.

Check whether the Fortran compiler supports a given flag.

check_fortran_compiler_flag¶

check_fortran_compiler_flag(<flag> <resultVar>)

Check that the <flag> is accepted by the compiler without
a diagnostic.  Stores the result in an internal cache entry
named <resultVar>.

A positive result from this check indicates only that the compiler did not
issue a diagnostic message when given the flag.  Whether the flag has any
effect or even a specific one is beyond the scope of this module.

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_fortran_compiler_flag()

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckCXXSymbolExists

Next topic

CheckFortranFunctionExists

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranCompilerFlag

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckFortranFunctionExists — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckFortranSourceCompiles" href="CheckFortranSourceCompiles.html" />
    <link rel="prev" title="CheckFortranCompilerFlag" href="CheckFortranCompilerFlag.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranFunctionExists

CheckFortranFunctionExists¶

Check if a Fortran function exists.

CHECK_FORTRAN_FUNCTION_EXISTS¶

CHECK_FORTRAN_FUNCTION_EXISTS(<function> <result>)

where

<function>

the name of the Fortran function

<result>

variable to store the result; will be created as an internal cache variable.

Note

This command does not detect functions in Fortran modules. In general it is
recommended to use CheckSourceCompiles instead to determine if a
Fortran function or subroutine is available.

The following variables may be set before calling this macro to modify
the way the check is run:

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14: A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

Previous topic

CheckFortranCompilerFlag

Next topic

CheckFortranSourceCompiles

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranFunctionExists

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckFortranSourceCompiles — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckFortranSourceRuns" href="CheckFortranSourceRuns.html" />
    <link rel="prev" title="CheckFortranFunctionExists" href="CheckFortranFunctionExists.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranSourceCompiles

CheckFortranSourceCompiles¶

New in version 3.1.

Check if given Fortran source compiles and links into an executable.

check_fortran_source_compiles¶

check_fortran_source_compiles(<code> <resultVar>
    [FAIL_REGEX <regex>...]
    [SRC_EXT <extension>]
)

Checks that the source supplied in <code> can be compiled as a Fortran
source file and linked as an executable. The <code> must be a Fortran
program.

check_fortran_source_compiles("program test
error stop
end program"
HAVE_ERROR_STOP
SRC_EXT .F90)

This command can help avoid costly build processes when a compiler lacks support
for a necessary feature, or a particular vendor library is not compatible with
the Fortran compiler version being used. This generate-time check may advise the
user of such before the main build process. See also the
check_fortran_source_runs() command to run the compiled code.

The result will be stored in the internal cache
variable <resultVar>, with a boolean true value for success and boolean
false for failure.

If FAIL_REGEX is provided, then failure is determined by checking
if anything in the output matches any of the specified regular expressions.

By default, the test source file will be given a .F file extension. The
SRC_EXT option can be used to override this with .<extension> instead--
.F90 is a typical choice.

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_fortran_source_compiles():

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckFortranFunctionExists

Next topic

CheckFortranSourceRuns

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranSourceCompiles

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckFortranSourceRuns — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckFunctionExists" href="CheckFunctionExists.html" />
    <link rel="prev" title="CheckFortranSourceCompiles" href="CheckFortranSourceCompiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranSourceRuns

CheckFortranSourceRuns¶

New in version 3.14.

Check if given Fortran source compiles and links into an executable and can
subsequently be run.

check_fortran_source_runs¶

check_fortran_source_runs(<code> <resultVar>
    [SRC_EXT <extension>])

Check that the source supplied in <code> can be compiled as a Fortran source
file, linked as an executable and then run. The <code> must be a Fortran
program.

check_fortran_source_runs("program test
real :: x[*]
call co_sum(x)
end program"
HAVE_COARRAY)

This command can help avoid costly build processes when a compiler lacks support
for a necessary feature, or a particular vendor library is not compatible with
the Fortran compiler version being used. Some of these failures only occur at runtime
instead of linktime, and a trivial runtime example can catch the issue before the
main build process.

If the <code> could be built and run
successfully, the internal cache variable specified by <resultVar> will
be set to 1, otherwise it will be set to an value that evaluates to boolean
false (e.g. an empty string or an error message).

By default, the test source file will be given a .F90 file extension. The
SRC_EXT option can be used to override this with .<extension> instead.

The check is only performed once, with the result cached in the variable named
by <resultVar>. Every subsequent CMake run will reuse this cached value
rather than performing the check again, even if the <code> changes. In
order to force the check to be re-evaluated, the variable named by
<resultVar> must be manually removed from the cache.

The compile and link commands can be influenced by setting any of the
following variables prior to calling check_fortran_source_runs():

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Previous topic

CheckFortranSourceCompiles

Next topic

CheckFunctionExists

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFortranSourceRuns

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckFunctionExists — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckIncludeFileCXX" href="CheckIncludeFileCXX.html" />
    <link rel="prev" title="CheckFortranSourceRuns" href="CheckFortranSourceRuns.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFunctionExists

CheckFunctionExists¶

Check if a C function can be linked

check_function_exists¶

check_function_exists(<function> <variable>)

Checks that the <function> is provided by libraries on the system and store
the result in a <variable>, which will be created as an internal
cache variable.

The following variables may be set before calling this macro to modify the
way the check is run:

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

Note

Prefer using CheckSymbolExists instead of this module,
for the following reasons:

check_function_exists() can't detect functions that are inlined
in headers or specified as a macro.

check_function_exists() can't detect anything in the 32-bit
versions of the Win32 API, because of a mismatch in calling conventions.

check_function_exists() only verifies linking, it does not verify
that the function is declared in system headers.

Previous topic

CheckFortranSourceRuns

Next topic

CheckIncludeFileCXX

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckFunctionExists

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckIPOSupported — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckLanguage" href="CheckLanguage.html" />
    <link rel="prev" title="CheckIncludeFiles" href="CheckIncludeFiles.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckIPOSupported

CheckIPOSupported¶

New in version 3.9.

Check whether the compiler supports an interprocedural optimization (IPO/LTO).
Use this before enabling the INTERPROCEDURAL_OPTIMIZATION target
property.

check_ipo_supported¶

check_ipo_supported([RESULT <result>] [OUTPUT <output>]
                    [LANGUAGES <lang>...])

Options are:

RESULT <result>

Set <result> variable to YES if IPO is supported by the
compiler and NO otherwise.  If this option is not given then
the command will issue a fatal error if IPO is not supported.

OUTPUT <output>

Set <output> variable with details about any error.

LANGUAGES <lang>...

Specify languages whose compilers to check.
Languages C, CXX, and Fortran are supported.

It makes no sense to use this module when CMP0069 is set to OLD so
module will return error in this case. See policy CMP0069 for details.

New in version 3.13: Add support for Visual Studio generators.

New in version 3.24: The check uses the caller's CMAKE_<LANG>_FLAGS
and CMAKE_<LANG>_FLAGS_<CONFIG> values.
See policy CMP0138.

Examples¶

check_ipo_supported() # fatal error if IPO is not supported
set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)

# Optional IPO. Do not use IPO if it's not supported by compiler.
check_ipo_supported(RESULT result OUTPUT output)
if(result)
  set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
  message(WARNING "IPO is not supported: ${output}")
endif()

Table of Contents

CheckIPOSupported

Examples

Previous topic

CheckIncludeFiles

Next topic

CheckLanguage

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckIPOSupported

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckIncludeFile — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckIncludeFiles" href="CheckIncludeFiles.html" />
    <link rel="prev" title="CheckIncludeFileCXX" href="CheckIncludeFileCXX.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckIncludeFile

CheckIncludeFile¶

Provides a macro to check if a header file can be included in C.

CHECK_INCLUDE_FILE¶

CHECK_INCLUDE_FILE(<include> <variable> [<flags>])

Check if the given <include> file may be included in a C
source file and store the result in an internal cache entry named
<variable>.  The optional third argument may be used to add
compilation flags to the check (or use CMAKE_REQUIRED_FLAGS below).

The following variables may be set before calling this macro to modify
the way the check is run:

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

See the CheckIncludeFiles module to check for multiple headers
at once.  See the CheckIncludeFileCXX module to check for headers
using the CXX language.

Previous topic

CheckIncludeFileCXX

Next topic

CheckIncludeFiles

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckIncludeFile

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CheckIncludeFileCXX — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CheckIncludeFile" href="CheckIncludeFile.html" />
    <link rel="prev" title="CheckFunctionExists" href="CheckFunctionExists.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckIncludeFileCXX

CheckIncludeFileCXX¶

Provides a macro to check if a header file can be included in CXX.

CHECK_INCLUDE_FILE_CXX¶

CHECK_INCLUDE_FILE_CXX(<include> <variable> [<flags>])

Check if the given <include> file may be included in a CXX
source file and store the result in an internal cache entry named
<variable>.  The optional third argument may be used to add
compilation flags to the check (or use CMAKE_REQUIRED_FLAGS below).

The following variables may be set before calling this macro to modify
the way the check is run:

CMAKE_REQUIRED_FLAGS

String of additional flags to pass to the compiler. The string must be
space-delimited--a ;-list will not work.
The contents of CMAKE_<LANG>_FLAGS and
its associated configuration-specific variable are automatically added
to the compiler command before the contents of CMAKE_REQUIRED_FLAGS.

CMAKE_REQUIRED_DEFINITIONS

A ;-list of compiler definitions of the form
-DFOO or -DFOO=bar. A definition for the name specified by
<resultVar> will also be added automatically.

CMAKE_REQUIRED_INCLUDES

A ;-list of header search paths to pass to
the compiler. These will be the only header search paths used--the contents
of the INCLUDE_DIRECTORIES directory property will be ignored.

CMAKE_REQUIRED_LINK_OPTIONS

New in version 3.14.

A ;-list of options to add to the link
command (see try_compile() for further details).

CMAKE_REQUIRED_LIBRARIES

A ;-list of libraries to add to the link
command. These can be the name of system libraries or they can be
Imported Targets (see try_compile() for
further details).

CMAKE_REQUIRED_QUIET

New in version 3.1.

If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.

See modules CheckIncludeFile and CheckIncludeFiles
to check for one or more C headers.

Previous topic

CheckFunctionExists

Next topic

CheckIncludeFile

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-modules(7) »

CheckIncludeFileCXX

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.