# Usage

**URL:** https://discourse.cmake.org/c/usage/12.md

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

---

## [About the Usage category](https://discourse.cmake.org/t/about-the-usage-category/84)

<div class="topic-metadata">

**Author:** [@kwrobot](https://discourse.cmake.org/u/kwrobot)\
**Replies:** 0\
**Last updated:** [October 21, 2019, 6:21pm UTC](https://discourse.cmake.org/t/about-the-usage-category/84 "2019-10-21T18:21:25Z")

</div>

Post for help running CMake, CTest, or CPack on projects. \[post via email\]

---

## [CDash (my.cdash.org) Forbidden Errors](https://discourse.cmake.org/t/cdash-my-cdash-org-forbidden-errors/15851)

<div class="topic-metadata">

**Author:** [@amadio](https://discourse.cmake.org/u/amadio)\
**Replies:** 0\
**Last updated:** [September 24, 2026, 6:49am UTC](https://discourse.cmake.org/t/cdash-my-cdash-org-forbidden-errors/15851 "2026-09-24T06:49:27Z")

</div>

Hi, as of recently, I believe I’m being erroneously blocked by my.cdash.org This happens on my desktop machine at work (Chrome browser only, works with Firefox) and on my phone, but not at home, where CDash works. Co…

---

## [CMAKE\_INSTALL\_PREFIX vs installDir in a CMake configure preset](https://discourse.cmake.org/t/cmake-install-prefix-vs-installdir-in-a-cmake-configure-preset/15844)

<div class="topic-metadata">

**Author:** [@CsatiZoltan](https://discourse.cmake.org/u/CsatiZoltan)\
**Replies:** 3\
**Last updated:** [September 22, 2026, 10:01pm UTC](https://discourse.cmake.org/t/cmake-install-prefix-vs-installdir-in-a-cmake-configure-preset/15844 "2026-09-22T22:01:30Z")

</div>

I defined a CMake configure preset like this: { "configurePresets": \[ { "name": "base", "displayName": "Base configuration", "cacheVariables": { "CMAKE\_INSTALL\_PREFIX": "install" },…

---

## [CPack error copying files](https://discourse.cmake.org/t/cpack-error-copying-files/15848)

<div class="topic-metadata">

**Author:** [@Wallby](https://discourse.cmake.org/u/Wallby)\
**Replies:** 2\
**Last updated:** [September 23, 2026, 10:54am UTC](https://discourse.cmake.org/t/cpack-error-copying-files/15848 "2026-09-23T10:54:36Z")

</div>

I have set up a .cmake file I intend to use as a template/framework. It is included at the beginning of the top level CMakeLists.txt. The actual project contains more than this (and targets not named example), but this i…

---

## [JUnit Results for Collections of Tests](https://discourse.cmake.org/t/junit-results-for-collections-of-tests/15845)

<div class="topic-metadata">

**Author:** [@kevinyee](https://discourse.cmake.org/u/kevinyee)\
**Replies:** 0\
**Last updated:** [September 21, 2026, 3:53pm UTC](https://discourse.cmake.org/t/junit-results-for-collections-of-tests/15845 "2026-09-21T15:53:24Z")

</div>

My use case is for dotnet test, but I think this topic could apply to any collections of tests. I’m writing a MSTest library that I register with ctest with a COMMAND dotnet test like so: add\_library(MyTestLibrary SHAR…

---

## [Fortran\_PREPROCESS ignored on Linux](https://discourse.cmake.org/t/fortran-preprocess-ignored-on-linux/9105)

<div class="topic-metadata">

**Author:** [@Maarten\_Braakhekke](https://discourse.cmake.org/u/Maarten_Braakhekke)\
**Replies:** 5\
**Last updated:** [September 17, 2026, 3:54pm UTC](https://discourse.cmake.org/t/fortran-preprocess-ignored-on-linux/9105 "2026-09-17T15:54:19Z")

</div>

It seems that the Fortran\_PREPROCESS property is not functioning properly on Linux. The default behavior of CMake on Linux is that source files are not preprocssed and Fortran\_PREPROCESS doesn seem to affect this. I att…

---

## [How to set an alias for a target imported by find\_package?](https://discourse.cmake.org/t/how-to-set-an-alias-for-a-target-imported-by-find-package/15831)

<div class="topic-metadata">

**Author:** [@CsatiZoltan](https://discourse.cmake.org/u/CsatiZoltan)\
**Replies:** 2\
**Last updated:** [September 15, 2026, 8:22am UTC](https://discourse.cmake.org/t/how-to-set-an-alias-for-a-target-imported-by-find-package/15831 "2026-09-15T08:22:47Z")

</div>

When I create my own library target with add\_library, it has an ALIAS option. However, I cannot find similar for libraries imported via find\_package. In my case, I import OpenMP with find\_package(OpenMP COMPONENTS CXX …

---

## [Can't build source for reVC GameCube](https://discourse.cmake.org/t/cant-build-source-for-revc-gamecube/15824)

<div class="topic-metadata">

**Author:** [@x\_orange90\_x](https://discourse.cmake.org/u/x_orange90_x)\
**Replies:** 7\
**Last updated:** [September 10, 2026, 12:38am UTC](https://discourse.cmake.org/t/cant-build-source-for-revc-gamecube/15824 "2026-09-10T00:38:23Z")

</div>

I’m not sure if this is the correct place or if this is allowed here. I have no idea where else to ask this because the internet is void of any success stories building this source. A developer ported GTA VC to GameCube…

---

## [Bad dependency management for custom commands with Unix Makefiles generator](https://discourse.cmake.org/t/bad-dependency-management-for-custom-commands-with-unix-makefiles-generator/15823)

<div class="topic-metadata">

**Author:** [@davide9](https://discourse.cmake.org/u/davide9)\
**Replies:** 1\
**Last updated:** [September 7, 2026, 12:37pm UTC](https://discourse.cmake.org/t/bad-dependency-management-for-custom-commands-with-unix-makefiles-generator/15823 "2026-09-07T12:37:27Z")

</div>

When using “Unix Makefile” generator combined with custom commands and custom targets to generate files, CMake make use of sub-make invocation which doesn’t propagate the dependency tree between custom targets. Give the…

---

## [How to use FASTBuild with multiple targets?](https://discourse.cmake.org/t/how-to-use-fastbuild-with-multiple-targets/15822)

<div class="topic-metadata">

**Author:** [@CsatiZoltan](https://discourse.cmake.org/u/CsatiZoltan)\
**Replies:** 1\
**Last updated:** [September 4, 2026, 10:51pm UTC](https://discourse.cmake.org/t/how-to-use-fastbuild-with-multiple-targets/15822 "2026-09-04T22:51:05Z")

</div>

I tried out the FASTBuild generator with CMake (FASTBuild v1.20 with CMake 4.3.2). My project has multiple targets, which I build with cmake --build build/ By default, CMake builds all the targets, which causes an erro…

---

## [Compiling Shared Library Using External Library, and then Using it on another system.](https://discourse.cmake.org/t/compiling-shared-library-using-external-library-and-then-using-it-on-another-system/15344)

<div class="topic-metadata">

**Author:** [@Vekleon](https://discourse.cmake.org/u/Vekleon)\
**Replies:** 7\
**Last updated:** [September 3, 2026, 7:38pm UTC](https://discourse.cmake.org/t/compiling-shared-library-using-external-library-and-then-using-it-on-another-system/15344 "2026-09-03T19:38:10Z")

</div>

Right now I’m trying to compile a project using an SDK from a service on system A. Currently my shared library compiles fine with this SDK, but when I try to move this library to use on system B, I’m noticing now that it…

---

## [Deduce cmake\_minimum\_required from the features I use](https://discourse.cmake.org/t/deduce-cmake-minimum-required-from-the-features-i-use/15817)

<div class="topic-metadata">

**Author:** [@CsatiZoltan](https://discourse.cmake.org/u/CsatiZoltan)\
**Replies:** 1\
**Last updated:** [September 2, 2026, 2:29am UTC](https://discourse.cmake.org/t/deduce-cmake-minimum-required-from-the-features-i-use/15817 "2026-09-02T02:29:28Z")

</div>

Throughout the documentation, the minimum required CMake version is given. When I create or modify a CMake script, I often forget about the minimum version requirement. Is there a static analysis tool that checks the CMa…

---

## [Testing/simulating a missing dependency](https://discourse.cmake.org/t/testing-simulating-a-missing-dependency/15804)

<div class="topic-metadata">

**Author:** [@ferdnyc](https://discourse.cmake.org/u/ferdnyc)\
**Replies:** 0\
**Last updated:** [August 25, 2026, 7:35am UTC](https://discourse.cmake.org/t/testing-simulating-a-missing-dependency/15804 "2026-08-25T07:35:36Z")

</div>

Say I have a project that includes Bison and Flex code, and therefore relies on FindBISON.cmake and FindFLEX.cmake. (Because, I do.) Say, also, that the project does not REQUIRE those dependencies in the find\_package() c…

---

## [cmake -G Ninja has errors](https://discourse.cmake.org/t/cmake-g-ninja-has-errors/15787)

<div class="topic-metadata">

**Author:** [@SlipBits](https://discourse.cmake.org/u/SlipBits)\
**Replies:** 1\
**Last updated:** [August 19, 2026, 8:48pm UTC](https://discourse.cmake.org/t/cmake-g-ninja-has-errors/15787 "2026-08-19T20:48:29Z")

</div>

cmake 4.2.1 Win11 home (x86-64) Ninja 1.13.1 (windows version) cygwin 3.7.0 I am brand new to cmake. A complete novice. So, if my question is dumb then that tells the truth about me. cmake -G Ninja -B build produ…

---

## [CMake 4.2.1 Detecting C compiler ABI info - failed](https://discourse.cmake.org/t/cmake-4-2-1-detecting-c-compiler-abi-info-failed/15790)

<div class="topic-metadata">

**Author:** [@lostbits](https://discourse.cmake.org/u/lostbits)\
**Replies:** 0\
**Last updated:** [August 17, 2026, 6:57pm UTC](https://discourse.cmake.org/t/cmake-4-2-1-detecting-c-compiler-abi-info-failed/15790 "2026-08-17T18:57:34Z")

</div>

Win11 Pro (x86-64) cygwin 3.7.1 cmake 4.2.1 gcc 17.0.0 IN the first example of the cmake tutorial fails with the error above and as a result code to generate a target is not generated: gmake\[2\]: \*\*\* No rule to make …

---

## [cmake build maps libre](https://discourse.cmake.org/t/cmake-build-maps-libre/15788)

<div class="topic-metadata">

**Author:** [@impetus](https://discourse.cmake.org/u/impetus)\
**Replies:** 3\
**Last updated:** [August 16, 2026, 9:12am UTC](https://discourse.cmake.org/t/cmake-build-maps-libre/15788 "2026-08-16T09:12:41Z")

</div>

I’m building maps libre Linux - MapLibre Native Developer Documentation Having problem with mbgl-core build FAILED: CMakeFiles/mbgl-core.dir/src/mbgl/layout/symbol\_layout.cpp.o ccache /usr/bin/clang++ -DEGL\_NO\_X11 -DM…

---

## [Coverage report formats supported for CDash upload](https://discourse.cmake.org/t/coverage-report-formats-supported-for-cdash-upload/9950)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 6\
**Last updated:** [August 5, 2026, 4:35pm UTC](https://discourse.cmake.org/t/coverage-report-formats-supported-for-cdash-upload/9950 "2026-08-05T16:35:23Z")

</div>

Hello, I could not find documentation on the supported coverage report formats ( like cobertura xml, gcov, lcov etc) or the coverage tools, which can be used with ctest\_coverage to be uploaded to CDash. Where can I fin…

---

## [Comment line for custom target has added leading 1\>](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764)

<div class="topic-metadata">

**Author:** [@Wallby](https://discourse.cmake.org/u/Wallby)\
**Replies:** 3\
**Last updated:** [July 31, 2026, 11:25am UTC](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764 "2026-07-31T11:25:49Z")

</div>

For example: set(name example) add\_executable(${name} ${...}) set(customName customTarget) add\_custom\_target(${customName} COMMENT "#${customName}" COMMAND ${CMAKE\_COMMAND} -E echo $\<TARGET\_FILE…

---

## [Cannot start CMake GUI on Windows 8.1](https://discourse.cmake.org/t/cannot-start-cmake-gui-on-windows-8-1/15763)

<div class="topic-metadata">

**Author:** [@NEOWISE](https://discourse.cmake.org/u/NEOWISE)\
**Replies:** 1\
**Last updated:** [July 29, 2026, 10:18pm UTC](https://discourse.cmake.org/t/cannot-start-cmake-gui-on-windows-8-1/15763 "2026-07-29T22:18:20Z")

</div>

Cannot start CMake GUI on Windows 8.1. It says cannot find d3d12.dll.

---

## [How to add raw binary to be merged?](https://discourse.cmake.org/t/how-to-add-raw-binary-to-be-merged/981)

<div class="topic-metadata">

**Author:** [@eng.fernandosilva](https://discourse.cmake.org/u/eng.fernandosilva)\
**Replies:** 4\
**Last updated:** [July 24, 2026, 6:36am UTC](https://discourse.cmake.org/t/how-to-add-raw-binary-to-be-merged/981 "2026-07-24T06:36:33Z")

</div>

Hi, I’m starting to use CMake and I was wondering if I can mix a raw binary with linking using CMake. This is useful for firmware development and it is used by UEFI tools (EDK2) using scripts. Do we have a custom comma…

---

## [Combine sanitizer check in one single MemCheck analysis](https://discourse.cmake.org/t/combine-sanitizer-check-in-one-single-memcheck-analysis/15658)

<div class="topic-metadata">

**Author:** [@npoletz](https://discourse.cmake.org/u/npoletz)\
**Replies:** 3\
**Last updated:** [July 8, 2026, 3:44pm UTC](https://discourse.cmake.org/t/combine-sanitizer-check-in-one-single-memcheck-analysis/15658 "2026-07-08T15:44:34Z")

</div>

I am currently testing the dynamic analysis with UndefinedBehaviorSanitizer and AddressSanitizer. It works well separately and defects are correctly reported on our dashboard. However I am wondering if there is a way t…

---

## [what's the meaing of this sentence?](https://discourse.cmake.org/t/whats-the-meaing-of-this-sentence/15735)

<div class="topic-metadata">

**Author:** [@yushang](https://discourse.cmake.org/u/yushang)\
**Replies:** 2\
**Last updated:** [July 7, 2026, 8:10am UTC](https://discourse.cmake.org/t/whats-the-meaing-of-this-sentence/15735 "2026-07-07T08:10:02Z")

</div>

Hi guys, in this page https://cmake.org/cmake/help/latest/command/set\_directory\_properties.html there is a sentence Sets properties of the current directory and its subdirectories in key-value pairs. I’m trying to ver…

---

## [about include\_guard](https://discourse.cmake.org/t/about-include-guard/15737)

<div class="topic-metadata">

**Author:** [@yushang](https://discourse.cmake.org/u/yushang)\
**Replies:** 4\
**Last updated:** [July 6, 2026, 1:42pm UTC](https://discourse.cmake.org/t/about-include-guard/15737 "2026-07-06T13:42:17Z")

</div>

Hi guys, I have the following setup CMakeLists.txt list(APPEND CMAKE\_MODULE\_PATH ${CMAKE\_CURRENT\_SOURCE\_DIR}) add\_subdirectory(sub) add\_subdirectory(sub2) tools.cmake include\_guard(DIRECTORY) # A message("tools.cmak…

---

## [Qt 6.10.0 building from sources. GNU C++ compiler error: unrecognized command-line option ‘-R’ while using GCC 14.3.0](https://discourse.cmake.org/t/qt-6-10-0-building-from-sources-gnu-c-compiler-error-unrecognized-command-line-option-r-while-using-gcc-14-3-0/15736)

<div class="topic-metadata">

**Author:** [@mans5647](https://discourse.cmake.org/u/mans5647)\
**Replies:** 0\
**Last updated:** [July 5, 2026, 8:37am UTC](https://discourse.cmake.org/t/qt-6-10-0-building-from-sources-gnu-c-compiler-error-unrecognized-command-line-option-r-while-using-gcc-14-3-0/15736 "2026-07-05T08:37:56Z")

</div>

Hi. I configured QT 6.10.0 from sources using following command: $ ./configure -shared -no-opengl -- -B build/ --fresh After that, It gave me usual and error-free output: -- The CXX compiler identification is GNU 14.3…

---

## [What is a 'head' target?](https://discourse.cmake.org/t/what-is-a-head-target/15630)

<div class="topic-metadata">

**Author:** [@MickeJ](https://discourse.cmake.org/u/MickeJ)\
**Replies:** 1\
**Last updated:** [July 2, 2026, 2:27pm UTC](https://discourse.cmake.org/t/what-is-a-head-target/15630 "2026-07-02T14:27:47Z")

</div>

In the documentation i see reference to a thing name ‘head’ target. What is the definition of a head target? For example if my project only contains one target executable and many libs is the exe target the head target? …

---

## [disabling C++ extensions](https://discourse.cmake.org/t/disabling-c-extensions/15579)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 7\
**Last updated:** [July 1, 2026, 7:33am UTC](https://discourse.cmake.org/t/disabling-c-extensions/15579 "2026-07-01T07:33:39Z")

</div>

I think the topic title is self-explanatory. So far, it seems that set\_target\_properties(${TARGET\_NAME} PROPERTIES CXX\_EXTENSIONS OFF) does nothing more than using -std=c++xx instead of -std=gnu++xx. For gcc I must add…

---

## [add\_library/add\_executable sources do not depend on compiler executable](https://discourse.cmake.org/t/add-library-add-executable-sources-do-not-depend-on-compiler-executable/15662)

<div class="topic-metadata">

**Author:** [@wenju-he](https://discourse.cmake.org/u/wenju-he)\
**Replies:** 4\
**Last updated:** [June 29, 2026, 6:19pm UTC](https://discourse.cmake.org/t/add-library-add-executable-sources-do-not-depend-on-compiler-executable/15662 "2026-06-29T18:19:41Z")

</div>

By default, CMake does not add the compiler executable as a dependency of compiled objects. Sources are rebuilt when they change, but not when the compiler changes. This causes a concrete problem in toolchain bootstrap …

---

## [How to be able to choose Debug or Release build in CMake](https://discourse.cmake.org/t/how-to-be-able-to-choose-debug-or-release-build-in-cmake/15727)

<div class="topic-metadata">

**Author:** [@Maaz\_Madha](https://discourse.cmake.org/u/Maaz_Madha)\
**Replies:** 1\
**Last updated:** [June 25, 2026, 3:17pm UTC](https://discourse.cmake.org/t/how-to-be-able-to-choose-debug-or-release-build-in-cmake/15727 "2026-06-25T15:17:46Z")

</div>

Hi all How do I configure build or debug releases for a multi directory project, cross compiling project with CMakeLists.txt for each of the directories. Do I do this in CMakePresets.json or pass it as a command, and i…

---

## [CPS doesn't work with Boost::headers](https://discourse.cmake.org/t/cps-doesnt-work-with-boost-headers/15720)

<div class="topic-metadata">

**Author:** [@Yanzhao\_Wang](https://discourse.cmake.org/u/Yanzhao_Wang)\
**Replies:** 4\
**Last updated:** [June 25, 2026, 1:30pm UTC](https://discourse.cmake.org/t/cps-doesnt-work-with-boost-headers/15720 "2026-06-25T13:30:17Z")

</div>

Hi, I have a project which uses the Boost library through the target Boost::headers . I really like the idea of CPS and I would like to use it to install the project. But I encountered a configuration error: CMake Erro…

---

## [For posterity: another of these CMake "hacks" — No CMAKE\_C\_COMPILER could be found.](https://discourse.cmake.org/t/for-posterity-another-of-these-cmake-hacks-no-cmake-c-compiler-could-be-found/15721)

<div class="topic-metadata">

**Author:** [@exoosh](https://discourse.cmake.org/u/exoosh)\
**Replies:** 9\
**Last updated:** [June 23, 2026, 3:15pm UTC](https://discourse.cmake.org/t/for-posterity-another-of-these-cmake-hacks-no-cmake-c-compiler-could-be-found/15721 "2026-06-23T15:15:57Z")

</div>

So, CMake seems incapable of passing through /pdbaltpath:%\_PDB% when given in a CMakeLists.txt (first learning). It somehow ends up as %%%%\_PDB%%%% which then will evaluate — assuming a foobar.exe — to %%%foobar.pdb%%% i…

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