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>CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES — 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_<LANG>_STANDARD_LIBRARIES" href="CMAKE_LANG_STANDARD_LIBRARIES.html" />
    <link rel="prev" title="CMAKE_<LANG>_STANDARD_DEFAULT" href="CMAKE_LANG_STANDARD_DEFAULT.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES

<span id="variable:CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES">
CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES¶

New in version 3.6.

Include directories to be used for every source file compiled with
the <LANG> compiler.  This is meant for specification of system
include directories needed by the language for the current platform.
The directories always appear at the end of the include path passed
to the compiler.

This variable should not be set by project code.  It is meant to be set by
CMake's platform information modules for the current toolchain, or by a
toolchain file when used with CMAKE_TOOLCHAIN_FILE.

See also CMAKE_<LANG>_STANDARD_LIBRARIES.

Previous topic

CMAKE_<LANG>_STANDARD_DEFAULT

Next topic

CMAKE_<LANG>_STANDARD_LIBRARIES

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-variables(7) »

CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES

        © 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>CMAKE_<LANG>_STANDARD_LIBRARIES — 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_<LANG>_STANDARD_REQUIRED" href="CMAKE_LANG_STANDARD_REQUIRED.html" />
    <link rel="prev" title="CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES" href="CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_<LANG>_STANDARD_LIBRARIES

<span id="variable:CMAKE_<LANG>_STANDARD_LIBRARIES">
CMAKE_<LANG>_STANDARD_LIBRARIES¶

New in version 3.6.

Libraries linked into every executable and shared library linked
for language <LANG>.  This is meant for specification of system
libraries needed by the language for the current platform.

This variable should not be set by project code.  It is meant to be set by
CMake's platform information modules for the current toolchain, or by a
toolchain file when used with CMAKE_TOOLCHAIN_FILE.

See also CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES.

Previous topic

CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES

Next topic

CMAKE_<LANG>_STANDARD_REQUIRED

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-variables(7) »

CMAKE_<LANG>_STANDARD_LIBRARIES

        © 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>CMAKE_<LANG>_STANDARD_REQUIRED — 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_OBJC_EXTENSIONS" href="CMAKE_OBJC_EXTENSIONS.html" />
    <link rel="prev" title="CMAKE_<LANG>_STANDARD_LIBRARIES" href="CMAKE_LANG_STANDARD_LIBRARIES.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_<LANG>_STANDARD_REQUIRED

<span id="variable:CMAKE_<LANG>_STANDARD_REQUIRED">
CMAKE_<LANG>_STANDARD_REQUIRED¶

The variations are:

CMAKE_C_STANDARD_REQUIRED

CMAKE_CXX_STANDARD_REQUIRED

CMAKE_CUDA_STANDARD_REQUIRED

CMAKE_HIP_STANDARD_REQUIRED

CMAKE_OBJC_STANDARD_REQUIRED

CMAKE_OBJCXX_STANDARD_REQUIRED

Default values for <LANG>_STANDARD_REQUIRED target properties if
set when a target is created.

For supported CMake versions see the respective pages.

See the cmake-compile-features(7) manual for information on
compile features and a list of supported compilers.

Previous topic

CMAKE_<LANG>_STANDARD_LIBRARIES

Next topic

CMAKE_OBJC_EXTENSIONS

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-variables(7) »

CMAKE_<LANG>_STANDARD_REQUIRED

        © 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>CMAKE_<LANG>_USING_LINKER_MODE — 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_<LANG>_USING_LINKER_<TYPE>" href="CMAKE_LANG_USING_LINKER_TYPE.html" />
    <link rel="prev" title="CMAKE_<LANG>_LINKER_LAUNCHER" href="CMAKE_LANG_LINKER_LAUNCHER.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_<LANG>_USING_LINKER_MODE

<span id="variable:CMAKE_<LANG>_USING_LINKER_MODE">
CMAKE_<LANG>_USING_LINKER_MODE¶

New in version 3.29.

This variable specify what is the type of data stored in variable

CMAKE_<LANG>_USING_LINKER_<TYPE>. There are two possible values:

FLAG

CMAKE_<LANG>_USING_LINKER_<TYPE> holds compiler flags. This is
the default.

TOOL

CMAKE_<LANG>_USING_LINKER_<TYPE> holds the path to the linker
tool.

Previous topic

CMAKE_<LANG>_LINKER_LAUNCHER

Next topic

CMAKE_<LANG>_USING_LINKER_<TYPE>

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-variables(7) »

CMAKE_<LANG>_USING_LINKER_MODE

        © 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>CMAKE_<LANG>_USING_LINKER_<TYPE> — 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_<LANG>_VISIBILITY_PRESET" href="CMAKE_LANG_VISIBILITY_PRESET.html" />
    <link rel="prev" title="CMAKE_<LANG>_USING_LINKER_MODE" href="CMAKE_LANG_USING_LINKER_MODE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_<LANG>_USING_LINKER_<TYPE>

<span id="variable:CMAKE_<LANG>_USING_LINKER_<TYPE>">
CMAKE_<LANG>_USING_LINKER_<TYPE>¶

New in version 3.29.

This variable defines how to specify the linker for the link step for the type
as specified by the variable CMAKE_LINKER_TYPE or the target
property LINKER_TYPE. It can hold compiler flags for the link step
or directly the linker tool. The type of data is given by the variable
CMAKE_<LANG>_USING_LINKER_MODE.

For example, to specify the LLVM linker for GNU compilers, we have:

set(CMAKE_C_USING_LINKER_LLD "-fuse-ld=lld")

Or on Windows platform, for Clang compilers simulating MSVC, we
have:

set(CMAKE_C_USING_LINKER_LLD "-fuse-ld=lld-link")

And for the MSVC compiler, linker is directly used, so we have:

set(CMAKE_C_USING_LINKER_LLD "/path/to/lld-link.exe")
set(CMAKE_C_USING_LINKER_MODE TOOL)

Previous topic

CMAKE_<LANG>_USING_LINKER_MODE

Next topic

CMAKE_<LANG>_VISIBILITY_PRESET

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-variables(7) »

CMAKE_<LANG>_USING_LINKER_<TYPE>

        © 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>CMAKE_<LANG>_VISIBILITY_PRESET — 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_LIBRARY_OUTPUT_DIRECTORY" href="CMAKE_LIBRARY_OUTPUT_DIRECTORY.html" />
    <link rel="prev" title="CMAKE_<LANG>_USING_LINKER_<TYPE>" href="CMAKE_LANG_USING_LINKER_TYPE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_<LANG>_VISIBILITY_PRESET

<span id="variable:CMAKE_<LANG>_VISIBILITY_PRESET">
CMAKE_<LANG>_VISIBILITY_PRESET¶

