# Usage

**URL:** https://discourse.cmake.org/c/usage/12.md?page=2

[Latest](https://discourse.cmake.org/latest.md) · [Categories](https://discourse.cmake.org/categories.md) · [Tags](https://discourse.cmake.org/tags.md)

**Page:** 3

---

## [What commands does CMAKE\_REQUIRED\_LINK\_OPTIONS affect exactly?](https://discourse.cmake.org/t/what-commands-does-cmake-required-link-options-affect-exactly/15605)

<div class="topic-metadata">

**Author:** [@nmnobre](https://discourse.cmake.org/u/nmnobre)\
**Replies:** 0\
**Last updated:** [April 15, 2026, 11:08am UTC](https://discourse.cmake.org/t/what-commands-does-cmake-required-link-options-affect-exactly/15605 "2026-04-15T11:08:42Z")

</div>

Hi, The docs make it clear that CMAKE\_REQUIRED\_LINK\_OPTIONS affects the check\_...() commands, but it seems to suggest it also affects try\_compile()? It certainly does not seem to affect compilation during a try\_run() th…

---

## [CMake Debugger breaking at function](https://discourse.cmake.org/t/cmake-debugger-breaking-at-function/15603)

<div class="topic-metadata">

**Author:** [@Maaz\_Madha](https://discourse.cmake.org/u/Maaz_Madha)\
**Replies:** 0\
**Last updated:** [April 14, 2026, 3:05pm UTC](https://discourse.cmake.org/t/cmake-debugger-breaking-at-function/15603 "2026-04-14T15:05:14Z")

</div>

Hi all My CMAKE debugger is breaking at function(pico\_init\_pioasm) \\# Assemble the version string from components instead of using PICO\_SDK\_VERSION\_STRING, because the version string \\# potentially has a PRE\_RELEASE…

---

## [CDash: Build Time Graph...where?](https://discourse.cmake.org/t/cdash-build-time-graph-where/15595)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 2\
**Last updated:** [April 8, 2026, 1:39pm UTC](https://discourse.cmake.org/t/cdash-build-time-graph-where/15595 "2026-04-08T13:39:37Z")

</div>

Folks, I’m a newbie to CDash so I’m sure I’m asking a simple question, but I am stumped. On the docs for CDash I see under Graphs: The build time graph displays the time required to build a project over time. However…

---

## [Integrating CDash submission into a normal CI](https://discourse.cmake.org/t/integrating-cdash-submission-into-a-normal-ci/15587)

<div class="topic-metadata">

**Author:** [@fsimonis](https://discourse.cmake.org/u/fsimonis)\
**Replies:** 8\
**Last updated:** [April 8, 2026, 12:20pm UTC](https://discourse.cmake.org/t/integrating-cdash-submission-into-a-normal-ci/15587 "2026-04-08T12:20:20Z")

</div>

Hi, I’m having trouble integrating CDash into my project’s CI and haven’t found any good answers, so I’m asking here. I manage a pretty standard CI that configures, builds, and tests a CMake project for a range of confi…

---

## [\_deps folder requires administrator priviledges to delete](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155)

<div class="topic-metadata">

**Author:** [@LouChiSoft](https://discourse.cmake.org/u/LouChiSoft)\
**Replies:** 6\
**Last updated:** [April 4, 2026, 9:50pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155 "2026-04-04T21:50:13Z")

</div>

I have recently started using FetchContent to manage some dependencies in my CMake project and for some reason the \_deps folder needs administrator priviledges to delete despite not needing them to make the folder in the…

---

## [Possible regression: FindMPI.cmake doesn't locate MPI in non-standard installation location](https://discourse.cmake.org/t/possible-regression-findmpi-cmake-doesnt-locate-mpi-in-non-standard-installation-location/15589)

<div class="topic-metadata">

**Author:** [@jhendersonHDF](https://discourse.cmake.org/u/jhendersonHDF)\
**Replies:** 0\
**Last updated:** [April 1, 2026, 5:38pm UTC](https://discourse.cmake.org/t/possible-regression-findmpi-cmake-doesnt-locate-mpi-in-non-standard-installation-location/15589 "2026-04-01T17:38:48Z")

</div>

Hi all, On Linux, I typically install several different MPI versions to /opt for testing. After updating CMake to 4.3.1 (the behavior probably changed long before this), it seems CMake can no longer fully find and use t…

---

## [If I link a library, do I also get the header files it uses without having to declare it in target\_include\_directories or target\_sources](https://discourse.cmake.org/t/if-i-link-a-library-do-i-also-get-the-header-files-it-uses-without-having-to-declare-it-in-target-include-directories-or-target-sources/15513)

<div class="topic-metadata">

**Author:** [@Maaz\_Madha](https://discourse.cmake.org/u/Maaz_Madha)\
**Replies:** 3\
**Last updated:** [March 31, 2026, 2:40pm UTC](https://discourse.cmake.org/t/if-i-link-a-library-do-i-also-get-the-header-files-it-uses-without-having-to-declare-it-in-target-include-directories-or-target-sources/15513 "2026-03-31T14:40:58Z")

</div>

If I use target\_sources() to add a couple of header files to a library target, and then link that library to another target using target\_link\_libraries(), do I automatically inherit the include paths for those headers? I…

---

## [Integrating ExternalProject\_Add() with generate-phase target dependencies](https://discourse.cmake.org/t/integrating-externalproject-add-with-generate-phase-target-dependencies/15584)

<div class="topic-metadata">

**Author:** [@wdezell](https://discourse.cmake.org/u/wdezell)\
**Replies:** 0\
**Last updated:** [March 30, 2026, 7:03pm UTC](https://discourse.cmake.org/t/integrating-externalproject-add-with-generate-phase-target-dependencies/15584 "2026-03-30T19:03:17Z")

</div>

Background I have a large project organized as 20+ repos, one being the logical “parent” from which the CMake project is homed and add\_subdirectory() calls chain in the rest, save one. That repo homes a customer-provid…

---

## [CMAKE\_DISABLE\_FIND\_PACKAGE\_xxx equivalent for the PkgConfig module](https://discourse.cmake.org/t/cmake-disable-find-package-xxx-equivalent-for-the-pkgconfig-module/15583)

<div class="topic-metadata">

**Author:** [@MathisMARION](https://discourse.cmake.org/u/MathisMARION)\
**Replies:** 0\
**Last updated:** [March 30, 2026, 3:44pm UTC](https://discourse.cmake.org/t/cmake-disable-find-package-xxx-equivalent-for-the-pkgconfig-module/15583 "2026-03-30T15:44:04Z")

</div>

Being able to disable a dependency without uninstalling it from my system is very useful for testing various build configurations locally. CMAKE\_DISABLE\_FIND\_PACKAGE\_xxx allows to do this easily for native CMake dependen…

---

## [\*.tlh files always dirty with Ninja Multi-config](https://discourse.cmake.org/t/tlh-files-always-dirty-with-ninja-multi-config/15580)

<div class="topic-metadata">

**Author:** [@RobinD42](https://discourse.cmake.org/u/RobinD42)\
**Replies:** 0\
**Last updated:** [March 28, 2026, 3:09am UTC](https://discourse.cmake.org/t/tlh-files-always-dirty-with-ninja-multi-config/15580 "2026-03-28T03:09:25Z")

</div>

We have a project with some C++ files using #import with \*.tlb files. I’ve noticed that with the Ninja Multi-Config generator the tlh and tli files end up in the base of the build folder. However with the single-config N…

---

## [Why is CMAKE\_MACOSX\_BUNDLE set to ON by default if CMAKE\_SYSTEM\_NAME equals to iOS, tvOS, visionOS or watchOS?](https://discourse.cmake.org/t/why-is-cmake-macosx-bundle-set-to-on-by-default-if-cmake-system-name-equals-to-ios-tvos-visionos-or-watchos/15578)

<div class="topic-metadata">

**Author:** [@jasjuang](https://discourse.cmake.org/u/jasjuang)\
**Replies:** 0\
**Last updated:** [March 25, 2026, 6:35am UTC](https://discourse.cmake.org/t/why-is-cmake-macosx-bundle-set-to-on-by-default-if-cmake-system-name-equals-to-ios-tvos-visionos-or-watchos/15578 "2026-03-25T06:35:38Z")

</div>

Why is CMAKE\_MACOSX\_BUNDLE set to ON by default if CMAKE\_SYSTEM\_NAME equals to iOS, tvOS, visionOS or watchOS? To me this creates unnecessary confusion, and I couldn’t find any explanation or justification about it anywh…

---

## [Is there a guide on how to configure CMake with MinGW/MSYS and git on Windows?](https://discourse.cmake.org/t/is-there-a-guide-on-how-to-configure-cmake-with-mingw-msys-and-git-on-windows/15563)

<div class="topic-metadata">

**Author:** [@Lars](https://discourse.cmake.org/u/Lars)\
**Replies:** 10\
**Last updated:** [March 21, 2026, 7:38pm UTC](https://discourse.cmake.org/t/is-there-a-guide-on-how-to-configure-cmake-with-mingw-msys-and-git-on-windows/15563 "2026-03-21T19:38:53Z")

</div>

Hi all, I am a maintainer of a library (OpenXLSX) and have recently augmented the CMake configuration to auto-pull dependencies via find\_package or FetchContent from their source repositories, instead of including a cop…

---

## [cmake 4.3.0 no longer builds with openssl 1.1.x](https://discourse.cmake.org/t/cmake-4-3-0-no-longer-builds-with-openssl-1-1-x/15567)

<div class="topic-metadata">

**Author:** [@Lieven](https://discourse.cmake.org/u/Lieven)\
**Replies:** 2\
**Last updated:** [March 20, 2026, 9:09pm UTC](https://discourse.cmake.org/t/cmake-4-3-0-no-longer-builds-with-openssl-1-1-x/15567 "2026-03-20T21:09:27Z")

</div>

On some older systems, where package managers don’t have openssl 3.x, I can easily build openssl 3.x myself. Is there a way in the bootstrap stage (or later) of building cmake to make it point to that self build location…

---

## [Problem with \*general\* library name](https://discourse.cmake.org/t/problem-with-general-library-name/15559)

<div class="topic-metadata">

**Author:** [@vvs31415](https://discourse.cmake.org/u/vvs31415)\
**Replies:** 10\
**Last updated:** [March 17, 2026, 7:26pm UTC](https://discourse.cmake.org/t/problem-with-general-library-name/15559 "2026-03-17T19:26:43Z")

</div>

The following project builds successfully: // foo.cpp void foo() {} // bar.cpp void foo(); void main() { foo(); } project(p) add\_library(general foo.cpp) link\_libraries(general) add\_executable(foo bar.cpp) Le…

---

## [Problem with CMake when compiling a project with Clang and CUDA support](https://discourse.cmake.org/t/problem-with-cmake-when-compiling-a-project-with-clang-and-cuda-support/11723)

<div class="topic-metadata">

**Author:** [@AAUDI](https://discourse.cmake.org/u/AAUDI)\
**Replies:** 1\
**Last updated:** [March 12, 2026, 5:01pm UTC](https://discourse.cmake.org/t/problem-with-cmake-when-compiling-a-project-with-clang-and-cuda-support/11723 "2026-03-12T17:01:23Z")

</div>

Hello, I’m trying to build an open-source project called VORTEX on Windows using CLANG as the compiler. However, when I run the CMake command, it seems that the NVCC (CUDA) compiler is not being detected. Could you plea…

---

## [add\_custom\_command for OUTPUT that is updated only on change](https://discourse.cmake.org/t/add-custom-command-for-output-that-is-updated-only-on-change/15554)

<div class="topic-metadata">

**Author:** [@Lyubomir\_Filipov](https://discourse.cmake.org/u/Lyubomir_Filipov)\
**Replies:** 0\
**Last updated:** [March 11, 2026, 9:04pm UTC](https://discourse.cmake.org/t/add-custom-command-for-output-that-is-updated-only-on-change/15554 "2026-03-11T21:04:22Z")

</div>

I have the following CMake custom command: add\_custom\_command ( OUTPUT ${outCpp} ${outHpp} ${outBin} COMMAND ${layout-packer-app} -o ${outCpp} -O ${outHpp} -B ${ou…

---

## [CTest errors when collecting coverage results](https://discourse.cmake.org/t/ctest-errors-when-collecting-coverage-results/15553)

<div class="topic-metadata">

**Author:** [@benthevining](https://discourse.cmake.org/u/benthevining)\
**Replies:** 0\
**Last updated:** [March 11, 2026, 8:13pm UTC](https://discourse.cmake.org/t/ctest-errors-when-collecting-coverage-results/15553 "2026-03-11T20:13:05Z")

</div>

When running my CTest dashboard script with coverage flags enabled, it works perfectly for GCC. But for Clang builds, I get output such as: Command produced error: D:/a/BenBot/BenBot/Builds/clang/libbenbot/resources/CMa…

---

## [How to set $PATH for try\_compile runs, and during build?](https://discourse.cmake.org/t/how-to-set-path-for-try-compile-runs-and-during-build/10256)

<div class="topic-metadata">

**Author:** [@garyo](https://discourse.cmake.org/u/garyo)\
**Replies:** 4\
**Last updated:** [March 11, 2026, 3:53pm UTC](https://discourse.cmake.org/t/how-to-set-path-for-try-compile-runs-and-during-build/10256 "2026-03-11T15:53:11Z")

</div>

I’m trying to use CUDA with clang-cl (or just plain cl.exe) on Windows, using Mark Schofield’s Windows toolchain. The toolchain finds cl.exe, but then when CMake tries to find CUDA it fails, because nvcc can’t find compi…

---

## [CMAKE\_CUDA\_FLAGS passed to linking operations?](https://discourse.cmake.org/t/cmake-cuda-flags-passed-to-linking-operations/15540)

<div class="topic-metadata">

**Author:** [@mblanchard](https://discourse.cmake.org/u/mblanchard)\
**Replies:** 1\
**Last updated:** [March 5, 2026, 10:44am UTC](https://discourse.cmake.org/t/cmake-cuda-flags-passed-to-linking-operations/15540 "2026-03-05T10:44:48Z")

</div>

Upgrading from CMake 3.29.2 to 4.2.2, and building CPU and GPU code with Clang, it seems like CMAKE\_CUDA\_FLAGS are now pass to linking operations with 4.2.2, while they were not (at least with our setup) with 3.29.2. We …

---

## [Is it a CMake bug if setting C++ standard on a dependency is required?](https://discourse.cmake.org/t/is-it-a-cmake-bug-if-setting-c-standard-on-a-dependency-is-required/15536)

<div class="topic-metadata">

**Author:** [@benthevining](https://discourse.cmake.org/u/benthevining)\
**Replies:** 4\
**Last updated:** [March 3, 2026, 9:35pm UTC](https://discourse.cmake.org/t/is-it-a-cmake-bug-if-setting-c-standard-on-a-dependency-is-required/15536 "2026-03-03T21:35:33Z")

</div>

In one of my projects, I recently removed \`set(CMAKE\_CXX\_STANDARD 23)\` from the top-level cmakelists, instead setting a compile feature on the appropriate targets. My unit test executable that depends on Catch2 failed w…

---

## [error when building the project saying "cmake version 3.26.4-msvc4"](https://discourse.cmake.org/t/error-when-building-the-project-saying-cmake-version-3-26-4-msvc4/15531)

<div class="topic-metadata">

**Author:** [@tomcy](https://discourse.cmake.org/u/tomcy)\
**Replies:** 0\
**Last updated:** [February 26, 2026, 11:09am UTC](https://discourse.cmake.org/t/error-when-building-the-project-saying-cmake-version-3-26-4-msvc4/15531 "2026-02-26T11:09:30Z")

</div>

Sometimes when I run a CMake project, an error is reported: “Severity Code Description Project File Line Suppression State” Error: cmake version 3.26.4-msvc4 “Sometimes, deleting and regenerating the ‘out’ directory re…

---

## [Module library is installed to LIBRARY instead of RUNTIME](https://discourse.cmake.org/t/module-library-is-installed-to-library-instead-of-runtime/8388)

<div class="topic-metadata">

**Author:** [@phbasler](https://discourse.cmake.org/u/phbasler)\
**Replies:** 6\
**Last updated:** [February 25, 2026, 8:12pm UTC](https://discourse.cmake.org/t/module-library-is-installed-to-library-instead-of-runtime/8388 "2026-02-25T20:12:57Z")

</div>

In my CMakeLists I have the following code segment add\_library(myModule MODULE) install( TARGETS myModule LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) add \_library(mySharedLib SHARED) install( TARGETS m…

---

## [CMake Renesas Support: Linker invokation command not working.](https://discourse.cmake.org/t/cmake-renesas-support-linker-invokation-command-not-working/15530)

<div class="topic-metadata">

**Author:** [@jbrl](https://discourse.cmake.org/u/jbrl)\
**Replies:** 0\
**Last updated:** [February 25, 2026, 2:47pm UTC](https://discourse.cmake.org/t/cmake-renesas-support-linker-invokation-command-not-working/15530 "2026-02-25T14:47:08Z")

</div>

Hello everyone, I am trying to build mbedtls for a renesas mcu and therefore are using the renesas compiler toolchain. I use CMake 4.2.3 and Renesas Toolchain V3.01.00 in a windows environment. I specify the compiler …

---

## ["Cannot find source file" when library is linked to a particular executable](https://discourse.cmake.org/t/cannot-find-source-file-when-library-is-linked-to-a-particular-executable/15527)

<div class="topic-metadata">

**Author:** [@codeling](https://discourse.cmake.org/u/codeling)\
**Replies:** 3\
**Last updated:** [February 24, 2026, 9:32pm UTC](https://discourse.cmake.org/t/cannot-find-source-file-when-library-is-linked-to-a-particular-executable/15527 "2026-02-24T21:32:31Z")

</div>

I am in the process of migrating an existing project to CMake. In it, I have several libraries and executables; When I add one of the library targets (let’s say library lib) to the main executable (let’s call it exe), a…

---

## [Profiling with presets](https://discourse.cmake.org/t/profiling-with-presets/15516)

<div class="topic-metadata">

**Author:** [@w124513](https://discourse.cmake.org/u/w124513)\
**Replies:** 2\
**Last updated:** [February 23, 2026, 7:23am UTC](https://discourse.cmake.org/t/profiling-with-presets/15516 "2026-02-23T07:23:41Z")

</div>

Is there a plan to make profiling available through presets?

---

## [Linker error with import std example](https://discourse.cmake.org/t/linker-error-with-import-std-example/14224)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 7\
**Last updated:** [February 20, 2026, 3:07pm UTC](https://discourse.cmake.org/t/linker-error-with-import-std-example/14224 "2026-02-20T15:07:16Z")

</div>

I have this simple main.cxx: import std; int main(int argc, char\* argv\[\]) { if (argc \> 0 && argv\[0\]) { std::string argv0 = argv\[0\]; std::print("program: {}/n", argv0); } return 0; } and this CMakeLists.t…

---

## [Adding the interface of a library to the private include path of another target](https://discourse.cmake.org/t/adding-the-interface-of-a-library-to-the-private-include-path-of-another-target/14896)

<div class="topic-metadata">

**Author:** [@ingolf](https://discourse.cmake.org/u/ingolf)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 2:31pm UTC](https://discourse.cmake.org/t/adding-the-interface-of-a-library-to-the-private-include-path-of-another-target/14896 "2026-02-20T14:31:44Z")

</div>

Hi, is there a built-in method to add the (complete) interface of a library to the private include directories of another target (i.e. the include path used when compiling that target)? Example: lib1: non-INTERFACE\_O…

---

## [CMake 3.29 can not find "compiler set" for Intel ifx](https://discourse.cmake.org/t/cmake-3-29-can-not-find-compiler-set-for-intel-ifx/11712)

<div class="topic-metadata">

**Author:** [@VictorEijkhout](https://discourse.cmake.org/u/VictorEijkhout)\
**Replies:** 4\
**Last updated:** [February 20, 2026, 2:27pm UTC](https://discourse.cmake.org/t/cmake-3-29-can-not-find-compiler-set-for-intel-ifx/11712 "2026-02-20T14:27:30Z")

</div>

CMake Error at /opt/apps/cmake/3.29.5/share/cmake-3.29/Modules/CMakeDetermineFortranCompiler.cmake:33 (message): Could not find compiler set in environment variable FC: ifx. Suggestions?

---

## [C++20 module problems](https://discourse.cmake.org/t/c-20-module-problems/10928)

<div class="topic-metadata">

**Author:** [@Moerten](https://discourse.cmake.org/u/Moerten)\
**Replies:** 4\
**Last updated:** [February 20, 2026, 3:50am UTC](https://discourse.cmake.org/t/c-20-module-problems/10928 "2026-02-20T03:50:45Z")

</div>

Hi, now Fedora 40 was shipped with CMAKE \>= 3.28 I thought it’s time to use the C++20 modules feature. But I am having problems to use it. First after some research I found out it is not allowed any more to use e.g. “-…

---

## [\<LANG\>\_COMPILER\_LAUNCHER does not use the passed list](https://discourse.cmake.org/t/lang-compiler-launcher-does-not-use-the-passed-list/13140)

<div class="topic-metadata">

**Author:** [@JBludau](https://discourse.cmake.org/u/JBludau)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 3:22am UTC](https://discourse.cmake.org/t/lang-compiler-launcher-does-not-use-the-passed-list/13140 "2026-02-20T03:22:24Z")

</div>

I would need a compiler launcher and arguments passed to it. https://cmake.org/cmake/help/latest/prop\_tgt/LANG\_COMPILER\_LAUNCHER.html states that you can pass a semicolon-separated list. Nevertheless if I do, I only get…

[Previous page](https://discourse.cmake.org/c/usage/12.md?page=1)

[Next page](https://discourse.cmake.org/c/usage/12.md?page=3)
