# Usage

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

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

**Page:** 4

---

## [Custom language with single-step compilation, dyndep sources only](https://discourse.cmake.org/t/custom-language-with-single-step-compilation-dyndep-sources-only/13769)

<div class="topic-metadata">

**Author:** [@MathiasMagnus](https://discourse.cmake.org/u/MathiasMagnus)\
**Replies:** 10\
**Last updated:** [February 20, 2026, 3:16am UTC](https://discourse.cmake.org/t/custom-language-with-single-step-compilation-dyndep-sources-only/13769 "2026-02-20T03:16:37Z")

</div>

I’m trying to capture a toolchain, which as its CLI takes a folder, and processes all JSONs in it which match a glob expression. All the JSONs (which reference a few external files) are then compiled into a singular bina…

---

## [Correctly exporting configuration](https://discourse.cmake.org/t/correctly-exporting-configuration/11042)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 11\
**Last updated:** [February 20, 2026, 3:15am UTC](https://discourse.cmake.org/t/correctly-exporting-configuration/11042 "2026-02-20T03:15:03Z")

</div>

When looking closely at https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20Export%20Configuration.html, I realize that I don’t seem to follow the logic of this tutorial. I’d appreciate a review of my procedure (…

---

## [Incorporating Intel OneAPI into a mixed language cmake project](https://discourse.cmake.org/t/incorporating-intel-oneapi-into-a-mixed-language-cmake-project/15182)

<div class="topic-metadata">

**Author:** [@DonRobinson](https://discourse.cmake.org/u/DonRobinson)\
**Replies:** 2\
**Last updated:** [February 20, 2026, 3:07am UTC](https://discourse.cmake.org/t/incorporating-intel-oneapi-into-a-mixed-language-cmake-project/15182 "2026-02-20T03:07:26Z")

</div>

I am trying to upgrade a mixed language (C, CXX, Fortran) cmake project originally developed for Visual Studio 2010 with Intel 2011 using cmake 2.8.12, which has worked for a long time! Fast forward ten years. Without un…

---

## [Passing list of libraries to ExternalProject\_Add](https://discourse.cmake.org/t/passing-list-of-libraries-to-externalproject-add/13205)

<div class="topic-metadata">

**Author:** [@ramcdona](https://discourse.cmake.org/u/ramcdona)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 2:49am UTC](https://discourse.cmake.org/t/passing-list-of-libraries-to-externalproject-add/13205 "2026-02-20T02:49:16Z")

</div>

I need to use two different compilers to build my entire project. This is because part of the project needs OpenMP support, but the primary compilers for some of the platforms do not have good OpenMP support. To do thi…

---

## [FindICU.cmake and the --with-library-suffix configure parameter](https://discourse.cmake.org/t/findicu-cmake-and-the-with-library-suffix-configure-parameter/14321)

<div class="topic-metadata">

**Author:** [@ADKaster](https://discourse.cmake.org/u/ADKaster)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 2:33am UTC](https://discourse.cmake.org/t/findicu-cmake-and-the-with-library-suffix-configure-parameter/14321 "2026-02-20T02:33:59Z")

</div>

I’m building an application that both relies on qt6 and ICU4C on Linux/non-macOS Unix. My application must be kept up to date with the latest icu releases, regardless of what ends up bundled with Qt. When building with…

---

## [shm\_open in rt - not found when trying to install a library using CMake](https://discourse.cmake.org/t/shm-open-in-rt-not-found-when-trying-to-install-a-library-using-cmake/15303)

<div class="topic-metadata">

**Author:** [@Claas\_Machens](https://discourse.cmake.org/u/Claas_Machens)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 2:30am UTC](https://discourse.cmake.org/t/shm-open-in-rt-not-found-when-trying-to-install-a-library-using-cmake/15303 "2026-02-20T02:30:50Z")

</div>

I am new to CMake. I wanted to Install the OpenFHE library, which instructs to use CMake to do so. (The Library states it is tested and build on MinGW (64-bit) on Windows 10, while I use MinGW64 on Windows 11, but I hope…

---

## [CMake tutorial step4 code has no effect when setting cxx\_std\_98](https://discourse.cmake.org/t/cmake-tutorial-step4-code-has-no-effect-when-setting-cxx-std-98/13773)

<div class="topic-metadata">

**Author:** [@Kruno\_Peric](https://discourse.cmake.org/u/Kruno_Peric)\
**Replies:** 5\
**Last updated:** [February 19, 2026, 9:44pm UTC](https://discourse.cmake.org/t/cmake-tutorial-step4-code-has-no-effect-when-setting-cxx-std-98/13773 "2026-02-19T21:44:27Z")

</div>

When i use CMake on my ubuntu machine (it is cmake version 3.28.3) and i download the Step4 tutorial code for the tutorial on the CMake website, changing cxx\_std\_11 to cxx\_std\_98 has no effect, but it should throw a comp…

---

## [How do I list components available with \`cmake --install . --component ...\`?](https://discourse.cmake.org/t/how-do-i-list-components-available-with-cmake-install-component/13982)

<div class="topic-metadata">

**Author:** [@exoosh](https://discourse.cmake.org/u/exoosh)\
**Replies:** 1\
**Last updated:** [February 17, 2026, 7:57pm UTC](https://discourse.cmake.org/t/how-do-i-list-components-available-with-cmake-install-component/13982 "2026-02-17T19:57:07Z")

</div>

So I have a top-level CMakeLists.txt authored by “us” (our company) and plenty of subordinate CMakeLists.txt files which were mostly not authored by us. Most of these contain an install(). Seemingly dozens if not hundre…

---

## [failed to generate fastbuild](https://discourse.cmake.org/t/failed-to-generate-fastbuild/15378)

<div class="topic-metadata">

**Author:** [@TimeLooper](https://discourse.cmake.org/u/TimeLooper)\
**Replies:** 2\
**Last updated:** [February 15, 2026, 10:54pm UTC](https://discourse.cmake.org/t/failed-to-generate-fastbuild/15378 "2026-02-15T22:54:14Z")

</div>

CMake Error at C:/Program Files/CMake/share/cmake-4.2/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x…

---

## [\`CMAKE\_PROJECT\_TOP\_LEVEL\_INCLUDES\` and \`CMAKE\_TOOLCHAIN\_FILE\`](https://discourse.cmake.org/t/cmake-project-top-level-includes-and-cmake-toolchain-file/15463)

<div class="topic-metadata">

**Author:** [@planetmarshall](https://discourse.cmake.org/u/planetmarshall)\
**Replies:** 5\
**Last updated:** [February 14, 2026, 10:28pm UTC](https://discourse.cmake.org/t/cmake-project-top-level-includes-and-cmake-toolchain-file/15463 "2026-02-14T22:28:28Z")

</div>

During the discussion about implementing CMAKE\_PROJECT\_TOP\_LEVEL\_INCLUDES (https://gitlab.kitware.com/cmake/cmake/-/issues/22619) there was some discussion on whether the includes should be read before or after the toolc…

---

## [Dynamic Analysis with tools other than valgrind](https://discourse.cmake.org/t/dynamic-analysis-with-tools-other-than-valgrind/15507)

<div class="topic-metadata">

**Author:** [@amadio](https://discourse.cmake.org/u/amadio)\
**Replies:** 1\
**Last updated:** [February 14, 2026, 4:29am UTC](https://discourse.cmake.org/t/dynamic-analysis-with-tools-other-than-valgrind/15507 "2026-02-14T04:29:07Z")

</div>

I have setup XRootD to use various sanitizers by setting the appropriate memory check tool, like this: However, when I run the tests and they pass, I get annoying messages about the output of the memory checker not be…

---

## [Propagation of compile definitions](https://discourse.cmake.org/t/propagation-of-compile-definitions/15386)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 10\
**Last updated:** [February 9, 2026, 2:47pm UTC](https://discourse.cmake.org/t/propagation-of-compile-definitions/15386 "2026-02-09T14:47:39Z")

</div>

Hi, I’ve got a static library target L where I do: target\_compile\_definitions(L PUBLIC SOMESYMBOL) In an application A, I’m linking against L: target\_link\_library(A PRIVATE L) I’m then expecting A to inherit SOMESYM…

---

## [add\_custom\_custom multiple output and multiple directories.](https://discourse.cmake.org/t/add-custom-custom-multiple-output-and-multiple-directories/15474)

<div class="topic-metadata">

**Author:** [@pcanal](https://discourse.cmake.org/u/pcanal)\
**Replies:** 2\
**Last updated:** [February 9, 2026, 12:46pm UTC](https://discourse.cmake.org/t/add-custom-custom-multiple-output-and-multiple-directories/15474 "2026-02-09T12:46:10Z")

</div>

Hi, We have a situation where for each libraries of our project we need to call an executable that generates: a source file that is compiled and included in the library an auxiliary pcm file (similar to a C++ precompi…

---

## [HDF5 2.0 has breaking changes - cmake doesn't set the \`HDF5\_IS\_PARALLEL\` variable anymore](https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444)

<div class="topic-metadata">

**Author:** [@cphyc](https://discourse.cmake.org/u/cphyc)\
**Replies:** 3\
**Last updated:** [February 9, 2026, 10:10am UTC](https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444 "2026-02-09T10:10:34Z")

</div>

Detection of MPI support in HDF5 worked with HDF5\<2.0.0. With the recent release of HDF5 2.0.0 ( ​Release of HDF5 2.0.0 (Newsletter #207) - The HDF Group - ensuring long-term access and usability of HDF data and supporti…

---

## [Disable manifest on Windows when using clang](https://discourse.cmake.org/t/disable-manifest-on-windows-when-using-clang/15421)

<div class="topic-metadata">

**Author:** [@TheNicker](https://discourse.cmake.org/u/TheNicker)\
**Replies:** 1\
**Last updated:** [February 9, 2026, 5:31am UTC](https://discourse.cmake.org/t/disable-manifest-on-windows-when-using-clang/15421 "2026-02-09T05:31:05Z")

</div>

I’m using CMake 4.2.1 on Windows with clang (not clang-cl) In my project I embed a custom manifest, but -Xlinker /MANIFEST:EMBED is kept added to my link command resulting in duplicate manifest. I was trying to replace…

---

## [Passing flags to custom commands with generator expressions](https://discourse.cmake.org/t/passing-flags-to-custom-commands-with-generator-expressions/15416)

<div class="topic-metadata">

**Author:** [@roelandschoukens](https://discourse.cmake.org/u/roelandschoukens)\
**Replies:** 6\
**Last updated:** [February 9, 2026, 5:28am UTC](https://discourse.cmake.org/t/passing-flags-to-custom-commands-with-generator-expressions/15416 "2026-02-09T05:28:51Z")

</div>

Given a command our\_tool that we want to run as a custom target, and we want a flag --debug in debug builds only: Some sources say you add a generator expression with quotes like this: ADD\_CUSTOM\_TARGET(our\_tool\_co…

---

## [CMake is working wierdly in terms of searching and adding libraries](https://discourse.cmake.org/t/cmake-is-working-wierdly-in-terms-of-searching-and-adding-libraries/15399)

<div class="topic-metadata">

**Author:** [@soumyadghosh](https://discourse.cmake.org/u/soumyadghosh)\
**Replies:** 2\
**Last updated:** [February 9, 2026, 5:18am UTC](https://discourse.cmake.org/t/cmake-is-working-wierdly-in-terms-of-searching-and-adding-libraries/15399 "2026-02-09T05:18:27Z")

</div>

I am building openboard from source, with an SDK for Qt libraries and building poppler from the latest release. Now, while compiling openboard it looks for poppler and finds the correct poppler==25.12 using pkg-configwhi…

---

## [cmake 3.31.10 fails to unzip using '-E tar xjf' in vcpkg](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387)

<div class="topic-metadata">

**Author:** [@theoractice](https://discourse.cmake.org/u/theoractice)\
**Replies:** 4\
**Last updated:** [February 9, 2026, 5:15am UTC](https://discourse.cmake.org/t/cmake-3-31-10-fails-to-unzip-using-e-tar-xjf-in-vcpkg/15387 "2026-02-09T05:15:57Z")

</div>

vcpkg’s Error message: Command failed: D:/Coding/vcpkg/downloads/tools/cmake-3.31.10-windows/cmake-3.31.10-windows-x86\_64/bin/cmake.exe -E tar xjf D:/Coding/vcpkg/downloads/microsoft-onnxruntime-v1.23.2.tar.gz See the …

---

## [Still needing those administrative privileges](https://discourse.cmake.org/t/still-needing-those-administrative-privileges/15374)

<div class="topic-metadata">

**Author:** [@grafl](https://discourse.cmake.org/u/grafl)\
**Replies:** 1\
**Last updated:** [February 9, 2026, 5:06am UTC](https://discourse.cmake.org/t/still-needing-those-administrative-privileges/15374 "2026-02-09T05:06:51Z")

</div>

Hi, my issue is quite simple, it generates the buildsystem for a custom library and an executable. cmake\_minimum\_required(VERSION 4.0) project(my\_library LANGUAGES C VERSION 0.0.1) include(cmake/ResolveDependencies.cma…

---

## [CMake 4.0+ treats \\" in path end as escaped quote on Windows](https://discourse.cmake.org/t/cmake-4-0-treats-in-path-end-as-escaped-quote-on-windows/15487)

<div class="topic-metadata">

**Author:** [@Wovchena](https://discourse.cmake.org/u/Wovchena)\
**Replies:** 2\
**Last updated:** [February 3, 2026, 2:51pm UTC](https://discourse.cmake.org/t/cmake-4-0-treats-in-path-end-as-escaped-quote-on-windows/15487 "2026-02-03T14:51:36Z")

</div>

Create build.bat in cmake-4.2.3-tutorial-source\\Step0 downloaded from https://cmake.org/cmake/help/latest/guide/tutorial/index.html with the following content set "SAMPLES\_SOURCE\_DIR=%~dp0" cmake "%SAMPLES\_SOURCE\_DIR%" …

---

## [cmake 4.2.2 not able to detect VS2026 outside 'developer command prompt'?](https://discourse.cmake.org/t/cmake-4-2-2-not-able-to-detect-vs2026-outside-developer-command-prompt/15478)

<div class="topic-metadata">

**Author:** [@Andre\_Weissflog](https://discourse.cmake.org/u/Andre_Weissflog)\
**Replies:** 1\
**Last updated:** [February 1, 2026, 11:56am UTC](https://discourse.cmake.org/t/cmake-4-2-2-not-able-to-detect-vs2026-outside-developer-command-prompt/15478 "2026-02-01T11:56:26Z")

</div>

Good day. When setting up a new Win11 dev machine with VS2026 Community Edition I’m running into trouble that cmake doesn’t seem to be able to detect Visual Studio (specifically VS2026) unless it’s running inside the ‘Vi…

---

## [Including CGAL 6.1.1 via CPM](https://discourse.cmake.org/t/including-cgal-6-1-1-via-cpm/15490)

<div class="topic-metadata">

**Author:** [@Shepard](https://discourse.cmake.org/u/Shepard)\
**Replies:** 0\
**Last updated:** [February 1, 2026, 11:34am UTC](https://discourse.cmake.org/t/including-cgal-6-1-1-via-cpm/15490 "2026-02-01T11:34:58Z")

</div>

Hi, So I want to add CGAL v6.1.1 to my cmake/c++ project. For all other libraries, I’m using CPM, so my approach was to do the same with CGAL. Therefore, I added CPMAddPackage( NAME CGAL GITHUB\_REPOSITORY CGAL…

---

## [For large projects, is single CMakeLists.txt is preferred or multiple CMakeLists.txt via add\_subdirectories](https://discourse.cmake.org/t/for-large-projects-is-single-cmakelists-txt-is-preferred-or-multiple-cmakelists-txt-via-add-subdirectories/15469)

<div class="topic-metadata">

**Author:** [@siddmohsin](https://discourse.cmake.org/u/siddmohsin)\
**Replies:** 4\
**Last updated:** [January 29, 2026, 12:32pm UTC](https://discourse.cmake.org/t/for-large-projects-is-single-cmakelists-txt-is-preferred-or-multiple-cmakelists-txt-via-add-subdirectories/15469 "2026-01-29T12:32:25Z")

</div>

Hello All, Currently in my project we are maintaining a single CMakeLists.txt where in we are keeping lots of targets for all our layers. Our project is setup as a layered architecture where in whole projects is divided…

---

## [Problem when setting CMAKE\_MAKE\_PROGRAM in toolchain file](https://discourse.cmake.org/t/problem-when-setting-cmake-make-program-in-toolchain-file/15471)

<div class="topic-metadata">

**Author:** [@dareg](https://discourse.cmake.org/u/dareg)\
**Replies:** 2\
**Last updated:** [January 28, 2026, 2:27pm UTC](https://discourse.cmake.org/t/problem-when-setting-cmake-make-program-in-toolchain-file/15471 "2026-01-28T14:27:34Z")

</div>

Hello, I am trying to set the CMAKE\_MAKE\_PROGRAM to a specific binary with a toolchain file. But when running cmake it fails with a strange message. Is there something specific I am missing, or is it just a bug I should…

---

## [The FindGTest.cmake module does not respect the version parameter?](https://discourse.cmake.org/t/the-findgtest-cmake-module-does-not-respect-the-version-parameter/15476)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 2\
**Last updated:** [January 24, 2026, 9:39pm UTC](https://discourse.cmake.org/t/the-findgtest-cmake-module-does-not-respect-the-version-parameter/15476 "2026-01-24T21:39:33Z")

</div>

bash-5.3$ cmake -S . -B build --log-level=DEBUG --fresh -- The C compiler identification is AppleClang 16.0.0.16000026 -- The CXX compiler identification is AppleClang 16.0.0.16000026 -- Detecting C compiler ABI info -- …

---

## [Visual Studio: select /std:c++23preview or /std:c++latest ?](https://discourse.cmake.org/t/visual-studio-select-std-c-23preview-or-std-c-latest/15456)

<div class="topic-metadata">

**Author:** [@johan556](https://discourse.cmake.org/u/johan556)\
**Replies:** 1\
**Last updated:** [January 21, 2026, 2:44pm UTC](https://discourse.cmake.org/t/visual-studio-select-std-c-23preview-or-std-c-latest/15456 "2026-01-21T14:44:52Z")

</div>

How do I select among the options /std:c++23preview and /std:c++latest in Visual Studio. I currently have: set(CMAKE\_CXX\_STANDARD 23) set(CMAKE\_CXX\_EXTENSIONS OFF) set(CMAKE\_CXX\_STANDARD\_REQUIRED ON) and this results …

---

## [LINK\_LIBRARY generator expression with WHOLE\_ARCHIVE doesn't work with exported/imported targets](https://discourse.cmake.org/t/link-library-generator-expression-with-whole-archive-doesnt-work-with-exported-imported-targets/15448)

<div class="topic-metadata">

**Author:** [@pavard](https://discourse.cmake.org/u/pavard)\
**Replies:** 10\
**Last updated:** [January 17, 2026, 9:29pm UTC](https://discourse.cmake.org/t/link-library-generator-expression-with-whole-archive-doesnt-work-with-exported-imported-targets/15448 "2026-01-17T21:29:02Z")

</div>

Context of the Problem We are creating a DPDK package using CMake that exports targets with a namespace prefix (e.g., dpdk::libeal, dpdk::libmempool\_ring). Some DPDK libraries (for example, mempool\_ring and mempool\_stack)…

---

## [Effective order of include directories and compile options in complex scenarios](https://discourse.cmake.org/t/effective-order-of-include-directories-and-compile-options-in-complex-scenarios/15097)

<div class="topic-metadata">

**Author:** [@Adam\_Badura](https://discourse.cmake.org/u/Adam_Badura)\
**Replies:** 7\
**Last updated:** [January 17, 2026, 4:10am UTC](https://discourse.cmake.org/t/effective-order-of-include-directories-and-compile-options-in-complex-scenarios/15097 "2026-01-17T04:10:42Z")

</div>

Is there any guarantee on the order of arguments to the compiler when compiling a file? There are many places where they can be set and while sometimes the documentation provides hints on order, I have an impression the …

---

## [MSVC 18 support](https://discourse.cmake.org/t/msvc-18-support/15446)

<div class="topic-metadata">

**Author:** [@Ravenwater](https://discourse.cmake.org/u/Ravenwater)\
**Replies:** 2\
**Last updated:** [January 8, 2026, 12:31am UTC](https://discourse.cmake.org/t/msvc-18-support/15446 "2026-01-08T00:31:24Z")

</div>

I just installed MSVC 18, but my CMake v3.31.6 is not seeing it. Not finding any coherent documentation that explains what is going on. Is anyone generating MSVC 18 solution files with their CMake?

---

## [Module for Large File Size system support detection?](https://discourse.cmake.org/t/module-for-large-file-size-system-support-detection/830)

<div class="topic-metadata">

**Author:** [@starseeker](https://discourse.cmake.org/u/starseeker)\
**Replies:** 7\
**Last updated:** [January 1, 2026, 9:10pm UTC](https://discourse.cmake.org/t/module-for-large-file-size-system-support-detection/830 "2026-01-01T21:10:14Z")

</div>

Hi! We’re looking for a good C/C++/CMake solution for sorting out what the correct/best set of functions and file types is for off\_t/off64\_t/\_off64\_t and friends. (fseek,fstat,ftell, and their myriad 32/64/platform-spe…

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

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