Default value for the <LANG>_VISIBILITY_PRESET target
property when a target is created.

Previous topic

CMAKE_<LANG>_USING_LINKER_<TYPE>

Next topic

CMAKE_LIBRARY_OUTPUT_DIRECTORY

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-variables(7) »

CMAKE_<LANG>_VISIBILITY_PRESET

        © 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>CMAKE_LIBRARY_ARCHITECTURE — 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_LIBRARY_ARCHITECTURE_REGEX" href="CMAKE_LIBRARY_ARCHITECTURE_REGEX.html" />
    <link rel="prev" title="CMAKE_HOST_WIN32" href="CMAKE_HOST_WIN32.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LIBRARY_ARCHITECTURE

CMAKE_LIBRARY_ARCHITECTURE¶

Target architecture library directory name, if detected.

This is the value of CMAKE_<LANG>_LIBRARY_ARCHITECTURE as detected
for one of the enabled languages.

Previous topic

CMAKE_HOST_WIN32

Next topic

CMAKE_LIBRARY_ARCHITECTURE_REGEX

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-variables(7) »

CMAKE_LIBRARY_ARCHITECTURE

        © 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>CMAKE_LIBRARY_ARCHITECTURE_REGEX — 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_OBJECT_PATH_MAX" href="CMAKE_OBJECT_PATH_MAX.html" />
    <link rel="prev" title="CMAKE_LIBRARY_ARCHITECTURE" href="CMAKE_LIBRARY_ARCHITECTURE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LIBRARY_ARCHITECTURE_REGEX

CMAKE_LIBRARY_ARCHITECTURE_REGEX¶

Regex matching possible target architecture library directory names.

This is used to detect CMAKE_<LANG>_LIBRARY_ARCHITECTURE from the
implicit linker search path by matching the <arch> name.

Previous topic

CMAKE_LIBRARY_ARCHITECTURE

Next topic

CMAKE_OBJECT_PATH_MAX

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-variables(7) »

CMAKE_LIBRARY_ARCHITECTURE_REGEX

        © 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>CMAKE_LIBRARY_OUTPUT_DIRECTORY — 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_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>" href="CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.html" />
    <link rel="prev" title="CMAKE_<LANG>_VISIBILITY_PRESET" href="CMAKE_LANG_VISIBILITY_PRESET.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LIBRARY_OUTPUT_DIRECTORY

CMAKE_LIBRARY_OUTPUT_DIRECTORY¶

Where to put all the LIBRARY
target files when built.

This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY
property on all the targets.  See that target property for additional
information.

Previous topic

CMAKE_<LANG>_VISIBILITY_PRESET

Next topic

CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>

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-variables(7) »

CMAKE_LIBRARY_OUTPUT_DIRECTORY

        © 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>CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> — 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_LIBRARY_PATH_FLAG" href="CMAKE_LIBRARY_PATH_FLAG.html" />
    <link rel="prev" title="CMAKE_LIBRARY_OUTPUT_DIRECTORY" href="CMAKE_LIBRARY_OUTPUT_DIRECTORY.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>

<span id="variable:CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>">
CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>¶

New in version 3.3.

Where to put all the LIBRARY
target files when built for a specific configuration.

This variable is used to initialize the
LIBRARY_OUTPUT_DIRECTORY_<CONFIG> property on all the targets.
See that target property for additional information.

Previous topic

CMAKE_LIBRARY_OUTPUT_DIRECTORY

Next topic

CMAKE_LIBRARY_PATH_FLAG

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-variables(7) »

CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>

        © 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>CMAKE_LIBRARY_PATH — 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_LINK_DIRECTORIES_BEFORE" href="CMAKE_LINK_DIRECTORIES_BEFORE.html" />
    <link rel="prev" title="CMAKE_KATE_MAKE_ARGUMENTS" href="CMAKE_KATE_MAKE_ARGUMENTS.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LIBRARY_PATH

CMAKE_LIBRARY_PATH¶

Semicolon-separated list of directories specifying a search path
for the find_library() command.  By default it is empty, it is
intended to be set by the project.

There is also an environment variable CMAKE_LIBRARY_PATH, which is used
as an additional list of search directories.

See also CMAKE_SYSTEM_LIBRARY_PATH and CMAKE_PREFIX_PATH.

Previous topic

CMAKE_KATE_MAKE_ARGUMENTS

Next topic

CMAKE_LINK_DIRECTORIES_BEFORE

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-variables(7) »

CMAKE_LIBRARY_PATH

        © 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>CMAKE_LIBRARY_PATH_FLAG — 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_LINK_DEF_FILE_FLAG" href="CMAKE_LINK_DEF_FILE_FLAG.html" />
    <link rel="prev" title="CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>" href="CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LIBRARY_PATH_FLAG

CMAKE_LIBRARY_PATH_FLAG¶

The flag to be used to add a library search path to a compiler.

The flag will be used to specify a library directory to the compiler.
On most compilers this is -L.

Previous topic

CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>

Next topic

CMAKE_LINK_DEF_FILE_FLAG

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-variables(7) »

CMAKE_LIBRARY_PATH_FLAG

        © 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>CMAKE_LINKER_TYPE — 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_MACOSX_BUNDLE" href="CMAKE_MACOSX_BUNDLE.html" />
    <link rel="prev" title="CMAKE_LINK_WHAT_YOU_USE_CHECK" href="CMAKE_LINK_WHAT_YOU_USE_CHECK.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINKER_TYPE

CMAKE_LINKER_TYPE¶

New in version 3.29.

Specify which linker will be used for the link step.

Note

It is assumed that the linker specified is fully compatible with the standard
one. CMake will not do any options translation.

This variable is used to initialize the LINKER_TYPE target
property when they are created by calls to add_library() or
add_executable() commands. It is meaningful only for targets having a
link step. If set, its value is also used by the try_compile()
command.

Linker types are case-sensitive and may only contain letters, numbers and
underscores. Linker types defined in all uppercase are reserved for CMake's own
built-in types. The pre-defined linker types are:

DEFAULT

This type corresponds to standard linking, essentially equivalent to
not specifying LINKER_TYPE target property.

SYSTEM

Use the standard linker delivered by the platform or the standard toolkit
(for example, SYSTEM imply Microsoft linker for all MSVC compatible
compilers). This type is supported for the following platforms/compilers:

Linux, for GNU, Clang, LLVMFlang and NVIDIA compilers.

All Apple variants for AppleClang, Clang and GNU compilers.

Windows, for MSVC, GNU, Clang and NVIDIA compilers.

LLD

Use the LLVM linker. This type is supported for the following
platforms/compilers:

Linux, for GNU, Clang, LLVMFlang and NVIDIA compilers.

All Apple variants for Clang and AppleClang compilers.

