# Usage

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

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

**Page:** 14

---

## [Customizing linker and redirecting the STDIO to a file](https://discourse.cmake.org/t/customizing-linker-and-redirecting-the-stdio-to-a-file/9217)

<div class="topic-metadata">

**Author:** [@ChristophR](https://discourse.cmake.org/u/ChristophR)\
**Replies:** 7\
**Last updated:** [March 21, 2025, 8:40am UTC](https://discourse.cmake.org/t/customizing-linker-and-redirecting-the-stdio-to-a-file/9217 "2025-03-21T08:40:39Z")

</div>

Hi, I am using an ancient WindRiver diab compiler / linker. I managed to configure the toolchain so it properly finds the commands. My problem now is that the linker outputs the map file to the stdio, only. So, as simpl…

---

## [Helping colleagues familiar with make come over to cmake](https://discourse.cmake.org/t/helping-colleagues-familiar-with-make-come-over-to-cmake/13747)

<div class="topic-metadata">

**Author:** [@sketch34](https://discourse.cmake.org/u/sketch34)\
**Replies:** 1\
**Last updated:** [March 20, 2025, 3:22pm UTC](https://discourse.cmake.org/t/helping-colleagues-familiar-with-make-come-over-to-cmake/13747 "2025-03-20T15:22:17Z")

</div>

I’ve converted a large production codebase from make to cmake. It is structured as a top level CMakeLists.txt that does add\_subdirectory() for the numerous subprojects. Individual projects can be built like this per nor…

---

## [How to fix warnings on foreing path for file GET\_RUNTIME\_DEPENDENCIES](https://discourse.cmake.org/t/how-to-fix-warnings-on-foreing-path-for-file-get-runtime-dependencies/13781)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 1\
**Last updated:** [March 20, 2025, 12:33pm UTC](https://discourse.cmake.org/t/how-to-fix-warnings-on-foreing-path-for-file-get-runtime-dependencies/13781 "2025-03-20T12:33:40Z")

</div>

Hi, I used install(RUNTIME\_DEPENDENCY\_SET to install my binary and its dependencies. It depends on multiple other libs coming from other packages so it is not installed to /usr/lib (or similar). The warning mentioned i…

---

## [Cmake cannot locate VTK, VTK installation incomplete, VTK and paraview conflict](https://discourse.cmake.org/t/cmake-cannot-locate-vtk-vtk-installation-incomplete-vtk-and-paraview-conflict/13780)

<div class="topic-metadata">

**Author:** [@AP76](https://discourse.cmake.org/u/AP76)\
**Replies:** 1\
**Last updated:** [March 19, 2025, 12:14pm UTC](https://discourse.cmake.org/t/cmake-cannot-locate-vtk-vtk-installation-incomplete-vtk-and-paraview-conflict/13780 "2025-03-19T12:14:27Z")

</div>

Dear all, I’m currently using debian distribution. I encounter an issue when running cmake with a preset using cmake --preset release. I proceed to the build configuration step. However, when configuring with a preset, …

---

## [VTK libraries not found](https://discourse.cmake.org/t/vtk-libraries-not-found/10987)

<div class="topic-metadata">

**Author:** [@gibbogle](https://discourse.cmake.org/u/gibbogle)\
**Replies:** 1\
**Last updated:** [March 19, 2025, 11:31am UTC](https://discourse.cmake.org/t/vtk-libraries-not-found/10987 "2025-03-19T11:31:35Z")

</div>

I am building a program with VS 2010. This uses ITK-4.8, and VTK-5.10. The error messages tell me that the VTK package is not found: F:\\vessel-tools\\cut\>cmake CMakelists.txt -G “Visual Studio 10 Win64” CMake Error at…

---

## [Presets use NUMBER\_OF\_PROCESSORS for number of parallel jobs](https://discourse.cmake.org/t/presets-use-number-of-processors-for-number-of-parallel-jobs/4989)

<div class="topic-metadata">

**Author:** [@JuliusCaesar](https://discourse.cmake.org/u/JuliusCaesar)\
**Replies:** 4\
**Last updated:** [March 15, 2025, 2:54pm UTC](https://discourse.cmake.org/t/presets-use-number-of-processors-for-number-of-parallel-jobs/4989 "2025-03-15T14:54:10Z")

</div>

Hey guys, I’m starting to use the CMakePresets.json Now for the TestPresets and the BuildPresets we can specify an optional number of build jobs. I’d like to run all build with the current number of available processo…

---

## [RSP files equivalent when using Unix Makefiles](https://discourse.cmake.org/t/rsp-files-equivalent-when-using-unix-makefiles/11039)

<div class="topic-metadata">

**Author:** [@AntoineN](https://discourse.cmake.org/u/AntoineN)\
**Replies:** 3\
**Last updated:** [March 14, 2025, 5:52pm UTC](https://discourse.cmake.org/t/rsp-files-equivalent-when-using-unix-makefiles/11039 "2025-03-14T17:52:05Z")

</div>

Hello, I’m working on a project with CMake, using Ninja generator. I have a post build command to “include” a CRC in the generated binary. It make a 2nd link including the CRC. The command use the .rsp file to have the …

---

## [ctest\_upload functionality](https://discourse.cmake.org/t/ctest-upload-functionality/10919)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 2\
**Last updated:** [March 14, 2025, 3:53pm UTC](https://discourse.cmake.org/t/ctest-upload-functionality/10919 "2025-03-14T15:53:10Z")

</div>

Hello, Could be a simple question this, where can i find the file uploaded using ctest\_upload() in the cdash dashboard? I can see that ctest\_upload() call returns successfully, but I cant seem to find the file in the da…

---

## [Default user name and password for cdash](https://discourse.cmake.org/t/default-user-name-and-password-for-cdash/10866)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 2\
**Last updated:** [March 14, 2025, 3:44pm UTC](https://discourse.cmake.org/t/default-user-name-and-password-for-cdash/10866 "2025-03-14T15:44:37Z")

</div>

Hello, This maybe a stupid question, Just started experimenting with CDash instances, what would be the default user name and password, which can be used to login to an instance, which doesnot have ldap. Also it is not …

---

## [Failing to detect ABI](https://discourse.cmake.org/t/failing-to-detect-abi/13746)

<div class="topic-metadata">

**Author:** [@j2inet](https://discourse.cmake.org/u/j2inet)\
**Replies:** 1\
**Last updated:** [March 14, 2025, 3:18pm UTC](https://discourse.cmake.org/t/failing-to-detect-abi/13746 "2025-03-14T15:18:16Z")

</div>

I’ve just compiled the latest version of the Clang tools, and I’m trying to make a simple “Hello World” on Windows with Clang and Cmake. Cmake is returning to me an error about being unable to detect the ABI interface. T…

---

## [Supress warnings for external sources with modules](https://discourse.cmake.org/t/supress-warnings-for-external-sources-with-modules/13752)

<div class="topic-metadata">

**Author:** [@mrwsl](https://discourse.cmake.org/u/mrwsl)\
**Replies:** 0\
**Last updated:** [March 14, 2025, 6:23am UTC](https://discourse.cmake.org/t/supress-warnings-for-external-sources-with-modules/13752 "2025-03-14T06:23:58Z")

</div>

I tried to switch to modules and was thinking about proper testing. I came up with the following layout of my project: example |---external |---googletest(checked out as a submodule) |---src |---example.ixx …

---

## [find\_package(CURL COMPONENTS ...) doesn't work properly](https://discourse.cmake.org/t/find-package-curl-components-doesnt-work-properly/13749)

<div class="topic-metadata">

**Author:** [@simoneves](https://discourse.cmake.org/u/simoneves)\
**Replies:** 0\
**Last updated:** [March 14, 2025, 12:32am UTC](https://discourse.cmake.org/t/find-package-curl-components-doesnt-work-properly/13749 "2025-03-14T00:32:06Z")

</div>

I am trying to build libcpr (GitHub - libcpr/cpr: C++ Requests: Curl for People, a spiritual port of Python Requests.) against Curl 8.9.1 The libcpr CMakeLists.txt does find\_package(CURL COMPONENTS HTTP HTTPS) but repor…

---

## [C# VS\_PACKAGE\_REFERENCES issue](https://discourse.cmake.org/t/c-vs-package-references-issue/11050)

<div class="topic-metadata">

**Author:** [@yuto](https://discourse.cmake.org/u/yuto)\
**Replies:** 1\
**Last updated:** [March 13, 2025, 10:32pm UTC](https://discourse.cmake.org/t/c-vs-package-references-issue/11050 "2025-03-13T22:32:11Z")

</div>

Hi there, I have some issues while setting “VS\_PACKAGE\_REFERENCES” in CMake file for a C# project. The issue is that I need to reference a nuget package. And I’m writting “set\_property(TARGET SampleApp PROPERTY VS\_PACKA…

---

## [On target\_include\_directories (${CMAKE\_CURRENT\_LIST\_DIR})](https://discourse.cmake.org/t/on-target-include-directories-cmake-current-list-dir/11048)

<div class="topic-metadata">

**Author:** [@kfsone](https://discourse.cmake.org/u/kfsone)\
**Replies:** 1\
**Last updated:** [March 13, 2025, 10:30pm UTC](https://discourse.cmake.org/t/on-target-include-directories-cmake-current-list-dir/11048 "2025-03-13T22:30:50Z")

</div>

It’s been a few days since I cmake’d (cmade? cmooked?) and I find myself utterly confused as to why I can’t include “Lib.h” from target “Lib” which even has “Lib.h” listed as one of its sources, without explicitly adding…

---

## [Cuda hello world project fails to run with CMake on Windows](https://discourse.cmake.org/t/cuda-hello-world-project-fails-to-run-with-cmake-on-windows/11044)

<div class="topic-metadata">

**Author:** [@Marko\_Grdinic](https://discourse.cmake.org/u/Marko_Grdinic)\
**Replies:** 2\
**Last updated:** [March 13, 2025, 10:29pm UTC](https://discourse.cmake.org/t/cuda-hello-world-project-fails-to-run-with-cmake-on-windows/11044 "2025-03-13T22:29:21Z")

</div>

When I try to run the following CMake project: cmake\_minimum\_required(VERSION 3.29) project(my\_cuda\_project LANGUAGES CXX CUDA) add\_executable(my\_cuda\_project Main.cu) Why do I get the following error: PS G:\\CMake T…

---

## [Profiling a test](https://discourse.cmake.org/t/profiling-a-test/11024)

<div class="topic-metadata">

**Author:** [@tmpod](https://discourse.cmake.org/u/tmpod)\
**Replies:** 1\
**Last updated:** [March 13, 2025, 10:09pm UTC](https://discourse.cmake.org/t/profiling-a-test/11024 "2025-03-13T22:09:03Z")

</div>

Hello! I’m in need of profiling a specific part of a large C++ project, which has a bunch of unit and integration tests, managed through CTest. I was wondering if it was possible to profile a specific test (with some to…

---

## [Getting CMake to use built-in ARMCC support](https://discourse.cmake.org/t/getting-cmake-to-use-built-in-armcc-support/11016)

<div class="topic-metadata">

**Author:** [@sheckey](https://discourse.cmake.org/u/sheckey)\
**Replies:** 2\
**Last updated:** [March 13, 2025, 10:07pm UTC](https://discourse.cmake.org/t/getting-cmake-to-use-built-in-armcc-support/11016 "2025-03-13T22:07:55Z")

</div>

Hello! I see that CMake has built-in ARMCC support: https://gitlab.kitware.com/cmake/cmake/-/commit/035a658f4fdc8028ff19568aa2ded8b3efa70909#diff-6 I have this compiler installed via Arm DS-5 (the older Arm developmen…

---

## [Creation of VS build event](https://discourse.cmake.org/t/creation-of-vs-build-event/10969)

<div class="topic-metadata">

**Author:** [@gibbogle](https://discourse.cmake.org/u/gibbogle)\
**Replies:** 1\
**Last updated:** [March 13, 2025, 6:29pm UTC](https://discourse.cmake.org/t/creation-of-vs-build-event/10969 "2025-03-13T18:29:40Z")

</div>

My CMakeLists.txt has this line at the end: ADD\_CUSTOM\_COMMAND(TARGET ${PROJECTNAME} POST\_BUILD COMMAND copy "$(TargetPath)" "…/bin/exec") I think this is meant to add a Post-Build Event to the Build Events in VS (2019…

---

## [cmake-gui doesn't allow preset configurations to be selected](https://discourse.cmake.org/t/cmake-gui-doesnt-allow-preset-configurations-to-be-selected/13734)

<div class="topic-metadata">

**Author:** [@Ravenwater](https://discourse.cmake.org/u/Ravenwater)\
**Replies:** 1\
**Last updated:** [March 13, 2025, 2:23pm UTC](https://discourse.cmake.org/t/cmake-gui-doesnt-allow-preset-configurations-to-be-selected/13734 "2025-03-13T14:23:15Z")

</div>

Running into a problem that cmake-gui doesn’t seem to honor presets: How do we select presets via the GUI workflow?

---

## [Can't make simple cuda project with VS 2022 and CMake??? why I wonder? Simple code below....](https://discourse.cmake.org/t/cant-make-simple-cuda-project-with-vs-2022-and-cmake-why-i-wonder-simple-code-below/10754)

<div class="topic-metadata">

**Author:** [@RickF](https://discourse.cmake.org/u/RickF)\
**Replies:** 1\
**Last updated:** [March 13, 2025, 1:16pm UTC](https://discourse.cmake.org/t/cant-make-simple-cuda-project-with-vs-2022-and-cmake-why-i-wonder-simple-code-below/10754 "2025-03-13T13:16:19Z")

</div>

CMakeLists.txt cmake\_minimum\_required(VERSION 3.8 FATAL\_ERROR) project(CudaCppExample) enable\_language("CUDA") add\_executable(CudaCppExample main.cpp kernel.cu) set\_target\_properties(CudaCppExample PROPERTIES CUDA…

---

## [Replacement for VS\_DEBUGGER\_ENVIRONMENT with MS VS 2022 ?](https://discourse.cmake.org/t/replacement-for-vs-debugger-environment-with-ms-vs-2022/10745)

<div class="topic-metadata">

**Author:** [@neundorf](https://discourse.cmake.org/u/neundorf)\
**Replies:** 1\
**Last updated:** [March 13, 2025, 1:15pm UTC](https://discourse.cmake.org/t/replacement-for-vs-debugger-environment-with-ms-vs-2022/10745 "2025-03-13T13:15:40Z")

</div>

Hi, with cmake and the “normal” Visual Studio generator I can use VS\_DEBUGGER\_ENVIRONMENT to adjust e.g. the PATH environment variable so that the executables can find their dlls. When using Visual Studio 2022 with bui…

---

## [cmake-gui blocks presets that are usable through command line cmake](https://discourse.cmake.org/t/cmake-gui-blocks-presets-that-are-usable-through-command-line-cmake/9459)

<div class="topic-metadata">

**Author:** [@AngelDev06](https://discourse.cmake.org/u/AngelDev06)\
**Replies:** 2\
**Last updated:** [March 12, 2025, 2:38pm UTC](https://discourse.cmake.org/t/cmake-gui-blocks-presets-that-are-usable-through-command-line-cmake/9459 "2025-03-12T14:38:48Z")

</div>

I have an issue specifically with cmake-gui. I have written a CMakePresets.json file to build my project on linux however as stated in the title even though running cmake --list-presets on command line displays all prese…

---

## [When installing/deploying for macOS, do I need to worry about RPATH](https://discourse.cmake.org/t/when-installing-deploying-for-macos-do-i-need-to-worry-about-rpath/13732)

<div class="topic-metadata">

**Author:** [@perdrix](https://discourse.cmake.org/u/perdrix)\
**Replies:** 0\
**Last updated:** [March 12, 2025, 11:35am UTC](https://discourse.cmake.org/t/when-installing-deploying-for-macos-do-i-need-to-worry-about-rpath/13732 "2025-03-12T11:35:49Z")

</div>

Do I need to do set(CMAKE\_MACOSX\_RPATH 1) What should I set CMAKE\_INSTALL\_RPATH to? Thanks David

---

## [macOS problem running Qt Deploy](https://discourse.cmake.org/t/macos-problem-running-qt-deploy/13731)

<div class="topic-metadata">

**Author:** [@perdrix](https://discourse.cmake.org/u/perdrix)\
**Replies:** 0\
**Last updated:** [March 12, 2025, 10:45am UTC](https://discourse.cmake.org/t/macos-problem-running-qt-deploy/13731 "2025-03-12T10:45:23Z")

</div>

This is the code in my CMakeLists.txt file: if(NOT LINUX) set (deploy\_tool\_options\_arg "") if(APPLE) set(deploy\_tool\_options\_arg "${deploy\_tool\_options\_arg} -hardened-runtime") elseif(WIN32) …

---

## [Clang Tidy, how to set options?](https://discourse.cmake.org/t/clang-tidy-how-to-set-options/13710)

<div class="topic-metadata">

**Author:** [@MickeJ](https://discourse.cmake.org/u/MickeJ)\
**Replies:** 8\
**Last updated:** [March 12, 2025, 12:35am UTC](https://discourse.cmake.org/t/clang-tidy-how-to-set-options/13710 "2025-03-12T00:35:36Z")

</div>

Hi, I can run clang-tidy using below, but it only run default checks. How can i configure clang-tidy options? set\_target\_properties(${PROJECT\_NAME} PROPERTIES CXX\_CLANG\_TIDY clang-tidy ) Documentation states b…

---

## [find\_package on system libcurl does not set the target to global](https://discourse.cmake.org/t/find-package-on-system-libcurl-does-not-set-the-target-to-global/13695)

<div class="topic-metadata">

**Author:** [@boxerab](https://discourse.cmake.org/u/boxerab)\
**Replies:** 3\
**Last updated:** [March 11, 2025, 9:02pm UTC](https://discourse.cmake.org/t/find-package-on-system-libcurl-does-not-set-the-target-to-global/13695 "2025-03-11T21:02:37Z")

</div>

Hello There, I recently added libcurl support to my project, and I found that if fetching and building liburl from git, the CURL::libcurl target is global and can be used in subfolder cmake files. But, when running find…

---

## [ctest with cdash submission issue](https://discourse.cmake.org/t/ctest-with-cdash-submission-issue/13709)

<div class="topic-metadata">

**Author:** [@Fabian188](https://discourse.cmake.org/u/Fabian188)\
**Replies:** 3\
**Last updated:** [March 11, 2025, 8:08am UTC](https://discourse.cmake.org/t/ctest-with-cdash-submission-issue/13709 "2025-03-11T08:08:53Z")

</div>

We have software with gitlab CI pipeline. Up to now we have within the software a git submodule Teststuite with own CMakeLists.txt which is executed for testing via. cmake .. -DCFS\_INSTALL\_DIR=/Users/fwein/code/cfs/rel…

---

## [\`-static-pie\` is incompatible with \`CheckPIESupported\`](https://discourse.cmake.org/t/static-pie-is-incompatible-with-checkpiesupported/13696)

<div class="topic-metadata">

**Author:** [@hebasto](https://discourse.cmake.org/u/hebasto)\
**Replies:** 2\
**Last updated:** [March 10, 2025, 6:26pm UTC](https://discourse.cmake.org/t/static-pie-is-incompatible-with-checkpiesupported/13696 "2025-03-10T18:26:22Z")

</div>

$ cat CMakeLists.txt cmake\_minimum\_required(VERSION 3.30) project(TestStaticPIE LANGUAGES CXX) include(CheckPIESupported) check\_pie\_supported(OUTPUT\_VARIABLE output LANGUAGES CXX) if(CMAKE\_CXX\_LINK\_PIE\_SUPPORTED) set…

---

## [Set default target for project(SomePorject NONE) project](https://discourse.cmake.org/t/set-default-target-for-project-someporject-none-project/2132)

<div class="topic-metadata">

**Author:** [@anon64994923](https://discourse.cmake.org/u/anon64994923)\
**Replies:** 4\
**Last updated:** [March 10, 2025, 11:24am UTC](https://discourse.cmake.org/t/set-default-target-for-project-someporject-none-project/2132 "2025-03-10T11:24:48Z")

</div>

Hi! I am using cmake not to build something, but to generate some Makefile with bunch of tatrgets. So I do not have any executable, or library, but I have a lot of add\_custom\_targets with a lot of ifs It works well f…

---

## [add way to make an include in a CMakePresets.json file optional](https://discourse.cmake.org/t/add-way-to-make-an-include-in-a-cmakepresets-json-file-optional/9075)

<div class="topic-metadata">

**Author:** [@burtonrodman](https://discourse.cmake.org/u/burtonrodman)\
**Replies:** 2\
**Last updated:** [March 8, 2025, 9:30pm UTC](https://discourse.cmake.org/t/add-way-to-make-an-include-in-a-cmakepresets-json-file-optional/9075 "2025-03-08T21:30:32Z")

</div>

Hello, I am trying to get started contributing to a relatively large open source project. There is submodule in the project (community contributions) that is for all intents optional. If one simply clones the primary …

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

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