Windows, for GNU, Clang compilers with GNU front-end and
CLang, MSVC and NVIDIA compilers with MSVC front-end.

BFD

Use the GNU linker.  This type is supported for the following
platforms/compilers:

Linux, for GNU, Clang, LLVMFlang and NVIDIA compilers.

Windows, for GNU, Clang compilers with GNU front-end.

GOLD

Supported on Linux platform for GNU, Clang, LLVMFlang and
NVIDIA compilers.

MOLD

Use the mold linker. This type is
supported on the following platforms:

Linux platform for GNU, Clang, LLVMFlang and NVIDIA
compilers.

All Apple variants for Clang and AppleClang compilers as an
alias to SOLD.

SOLD

Use the sold linker. This type
is only supported on Apple platforms for Clang and AppleClang
compilers.

APPLE_CLASSIC

Use the Apple linker in the classic behavior (i.e. before Xcode 15.0).
This type is only supported on Apple platforms for GNU, Clang and
AppleClang compilers.

MSVC

Use the Microsoft linker. This type is only supported on Windows
platform for MSVC and Clang compiler with MSVC front-end.

Previous topic

CMAKE_LINK_WHAT_YOU_USE_CHECK

Next topic

CMAKE_MACOSX_BUNDLE

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-variables(7) »

CMAKE_LINKER_TYPE

        © 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>CMAKE_LINK_DEF_FILE_FLAG — 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_LINK_DEPENDS_NO_SHARED" href="CMAKE_LINK_DEPENDS_NO_SHARED.html" />
    <link rel="prev" title="CMAKE_LIBRARY_PATH_FLAG" href="CMAKE_LIBRARY_PATH_FLAG.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_DEF_FILE_FLAG

CMAKE_LINK_DEF_FILE_FLAG¶

Linker flag to be used to specify a .def file for dll creation.

The flag will be used to add a .def file when creating a dll on
Windows; this is only defined on Windows.

Previous topic

CMAKE_LIBRARY_PATH_FLAG

Next topic

CMAKE_LINK_DEPENDS_NO_SHARED

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-variables(7) »

CMAKE_LINK_DEF_FILE_FLAG

        © 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>CMAKE_LINK_DEPENDS_NO_SHARED — 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_LINK_DEPENDS_USE_LINKER" href="CMAKE_LINK_DEPENDS_USE_LINKER.html" />
    <link rel="prev" title="CMAKE_LINK_DEF_FILE_FLAG" href="CMAKE_LINK_DEF_FILE_FLAG.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_DEPENDS_NO_SHARED

CMAKE_LINK_DEPENDS_NO_SHARED¶

Whether to skip link dependencies on shared library files.

This variable initializes the LINK_DEPENDS_NO_SHARED property on
targets when they are created.  See that target property for
additional information.

Previous topic

CMAKE_LINK_DEF_FILE_FLAG

Next topic

CMAKE_LINK_DEPENDS_USE_LINKER

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-variables(7) »

CMAKE_LINK_DEPENDS_NO_SHARED

        © 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>CMAKE_LINK_DEPENDS_USE_LINKER — 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_LINK_GROUP_USING_<FEATURE>" href="CMAKE_LINK_GROUP_USING_FEATURE.html" />
    <link rel="prev" title="CMAKE_LINK_DEPENDS_NO_SHARED" href="CMAKE_LINK_DEPENDS_NO_SHARED.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_DEPENDS_USE_LINKER

CMAKE_LINK_DEPENDS_USE_LINKER¶

New in version 3.27.

For the Makefile and
Ninja generators, link dependencies are now, for a
selection of linkers, generated by the linker itself. By defining this
variable with value FALSE, you can deactivate this feature.

This feature is also deactivated if the LINK_DEPENDS_NO_SHARED
target property is true.

Note

CMake version 3.29.0-rc3 defaults this variable to FALSE because
GNU binutils linkers (ld, ld.bfd, ld.gold) generate spurious
dependencies on temporary files when LTO is enabled.  See GNU bug 30568.

Previous topic

CMAKE_LINK_DEPENDS_NO_SHARED

Next topic

CMAKE_LINK_GROUP_USING_<FEATURE>

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-variables(7) »

CMAKE_LINK_DEPENDS_USE_LINKER

        © 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>CMAKE_LINK_DIRECTORIES_BEFORE — 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_LINK_LIBRARIES_ONLY_TARGETS" href="CMAKE_LINK_LIBRARIES_ONLY_TARGETS.html" />
    <link rel="prev" title="CMAKE_LIBRARY_PATH" href="CMAKE_LIBRARY_PATH.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_DIRECTORIES_BEFORE

CMAKE_LINK_DIRECTORIES_BEFORE¶

New in version 3.13.

Whether to append or prepend directories by default in
link_directories().

This variable affects the default behavior of the link_directories()
command.  Setting this variable to ON is equivalent to using the BEFORE
option in all uses of that command.

Previous topic

CMAKE_LIBRARY_PATH

Next topic

CMAKE_LINK_LIBRARIES_ONLY_TARGETS

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-variables(7) »

CMAKE_LINK_DIRECTORIES_BEFORE

        © 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>CMAKE_LINK_GROUP_USING_<FEATURE> — 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_LINK_GROUP_USING_<FEATURE>_SUPPORTED" href="CMAKE_LINK_GROUP_USING_FEATURE_SUPPORTED.html" />
    <link rel="prev" title="CMAKE_LINK_DEPENDS_USE_LINKER" href="CMAKE_LINK_DEPENDS_USE_LINKER.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_GROUP_USING_<FEATURE>

<span id="variable:CMAKE_LINK_GROUP_USING_<FEATURE>">
CMAKE_LINK_GROUP_USING_<FEATURE>¶

New in version 3.24.

This variable defines how to link a group of libraries for the specified
<FEATURE> when a LINK_GROUP generator expression is used.
Both of the following conditions must be met for this variable to have any
effect:

The associated CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED
variable must be set to true.

There is no language-specific definition for the same <FEATURE>.
This means CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE>_SUPPORTED
cannot be true for the link language used by the target for which the
LINK_GROUP generator expression is evaluated.

The CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE> variable should be
defined instead for features that are dependent on the link language.

Feature names are case-sensitive and may only contain letters, numbers
and underscores.  Feature names defined in all uppercase are reserved for
CMake's own built-in features (see Predefined Features further below).

Feature Definitions¶

A group feature definition is a list that contains exactly two elements:

<PREFIX> <SUFFIX>

On the linker command line, <PREFIX> will precede the list of libraries
in the group and <SUFFIX> will follow after.

For the elements of this variable, the LINKER: prefix can be used.

To pass options to the linker tool, each compiler driver has its own syntax.
The LINKER: prefix and , separator can be used to specify, in a portable
way, options to pass to the linker tool. LINKER: is replaced by the
appropriate driver option and , by the appropriate driver separator.
The driver prefix and driver separator are given by the values of the
CMAKE_<LANG>_LINKER_WRAPPER_FLAG and
CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP variables.

For example, "LINKER:-z,defs" becomes -Xlinker -z -Xlinker defs for
Clang and -Wl,-z,defs for GNU GCC.

The LINKER: prefix can be specified as part of a SHELL: prefix
expression.

The LINKER: prefix supports, as an alternative syntax, specification of
arguments using the SHELL: prefix and space as separator. The previous
example then becomes "LINKER:SHELL:-z defs".

Note

Specifying the SHELL: prefix anywhere other than at the beginning of the
LINKER: prefix is not supported.

Examples¶

Solving cross-references between two static libraries¶

A project may define two or more static libraries which have circular
dependencies between them.  In order for the linker to resolve all symbols
at link time, it may need to search repeatedly among the libraries until no
new undefined references are created.  Different linkers use different syntax
for achieving this.  The following example shows how this may be implemented
for some linkers.  Note that this is for illustration purposes only.
Projects should use the built-in RESCAN group feature instead
(see Predefined Features), which provides a more complete and more robust
implementation of this functionality.

set(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED TRUE)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
  set(CMAKE_C_LINK_GROUP_USING_cross_refs
    "LINKER:--start-group"
    "LINKER:--end-group"
  )
elseif(CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
  set(CMAKE_C_LINK_GROUP_USING_cross_refs
    "LINKER:-z,rescan-start"
    "LINKER:-z,rescan-end"
  )
else()
  # feature not yet supported for the other environments
  set(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED FALSE)
endif()

add_library(lib1 STATIC ...)
add_library(lib2 SHARED ...)

if(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED)
  target_link_libraries(lib2 PRIVATE "$<LINK_GROUP:cross_refs,lib1,external>")
else()
  target_link_libraries(lib2 PRIVATE lib1 external)
endif()

CMake will generate the following linker command line fragments when linking
lib2:

GNU: -Wl,--start-group /path/to/lib1.a -lexternal -Wl,--end-group

SunPro: -Wl,-z,rescan-start /path/to/lib1.a -lexternal -Wl,-z,rescan-end

Predefined Features¶

The following built-in group features are pre-defined by CMake:

RESCAN

Some linkers are single-pass only.  For such linkers, circular references
between libraries typically result in unresolved symbols.  This feature
instructs the linker to search the specified static libraries repeatedly
until no new undefined references are created.

Normally, a static library is searched only once in the order that it is
specified on the command line.  If a symbol in that library is needed to
resolve an undefined symbol referred to by an object in a library that
appears later on the command line, the linker would not be able to resolve
that reference.  By grouping the static libraries with the RESCAN
feature, they will all be searched repeatedly until all possible references
are resolved.  This will use linker options like --start-group and
--end-group, or on SunOS, -z rescan-start and -z rescan-end.

Using this feature has a significant performance cost. It is best to use it
only when there are unavoidable circular references between two or more
static libraries.

This feature is available when using toolchains that target Linux, BSD, and
SunOS.  It can also be used when targeting Windows platforms if the GNU
toolchain is used.

Table of Contents

CMAKE_LINK_GROUP_USING_<FEATURE>

Feature Definitions

Examples

Solving cross-references between two static libraries

Predefined Features

Previous topic

CMAKE_LINK_DEPENDS_USE_LINKER

Next topic

CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED

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-variables(7) »

CMAKE_LINK_GROUP_USING_<FEATURE>

        © 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>CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED — 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_LINK_INTERFACE_LIBRARIES" href="CMAKE_LINK_INTERFACE_LIBRARIES.html" />
    <link rel="prev" title="CMAKE_LINK_GROUP_USING_<FEATURE>" href="CMAKE_LINK_GROUP_USING_FEATURE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED

<span id="variable:CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED">
CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED¶

New in version 3.24.

This variable specifies whether the <FEATURE> is supported regardless of
the link language.  If this variable is true, then the <FEATURE> must
be defined by CMAKE_LINK_GROUP_USING_<FEATURE>.

Note that this variable has no effect if
CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE>_SUPPORTED is true for
the link language of the target.

Previous topic

CMAKE_LINK_GROUP_USING_<FEATURE>

Next topic

CMAKE_LINK_INTERFACE_LIBRARIES

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-variables(7) »

CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED

        © 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>CMAKE_LINK_INTERFACE_LIBRARIES — 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_LINK_LIBRARY_FILE_FLAG" href="CMAKE_LINK_LIBRARY_FILE_FLAG.html" />
    <link rel="prev" title="CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED" href="CMAKE_LINK_GROUP_USING_FEATURE_SUPPORTED.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_INTERFACE_LIBRARIES

CMAKE_LINK_INTERFACE_LIBRARIES¶

Default value for LINK_INTERFACE_LIBRARIES of targets.

This variable is used to initialize the LINK_INTERFACE_LIBRARIES
property on all the targets.  See that target property for additional
information.

Previous topic

CMAKE_LINK_GROUP_USING_<FEATURE>_SUPPORTED

Next topic

CMAKE_LINK_LIBRARY_FILE_FLAG

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-variables(7) »

CMAKE_LINK_INTERFACE_LIBRARIES

        © 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>CMAKE_LINK_LIBRARIES_ONLY_TARGETS — 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_MAXIMUM_RECURSION_DEPTH" href="CMAKE_MAXIMUM_RECURSION_DEPTH.html" />
    <link rel="prev" title="CMAKE_LINK_DIRECTORIES_BEFORE" href="CMAKE_LINK_DIRECTORIES_BEFORE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_LIBRARIES_ONLY_TARGETS

CMAKE_LINK_LIBRARIES_ONLY_TARGETS¶

New in version 3.23.

Set this variable to initialize the LINK_LIBRARIES_ONLY_TARGETS
property of non-imported targets when they are created.  Setting it to true
enables an additional check that all items named by
target_link_libraries() that can be target names are actually names
of existing targets.  See the target property documentation for details.

Previous topic

CMAKE_LINK_DIRECTORIES_BEFORE

Next topic

CMAKE_MAXIMUM_RECURSION_DEPTH

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-variables(7) »

CMAKE_LINK_LIBRARIES_ONLY_TARGETS

        © 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>CMAKE_LINK_LIBRARY_FILE_FLAG — 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_LINK_LIBRARY_FLAG" href="CMAKE_LINK_LIBRARY_FLAG.html" />
    <link rel="prev" title="CMAKE_LINK_INTERFACE_LIBRARIES" href="CMAKE_LINK_INTERFACE_LIBRARIES.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_LIBRARY_FILE_FLAG

CMAKE_LINK_LIBRARY_FILE_FLAG¶

Flag to be used to link a library specified by a path to its file.

The flag will be used before a library file path is given to the
linker.  This is needed only on very few platforms.

Previous topic

CMAKE_LINK_INTERFACE_LIBRARIES

Next topic

CMAKE_LINK_LIBRARY_FLAG

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-variables(7) »

CMAKE_LINK_LIBRARY_FILE_FLAG

        © 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>CMAKE_LINK_LIBRARY_FLAG — 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_LINK_LIBRARY_USING_<FEATURE>" href="CMAKE_LINK_LIBRARY_USING_FEATURE.html" />
    <link rel="prev" title="CMAKE_LINK_LIBRARY_FILE_FLAG" href="CMAKE_LINK_LIBRARY_FILE_FLAG.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_LIBRARY_FLAG

CMAKE_LINK_LIBRARY_FLAG¶

Flag to be used to link a library into an executable.

The flag will be used to specify a library to link to an executable.
On most compilers this is -l.

Previous topic

CMAKE_LINK_LIBRARY_FILE_FLAG

Next topic

CMAKE_LINK_LIBRARY_USING_<FEATURE>

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-variables(7) »

CMAKE_LINK_LIBRARY_FLAG

        © 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>CMAKE_LINK_LIBRARY_SUFFIX — 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_LINK_SEARCH_END_STATIC" href="CMAKE_LINK_SEARCH_END_STATIC.html" />
    <link rel="prev" title="CMAKE_<LANG>_LINK_LIBRARY_SUFFIX" href="CMAKE_LANG_LINK_LIBRARY_SUFFIX.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_LIBRARY_SUFFIX

CMAKE_LINK_LIBRARY_SUFFIX¶

The suffix for libraries that you link to.

The suffix to use for the end of a library filename, .lib on Windows.

Previous topic

CMAKE_<LANG>_LINK_LIBRARY_SUFFIX

Next topic

CMAKE_LINK_SEARCH_END_STATIC

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-variables(7) »

CMAKE_LINK_LIBRARY_SUFFIX

        © 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>CMAKE_LINK_LIBRARY_USING_<FEATURE> — 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_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED" href="CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED.html" />
    <link rel="prev" title="CMAKE_LINK_LIBRARY_FLAG" href="CMAKE_LINK_LIBRARY_FLAG.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_LIBRARY_USING_<FEATURE>

<span id="variable:CMAKE_LINK_LIBRARY_USING_<FEATURE>">
CMAKE_LINK_LIBRARY_USING_<FEATURE>¶

New in version 3.24.

This variable defines how to link a library or framework for the specified
<FEATURE> when a LINK_LIBRARY generator expression is used.
Both of the following conditions must be met for this variable to have any
effect:

The associated CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED
variable must be set to true.

There is no language-specific definition for the same <FEATURE>.
This means CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED
cannot be true for the link language used by the target for which the
LINK_LIBRARY generator expression is evaluated.

Feature names are case-sensitive and may only contain letters, numbers
and underscores.  Feature names defined in all uppercase are reserved for
CMake's own built-in features (see Predefined Features further below).

Feature Definitions¶

A library feature definition is a list that contains one or three elements:

[<PREFIX>] <LIBRARY_EXPRESSION> [<SUFFIX>]

When <PREFIX> and <SUFFIX> are specified, they precede and follow
respectively the whole list of libraries specified in the
LINK_LIBRARY expression, not each library item individually.
There is no guarantee that the list of specified libraries will be kept
grouped together though, so the <PREFIX> and <SUFFIX> may appear
more than once if the library list is reorganized by CMake to satisfy other
constraints.  This means constructs like --start-group and --end-group,
as supported by the GNU ld linker, cannot be used in this way.  The
LINK_GROUP generator expression should be used instead for such
constructs.

<LIBRARY_EXPRESSION> is used to specify the pattern for constructing the
corresponding fragment on the linker command line for each library.
The following placeholders can be used in the expression:

<LIBRARY> is expanded to the full path to the library for CMake targets,
or to a platform-specific value based on the item otherwise (the same as
<LINK_ITEM> on Windows, or the library base name for other platforms).

<LINK_ITEM> is expanded to how the library would normally be linked on
the linker command line.

<LIB_ITEM> is expanded to the full path to the library for CMake targets,
or the item itself exactly as specified in the <LIBRARY_EXPRESSION>
otherwise.

In addition to the above, it is possible to have one pattern for paths
(CMake targets and external libraries specified with file paths) and another
for other items specified by name only.  The PATH{} and NAME{} wrappers
can be used to provide the expansion for those two cases, respectively.
When wrappers are used, both must be present.  For example:

set(CMAKE_LINK_LIBRARY_USING_weak_library
    "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}"
)

For all three elements of this variable (<PREFIX>, <LIBRARY_EXPRESSION>,
and <SUFFIX>), the LINKER: prefix can be used.

To pass options to the linker tool, each compiler driver has its own syntax.
The LINKER: prefix and , separator can be used to specify, in a portable
way, options to pass to the linker tool. LINKER: is replaced by the
appropriate driver option and , by the appropriate driver separator.
The driver prefix and driver separator are given by the values of the
CMAKE_<LANG>_LINKER_WRAPPER_FLAG and
CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP variables.

For example, "LINKER:-z,defs" becomes -Xlinker -z -Xlinker defs for
Clang and -Wl,-z,defs for GNU GCC.

The LINKER: prefix can be specified as part of a SHELL: prefix
expression.

The LINKER: prefix supports, as an alternative syntax, specification of
arguments using the SHELL: prefix and space as separator. The previous
example then becomes "LINKER:SHELL:-z defs".

Note

Specifying the SHELL: prefix anywhere other than at the beginning of the
LINKER: prefix is not supported.

Examples¶

Loading a whole static library¶

A common need is to prevent the linker from discarding any symbols from a
static library.  Different linkers use different syntax for achieving this.
The following example shows how this may be implemented for some linkers.
Note that this is for illustration purposes only.  Projects should use the
built-in WHOLE_ARCHIVE feature instead (see Predefined Features), which
provides a more complete and more robust implementation of this functionality.

set(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED TRUE)
if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
  set(CMAKE_C_LINK_LIBRARY_USING_load_archive "-force_load <LIB_ITEM>")
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
  set(CMAKE_C_LINK_LIBRARY_USING_load_archive
    "LINKER:--push-state,--whole-archive"
    "<LINK_ITEM>"
    "LINKER:--pop-state"
  )
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
  set(CMAKE_C_LINK_LIBRARY_USING_load_archive "/WHOLEARCHIVE:<LIBRARY>")
else()
  # feature not yet supported for the other environments
  set(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED FALSE)
endif()

add_library(lib1 STATIC ...)
add_library(lib2 SHARED ...)

if(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED)
  # The -force_load Apple linker option requires a file name
  set(external_lib
    "$<IF:$<LINK_LANG_AND_ID:C,AppleClang>,libexternal.a,external>"
  )
  target_link_libraries(lib2 PRIVATE
    "$<LINK_LIBRARY:load_archive,lib1,${external_lib}>"
  )
else()
  target_link_libraries(lib2 PRIVATE lib1 external)
endif()

CMake will generate the following link expressions:

AppleClang: -force_load /path/to/lib1.a -force_load libexternal.a

GNU: -Wl,--push-state,--whole-archive /path/to/lib1.a -lexternal -Wl,--pop-state

MSVC: /WHOLEARCHIVE:/path/to/lib1.lib /WHOLEARCHIVE:external.lib

Linking a library as weak¶

On macOS, it is possible to link a library in weak mode (the library and all
references are marked as weak imports).  Different flags must be used for a
library specified by file path compared to one specified by name.
This constraint can be solved using PATH{} and NAME{} wrappers.
Again, the following example shows how this may be implemented for some
linkers, but it is for illustration purposes only.  Projects should use the
built-in WEAK_FRAMEWORK or WEAK_LIBRARY features instead (see
Predefined Features), which provide more complete and more robust
implementations of this functionality.

if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
  set(CMAKE_LINK_LIBRARY_USING_weak_library
      "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}"
  )
  set(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED TRUE)
endif()

add_library(lib SHARED ...)
add_executable(main ...)
if(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED)
  target_link_libraries(main PRIVATE "$<LINK_LIBRARY:weak_library,lib,external>")
else()
  target_link_libraries(main PRIVATE lib external)
endif()

CMake will generate the following linker command line fragment when linking
main using the AppleClang toolchain:

-weak_library /path/to/lib -Xlinker -weak-lexternal.

Predefined Features¶

The following built-in library features are pre-defined by CMake:

DEFAULT

This feature corresponds to standard linking, essentially equivalent to
using no feature at all.  It is typically only used with the
LINK_LIBRARY_OVERRIDE and
LINK_LIBRARY_OVERRIDE_<LIBRARY> target properties.

WHOLE_ARCHIVE

Force inclusion of all members of a static library.  This feature is only
supported for the following platforms, with limitations as noted:

Linux.

All BSD variants.

SunOS.

All Apple variants.  The library must be specified as a CMake target name,
a library file name (such as libfoo.a), or a library file path (such as
/path/to/libfoo.a).  Due to a limitation of the Apple linker, it
cannot be specified as a plain library name like foo, where foo
is not a CMake target.

Windows.  When using a MSVC or MSVC-like toolchain, the MSVC version must
be greater than 1900.

Cygwin.

MSYS.

FRAMEWORK

This option tells the linker to search for the specified framework using
the -framework linker option.  It can only be used on Apple platforms,
and only with a linker that understands the option used (i.e. the linker
provided with Xcode, or one compatible with it).

The framework can be specified as a CMake framework target, a bare framework
name, or a file path.  If a target is given, that target must have the
FRAMEWORK target property set to true.  For a file path, if it
contains a directory part, that directory will be added as a framework
search path.

add_library(lib SHARED ...)
target_link_libraries(lib PRIVATE "$<LINK_LIBRARY:FRAMEWORK,/path/to/my_framework>")

# The constructed linker command line will contain:
#   -F/path/to -framework my_framework

File paths must conform to one of the following patterns (* is a
wildcard, and optional parts are shown as [...]):

[/path/to/]FwName[.framework]

[/path/to/]FwName.framework/FwName[suffix]

[/path/to/]FwName.framework/Versions/*/FwName[suffix]

Note that CMake recognizes and automatically handles framework targets,
even without using the $<LINK_LIBRARY:FRAMEWORK,...> expression.
The generator expression can still be used with a CMake target if the
project wants to be explicit about it, but it is not required to do so.
The linker command line may have some differences between using the
generator expression or not, but the final result should be the same.
On the other hand, if a file path is given, CMake will recognize some paths
automatically, but not all cases.  The project may want to use
$<LINK_LIBRARY:FRAMEWORK,...> for file paths so that the expected
behavior is clear.

New in version 3.25: The FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> target property as
well as the suffix of the framework library name are now supported by
the FRAMEWORK features.

NEEDED_FRAMEWORK

This is similar to the FRAMEWORK feature, except it forces the linker
to link with the framework even if no symbols are used from it.  It uses
the -needed_framework option and has the same linker constraints as
FRAMEWORK.

REEXPORT_FRAMEWORK

This is similar to the FRAMEWORK feature, except it tells the linker
that the framework should be available to clients linking to the library
being created.  It uses the -reexport_framework option and has the
same linker constraints as FRAMEWORK.

WEAK_FRAMEWORK

This is similar to the FRAMEWORK feature, except it forces the linker
to mark the framework and all references to it as weak imports.  It uses
the -weak_framework option and has the same linker constraints as
FRAMEWORK.

NEEDED_LIBRARY

This is similar to the NEEDED_FRAMEWORK feature, except it is for use
with non-framework targets or libraries (Apple platforms only).
It uses the -needed_library or -needed-l option as appropriate,
and has the same linker constraints as NEEDED_FRAMEWORK.

REEXPORT_LIBRARY

This is similar to the REEXPORT_FRAMEWORK feature,  except it is for use
with non-framework targets or libraries (Apple platforms only).
It uses the -reexport_library or -reexport-l option as appropriate,
and has the same linker constraints as REEXPORT_FRAMEWORK.

WEAK_LIBRARY

This is similar to the WEAK_FRAMEWORK feature, except it is for use
with non-framework targets or libraries (Apple platforms only).
It uses the -weak_library or -weak-l option as appropriate,
and has the same linker constraints as WEAK_FRAMEWORK.

Table of Contents

CMAKE_LINK_LIBRARY_USING_<FEATURE>

Feature Definitions

Examples

Loading a whole static library

Linking a library as weak

Predefined Features

Previous topic

CMAKE_LINK_LIBRARY_FLAG

Next topic

CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED

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-variables(7) »

CMAKE_LINK_LIBRARY_USING_<FEATURE>

        © 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>CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED — 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_LINK_WHAT_YOU_USE" href="CMAKE_LINK_WHAT_YOU_USE.html" />
    <link rel="prev" title="CMAKE_LINK_LIBRARY_USING_<FEATURE>" href="CMAKE_LINK_LIBRARY_USING_FEATURE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED

<span id="variable:CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED">
CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED¶

New in version 3.24.

Set to TRUE if the <FEATURE>, as defined by variable
CMAKE_LINK_LIBRARY_USING_<FEATURE>, is supported regardless the
linker language.

Note

This variable is evaluated if, and only if, the variable
CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED is not
defined.

Previous topic

CMAKE_LINK_LIBRARY_USING_<FEATURE>

Next topic

CMAKE_LINK_WHAT_YOU_USE

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-variables(7) »

CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED

        © 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>CMAKE_LINK_SEARCH_END_STATIC — 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_LINK_SEARCH_START_STATIC" href="CMAKE_LINK_SEARCH_START_STATIC.html" />
    <link rel="prev" title="CMAKE_LINK_LIBRARY_SUFFIX" href="CMAKE_LINK_LIBRARY_SUFFIX.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_SEARCH_END_STATIC

CMAKE_LINK_SEARCH_END_STATIC¶

New in version 3.4.

End a link line such that static system libraries are used.

Some linkers support switches such as -Bstatic and -Bdynamic to
determine whether to use static or shared libraries for -lXXX options.
CMake uses these options to set the link type for libraries whose full
paths are not known or (in some cases) are in implicit link
directories for the platform.  By default CMake adds an option at the
end of the library list (if necessary) to set the linker search type
back to its starting type.  This property switches the final linker
search type to -Bstatic regardless of how it started.

This variable is used to initialize the target property
LINK_SEARCH_END_STATIC for all targets. If set, its
value is also used by the try_compile() command.

See also CMAKE_LINK_SEARCH_START_STATIC.

Previous topic

CMAKE_LINK_LIBRARY_SUFFIX

Next topic

CMAKE_LINK_SEARCH_START_STATIC

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-variables(7) »

CMAKE_LINK_SEARCH_END_STATIC

        © 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>CMAKE_LINK_SEARCH_START_STATIC — 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_MAJOR_VERSION" href="CMAKE_MAJOR_VERSION.html" />
    <link rel="prev" title="CMAKE_LINK_SEARCH_END_STATIC" href="CMAKE_LINK_SEARCH_END_STATIC.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_SEARCH_START_STATIC

CMAKE_LINK_SEARCH_START_STATIC¶

New in version 3.4.

Assume the linker looks for static libraries by default.

Some linkers support switches such as -Bstatic and -Bdynamic to
determine whether to use static or shared libraries for -lXXX options.
CMake uses these options to set the link type for libraries whose full
paths are not known or (in some cases) are in implicit link
directories for the platform.  By default the linker search type is
assumed to be -Bdynamic at the beginning of the library list.  This
property switches the assumption to -Bstatic.  It is intended for use
when linking an executable statically (e.g.  with the GNU -static
option).

This variable is used to initialize the target property
LINK_SEARCH_START_STATIC for all targets.  If set, its
value is also used by the try_compile() command.

See also CMAKE_LINK_SEARCH_END_STATIC.

Previous topic

CMAKE_LINK_SEARCH_END_STATIC

Next topic

CMAKE_MAJOR_VERSION

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-variables(7) »

CMAKE_LINK_SEARCH_START_STATIC

        © 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>CMAKE_LINK_WHAT_YOU_USE — 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_LINK_WHAT_YOU_USE_CHECK" href="CMAKE_LINK_WHAT_YOU_USE_CHECK.html" />
    <link rel="prev" title="CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED" href="CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_WHAT_YOU_USE

CMAKE_LINK_WHAT_YOU_USE¶

New in version 3.7.

Default value for LINK_WHAT_YOU_USE target property.
This variable is used to initialize the property on each target as it is
created.

Previous topic

CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED

Next topic

CMAKE_LINK_WHAT_YOU_USE_CHECK

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-variables(7) »

CMAKE_LINK_WHAT_YOU_USE

        © 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>CMAKE_LINK_WHAT_YOU_USE_CHECK — 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_LINKER_TYPE" href="CMAKE_LINKER_TYPE.html" />
    <link rel="prev" title="CMAKE_LINK_WHAT_YOU_USE" href="CMAKE_LINK_WHAT_YOU_USE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_LINK_WHAT_YOU_USE_CHECK

CMAKE_LINK_WHAT_YOU_USE_CHECK¶

New in version 3.22.

Defines the command executed after the link step to check libraries usage.
This check is currently only defined on ELF platforms with value
ldd -u -r.

See also CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG variables.

Previous topic

CMAKE_LINK_WHAT_YOU_USE

Next topic

CMAKE_LINKER_TYPE

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-variables(7) »

CMAKE_LINK_WHAT_YOU_USE_CHECK

        © 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>CMAKE_MACOSX_BUNDLE — 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_MACOSX_RPATH" href="CMAKE_MACOSX_RPATH.html" />
    <link rel="prev" title="CMAKE_LINKER_TYPE" href="CMAKE_LINKER_TYPE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MACOSX_BUNDLE

CMAKE_MACOSX_BUNDLE¶

Default value for MACOSX_BUNDLE of targets.

This variable is used to initialize the MACOSX_BUNDLE property on
all the targets.  See that target property for additional information.

This variable is set to ON by default if CMAKE_SYSTEM_NAME
equals to iOS, tvOS, visionOS or watchOS.

Previous topic

CMAKE_LINKER_TYPE

Next topic

CMAKE_MACOSX_RPATH

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-variables(7) »

CMAKE_MACOSX_BUNDLE

        © 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>CMAKE_MACOSX_RPATH — 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_MAP_IMPORTED_CONFIG_<CONFIG>" href="CMAKE_MAP_IMPORTED_CONFIG_CONFIG.html" />
    <link rel="prev" title="CMAKE_MACOSX_BUNDLE" href="CMAKE_MACOSX_BUNDLE.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MACOSX_RPATH

CMAKE_MACOSX_RPATH¶

Whether to use rpaths on macOS and iOS.

This variable is used to initialize the MACOSX_RPATH property on
all targets.

Previous topic

CMAKE_MACOSX_BUNDLE

Next topic

CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>

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-variables(7) »

CMAKE_MACOSX_RPATH

        © 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>CMAKE_MAJOR_VERSION — 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_MAKE_PROGRAM" href="CMAKE_MAKE_PROGRAM.html" />
    <link rel="prev" title="CMAKE_LINK_SEARCH_START_STATIC" href="CMAKE_LINK_SEARCH_START_STATIC.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MAJOR_VERSION

CMAKE_MAJOR_VERSION¶

First version number component of the CMAKE_VERSION
variable.

Previous topic

CMAKE_LINK_SEARCH_START_STATIC

Next topic

CMAKE_MAKE_PROGRAM

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-variables(7) »

CMAKE_MAJOR_VERSION

        © 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>CMAKE_MAKE_PROGRAM — 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_MATCH_COUNT" href="CMAKE_MATCH_COUNT.html" />
    <link rel="prev" title="CMAKE_MAJOR_VERSION" href="CMAKE_MAJOR_VERSION.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MAKE_PROGRAM

CMAKE_MAKE_PROGRAM¶

Tool that can launch the native build system.
The value may be the full path to an executable or just the tool
name if it is expected to be in the PATH.

The tool selected depends on the CMAKE_GENERATOR used
to configure the project:

The Makefile Generators set this to make, gmake, or
a generator-specific tool (e.g. nmake for NMake Makefiles).

These generators store CMAKE_MAKE_PROGRAM in the CMake cache
so that it may be edited by the user.

The Ninja generator sets this to ninja.

This generator stores CMAKE_MAKE_PROGRAM in the CMake cache
so that it may be edited by the user.

The Xcode generator sets this to xcodebuild.

This generator prefers to lookup the build tool at build time
rather than to store CMAKE_MAKE_PROGRAM in the CMake cache
ahead of time.  This is because xcodebuild is easy to find.

For compatibility with versions of CMake prior to 3.2, if
a user or project explicitly adds CMAKE_MAKE_PROGRAM to
the CMake cache then CMake will use the specified value.

The Visual Studio Generators set this to the full path to
MSBuild.exe (VS >= 10), devenv.com (VS 7,8,9), or
VCExpress.exe (VS Express 8,9).
(See also variables
CMAKE_VS_MSBUILD_COMMAND and
CMAKE_VS_DEVENV_COMMAND.

These generators prefer to lookup the build tool at build time
rather than to store CMAKE_MAKE_PROGRAM in the CMake cache
ahead of time.  This is because the tools are version-specific
and can be located using the Windows Registry.  It is also
necessary because the proper build tool may depend on the
project content (e.g. the Intel Fortran plugin to VS 10 and 11
requires devenv.com to build its .vfproj project files
even though MSBuild.exe is normally preferred to support
the CMAKE_GENERATOR_TOOLSET).

For compatibility with versions of CMake prior to 3.0, if
a user or project explicitly adds CMAKE_MAKE_PROGRAM to
the CMake cache then CMake will use the specified value if
possible.

The Green Hills MULTI generator sets this to the full
path to gbuild.exe(Windows) or gbuild(Linux) based upon
the toolset being used.

Once the generator has initialized a particular value for this
variable, changing the value has undefined behavior.

The CMAKE_MAKE_PROGRAM variable is set for use by project code.
The value is also used by the cmake --build and
ctest --build-and-test tools to launch the native
build process.

Previous topic

CMAKE_MAJOR_VERSION

Next topic

CMAKE_MATCH_COUNT

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-variables(7) »

CMAKE_MAKE_PROGRAM

        © 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>CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> — 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_MODULE_LINKER_FLAGS" href="CMAKE_MODULE_LINKER_FLAGS.html" />
    <link rel="prev" title="CMAKE_MACOSX_RPATH" href="CMAKE_MACOSX_RPATH.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>

<span id="variable:CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>">
CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>¶

Default value for MAP_IMPORTED_CONFIG_<CONFIG> of targets.

This variable is used to initialize the
MAP_IMPORTED_CONFIG_<CONFIG> property on all the targets.  See
that target property for additional information.

Previous topic

CMAKE_MACOSX_RPATH

Next topic

CMAKE_MODULE_LINKER_FLAGS

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-variables(7) »

CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>

        © 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>CMAKE_MATCH_COUNT — 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_MATCH_<n>" href="CMAKE_MATCH_n.html" />
    <link rel="prev" title="CMAKE_MAKE_PROGRAM" href="CMAKE_MAKE_PROGRAM.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MATCH_COUNT

CMAKE_MATCH_COUNT¶

New in version 3.2.

The number of matches with the last regular expression.

When a regular expression match is used, CMake fills in
CMAKE_MATCH_<n> variables with the match contents.
The CMAKE_MATCH_COUNT variable holds the number of match
expressions when these are filled.

Previous topic

CMAKE_MAKE_PROGRAM

Next topic

CMAKE_MATCH_<n>

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-variables(7) »

CMAKE_MATCH_COUNT

        © 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>CMAKE_MATCH_<n> — 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_MINIMUM_REQUIRED_VERSION" href="CMAKE_MINIMUM_REQUIRED_VERSION.html" />
    <link rel="prev" title="CMAKE_MATCH_COUNT" href="CMAKE_MATCH_COUNT.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MATCH_<n>

<span id="variable:CMAKE_MATCH_<n>">
CMAKE_MATCH_<n>¶

Capture group <n> matched by the last regular expression, for groups
0 through 9.  Group 0 is the entire match.  Groups 1 through 9 are the
subexpressions captured by () syntax.

When a regular expression match is used, CMake fills in CMAKE_MATCH_<n>
variables with the match contents.  The CMAKE_MATCH_COUNT
variable holds the number of match expressions when these are filled.

Previous topic

CMAKE_MATCH_COUNT

Next topic

CMAKE_MINIMUM_REQUIRED_VERSION

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-variables(7) »

CMAKE_MATCH_<n>

        © 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>CMAKE_MAXIMUM_RECURSION_DEPTH — 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_MESSAGE_CONTEXT" href="CMAKE_MESSAGE_CONTEXT.html" />
    <link rel="prev" title="CMAKE_LINK_LIBRARIES_ONLY_TARGETS" href="CMAKE_LINK_LIBRARIES_ONLY_TARGETS.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-variables(7) »

CMAKE_MAXIMUM_RECURSION_DEPTH

CMAKE_MAXIMUM_RECURSION_DEPTH¶

New in version 3.14.

Maximum recursion depth for CMake scripts. It is intended to be set on the
command line with -DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>, or within
CMakeLists.txt by projects that require a large recursion depth. Projects
that set this variable should provide the user with a way to override it. For
example:

# About to perform deeply recursive actions
if(NOT CMAKE_MAXIMUM_RECURSION_DEPTH)
  set(CMAKE_MAXIMUM_RECURSION_DEPTH 2000)
endif()

If it is not set, or is set to a non-integer value, a sensible default limit is
used. If the recursion limit is reached, the script terminates immediately with
a fatal error.

Calling any of the following commands increases the recursion depth:

include()

find_package()

add_subdirectory()

try_compile()

ctest_read_custom_files()

ctest_run_script() (unless NEW_PROCESS is specified)

User-defined function()'s and macro()'s (note that
function() and macro() themselves don't increase recursion
depth)

Reading or writing variables that are being watched by a
variable_watch()

See also the CMAKE_MAXIMUM_RECURSION_DEPTH environment variable.

Previous topic

CMAKE_LINK_LIBRARIES_ONLY_TARGETS

Next topic

CMAKE_MESSAGE_CONTEXT

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-variables(7) »

CMAKE_MAXIMUM_RECURSION_DEPTH

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