# Usage

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

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

**Page:** 32

---

## [CPack archive changing destination directory permissions](https://discourse.cmake.org/t/cpack-archive-changing-destination-directory-permissions/9919)

<div class="topic-metadata">

**Author:** [@shunkica](https://discourse.cmake.org/u/shunkica)\
**Replies:** 6\
**Last updated:** [February 4, 2024, 1:35pm UTC](https://discourse.cmake.org/t/cpack-archive-changing-destination-directory-permissions/9919 "2024-02-04T13:35:13Z")

</div>

I am trying to use the STGZ cpack generator to distribute my library via a shell script. The library installs into /usr/local/lib/ When I run the cpack generated shell script with the /usr/local prefix, it changes the …

---

## [CMake presets, env variables and o/s](https://discourse.cmake.org/t/cmake-presets-env-variables-and-o-s/6699)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 2\
**Last updated:** [February 2, 2024, 6:34am UTC](https://discourse.cmake.org/t/cmake-presets-env-variables-and-o-s/6699 "2024-02-02T06:34:18Z")

</div>

Our CMake preset (for an Arm tools - based project) must define environment variable ARM\_PRODUCT\_DEF: { "name": "arm-base-linux", "description": "Base configuration to target Linux with armclang, using Unix Makefile…

---

## [Prevent invocation of makefile and force use of cmake --build](https://discourse.cmake.org/t/prevent-invocation-of-makefile-and-force-use-of-cmake-build/9968)

<div class="topic-metadata">

**Author:** [@ddompe](https://discourse.cmake.org/u/ddompe)\
**Replies:** 1\
**Last updated:** [January 31, 2024, 3:46pm UTC](https://discourse.cmake.org/t/prevent-invocation-of-makefile-and-force-use-of-cmake-build/9968 "2024-01-31T15:46:24Z")

</div>

Hello, I’m using a Cmake project with vcpkg integration for dependency management. Since the makefile can invoke Cmake at any point if a file like a CmakeLists.txt changes, and the user is running make from the build d…

---

## [Cmake 3.27.8 regression with Ninja and Fortran dependencies](https://discourse.cmake.org/t/cmake-3-27-8-regression-with-ninja-and-fortran-dependencies/9920)

<div class="topic-metadata">

**Author:** [@krefson](https://discourse.cmake.org/u/krefson)\
**Replies:** 5\
**Last updated:** [January 31, 2024, 1:22pm UTC](https://discourse.cmake.org/t/cmake-3-27-8-regression-with-ninja-and-fortran-dependencies/9920 "2024-01-31T13:22:08Z")

</div>

I think I found a regression with the dependency generation for Ninja in 3.27.8. I am one of the developers of CASTEP, a large electronic structure code predominantly in Fortran. CMake builds with cmake 3.20.4 - 3.25.1…

---

## [Build failure in Linux when passing flags in add\_custom\_target](https://discourse.cmake.org/t/build-failure-in-linux-when-passing-flags-in-add-custom-target/9948)

<div class="topic-metadata">

**Author:** [@EosPengwern](https://discourse.cmake.org/u/EosPengwern)\
**Replies:** 5\
**Last updated:** [January 30, 2024, 10:37am UTC](https://discourse.cmake.org/t/build-failure-in-linux-when-passing-flags-in-add-custom-target/9948 "2024-01-30T10:37:04Z")

</div>

Having done some investigations to narrow down the issue, this is a simplified form of this earlier question. Essentially I am creating a custom target where the command line requires some flags to be passed using the “…

---

## [Make Error 127 \[Makefile:136: all\] Error 2](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938)

<div class="topic-metadata">

**Author:** [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)\
**Replies:** 9\
**Last updated:** [January 27, 2024, 7:35pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938 "2024-01-27T19:35:58Z")

</div>

Quick disclaimer: I am a novice. Feel free to explain things. I am attempting to run these scripts to compile a custom build of ffmpeg: I originally had questions about this project that I posted on Stack Overflow (m…

---

## [Confusing error messages when attempting Linux build](https://discourse.cmake.org/t/confusing-error-messages-when-attempting-linux-build/9869)

<div class="topic-metadata">

**Author:** [@EosPengwern](https://discourse.cmake.org/u/EosPengwern)\
**Replies:** 3\
**Last updated:** [January 27, 2024, 2:31pm UTC](https://discourse.cmake.org/t/confusing-error-messages-when-attempting-linux-build/9869 "2024-01-27T14:31:12Z")

</div>

What can be going on here? I have a CMake project which runs flawlessly on Windows, and I’m now trying to get it to build on Linux. To start with, it defines several custom targets (i.e. targets defined with add\_custom\_…

---

## [cmake SupperBuild how to include source file for local project](https://discourse.cmake.org/t/cmake-supperbuild-how-to-include-source-file-for-local-project/9939)

<div class="topic-metadata">

**Author:** [@BlackCat\_Ruelle](https://discourse.cmake.org/u/BlackCat_Ruelle)\
**Replies:** 3\
**Last updated:** [January 26, 2024, 5:34pm UTC](https://discourse.cmake.org/t/cmake-supperbuild-how-to-include-source-file-for-local-project/9939 "2024-01-26T17:34:41Z")

</div>

Hi, I use the ExternalPorject\_Add to added external dependencies to my local projects. Specifically, I use EExternalPrject\_Add to add my local projects such that my projects’ external dependencies can be build properly.…

---

## [Problem when installing using CMake](https://discourse.cmake.org/t/problem-when-installing-using-cmake/9914)

<div class="topic-metadata">

**Author:** [@Roman](https://discourse.cmake.org/u/Roman)\
**Replies:** 1\
**Last updated:** [January 26, 2024, 2:01pm UTC](https://discourse.cmake.org/t/problem-when-installing-using-cmake/9914 "2024-01-26T14:01:08Z")

</div>

There was a problem with the build when installing the driver for Apium (selenium-webdriver-at-spi). When executing ‘make.’ throws an error: Building CXX object inputsynth/CMakeFiles/selenium-webdriver-at-spi-inputsynth…

---

## [Internal/external headers](https://discourse.cmake.org/t/internal-external-headers/9908)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.cmake.org/u/bramtayl)\
**Replies:** 3\
**Last updated:** [January 26, 2024, 1:48pm UTC](https://discourse.cmake.org/t/internal-external-headers/9908 "2024-01-26T13:48:19Z")

</div>

I have a project C++ project with both private and public headers. I want to make the private headers available to other targets, plugins and executables I’m building in the project, but only the external headers availab…

---

## [How to skip link step when building ?](https://discourse.cmake.org/t/how-to-skip-link-step-when-building/9895)

<div class="topic-metadata">

**Author:** [@Timothy\_Madden](https://discourse.cmake.org/u/Timothy_Madden)\
**Replies:** 7\
**Last updated:** [January 26, 2024, 1:44pm UTC](https://discourse.cmake.org/t/how-to-skip-link-step-when-building/9895 "2024-01-26T13:44:17Z")

</div>

Hello, I want to build my project with clang, but only to setup omni completion (intellisense) in my editor (gVim). Doing this because at this time nothing else supports semantic completion with C++ modules. Even if I …

---

## [Compiler options for warnings](https://discourse.cmake.org/t/compiler-options-for-warnings/9936)

<div class="topic-metadata">

**Author:** [@Volker\_Dirr](https://discourse.cmake.org/u/Volker_Dirr)\
**Replies:** 2\
**Last updated:** [January 25, 2024, 7:51pm UTC](https://discourse.cmake.org/t/compiler-options-for-warnings/9936 "2024-01-25T19:51:23Z")

</div>

Hallo, I have a question about setting the compiler options for warnings. I read in the documentation this: if (MSVC) # warning level 4 add\_compile\_options(/W4) else() # additional warnings add\_compile…

---

## [Specifying CMAKE\_OSX\_SYSROOT breaks Xcode projects, but no other choice](https://discourse.cmake.org/t/specifying-cmake-osx-sysroot-breaks-xcode-projects-but-no-other-choice/2532)

<div class="topic-metadata">

**Author:** [@alecazam](https://discourse.cmake.org/u/alecazam)\
**Replies:** 9\
**Last updated:** [January 24, 2024, 11:40pm UTC](https://discourse.cmake.org/t/specifying-cmake-osx-sysroot-breaks-xcode-projects-but-no-other-choice/2532 "2024-01-24T23:40:15Z")

</div>

If you don’t specify CMAKE\_OSX\_SYSROOT, then CMake seems to default to some invalid SDK, or uses the DEPLOYMENT\_TARGET which is far too low for the SDK. SYSROOT is effectively, the maximum build of macOS that the app su…

---

## [cmake error at message(FATAL\_ERROR "CMake step for ${contentName} failed: ${result}")](https://discourse.cmake.org/t/cmake-error-at-message-fatal-error-cmake-step-for-contentname-failed-result/9898)

<div class="topic-metadata">

**Author:** [@natourand](https://discourse.cmake.org/u/natourand)\
**Replies:** 2\
**Last updated:** [January 23, 2024, 10:53pm UTC](https://discourse.cmake.org/t/cmake-error-at-message-fatal-error-cmake-step-for-contentname-failed-result/9898 "2024-01-23T22:53:17Z")

</div>

hello, I was trying to run cmake on Visual Studio code to use the gtest . I have already downloaded the MinGW compiler on my Windows computer. I also downloaded the relevant extensions in vs code such as cmake and cma…

---

## [Using a single build preset with multiple configuration presets?](https://discourse.cmake.org/t/using-a-single-build-preset-with-multiple-configuration-presets/9906)

<div class="topic-metadata">

**Author:** [@bradlit](https://discourse.cmake.org/u/bradlit)\
**Replies:** 2\
**Last updated:** [January 23, 2024, 10:49pm UTC](https://discourse.cmake.org/t/using-a-single-build-preset-with-multiple-configuration-presets/9906 "2024-01-23T22:49:03Z")

</div>

I use Ninja, and sometimes want to use a build option like this: “buildPresets”: \[ { “name”: “ninja\_list\_all\_errors”, // ninja option meaning build and don’t stop on first failure // -k N keep going until N j…

---

## [Trying to configure a basic CMake project causes error](https://discourse.cmake.org/t/trying-to-configure-a-basic-cmake-project-causes-error/9891)

<div class="topic-metadata">

**Author:** [@km7dev](https://discourse.cmake.org/u/km7dev)\
**Replies:** 3\
**Last updated:** [January 23, 2024, 1:01pm UTC](https://discourse.cmake.org/t/trying-to-configure-a-basic-cmake-project-causes-error/9891 "2024-01-23T13:01:07Z")

</div>

I’m trying to start a Geometry Dash mod from a template (found here) and whenever I try to use CMake:Configure (vscode) it gives me this error: \[main\] Configuring project: modtest \[proc\] Executing command: "C:\\Program …

---

## [Packaging for csharp](https://discourse.cmake.org/t/packaging-for-csharp/9905)

<div class="topic-metadata">

**Author:** [@Lecris](https://discourse.cmake.org/u/Lecris)\
**Replies:** 1\
**Last updated:** [January 23, 2024, 12:59pm UTC](https://discourse.cmake.org/t/packaging-for-csharp/9905 "2024-01-23T12:59:29Z")

</div>

Does anyone have tips on how to package a CMake project for csharp? What packaging ecosystems are there for csharp? Mainly Nuget?

---

## [Is it possible to export compile commands for custom commands?](https://discourse.cmake.org/t/is-it-possible-to-export-compile-commands-for-custom-commands/9889)

<div class="topic-metadata">

**Author:** [@Zhiyuan\_Xin](https://discourse.cmake.org/u/Zhiyuan_Xin)\
**Replies:** 1\
**Last updated:** [January 22, 2024, 2:57pm UTC](https://discourse.cmake.org/t/is-it-possible-to-export-compile-commands-for-custom-commands/9889 "2024-01-22T14:57:14Z")

</div>

I configured the project libbpf-bootstrap with following shell commands: cmake -S examples/c -B build -DCMAKE\_EXPORT\_COMPILE\_COMMANDS=ON However, in the generated compile\_commands.json, there were no items for \*.bpf.c …

---

## [Passing all elemental environment into ExternalProject\_Add](https://discourse.cmake.org/t/passing-all-elemental-environment-into-externalproject-add/9878)

<div class="topic-metadata">

**Author:** [@Desperado17](https://discourse.cmake.org/u/Desperado17)\
**Replies:** 12\
**Last updated:** [January 22, 2024, 2:54pm UTC](https://discourse.cmake.org/t/passing-all-elemental-environment-into-externalproject-add/9878 "2024-01-22T14:54:59Z")

</div>

Greetings, I have to add a 3rd party CMake project to our own one. The 3rd party project has several submodules that it adds with ExternalProject\_Add. Problem: The submodules use find\_package extensively and apparently …

---

## [How to determine host architecture before to the project call?](https://discourse.cmake.org/t/how-to-determine-host-architecture-before-to-the-project-call/9887)

<div class="topic-metadata">

**Author:** [@Kentzo](https://discourse.cmake.org/u/Kentzo)\
**Replies:** 1\
**Last updated:** [January 20, 2024, 4:30am UTC](https://discourse.cmake.org/t/how-to-determine-host-architecture-before-to-the-project-call/9887 "2024-01-20T04:30:03Z")

</div>

In my project I’m allowing the user to configure library either for device or simulator. When targeting device I just hardcode arm64, but the simulator architecture follow the host device. Unfortunately I cannot use CMAK…

---

## [Problems to export Debug configuration with cmake when using multiconfig generators](https://discourse.cmake.org/t/problems-to-export-debug-configuration-with-cmake-when-using-multiconfig-generators/9881)

<div class="topic-metadata">

**Author:** [@FoundationFather](https://discourse.cmake.org/u/FoundationFather)\
**Replies:** 5\
**Last updated:** [January 19, 2024, 9:44pm UTC](https://discourse.cmake.org/t/problems-to-export-debug-configuration-with-cmake-when-using-multiconfig-generators/9881 "2024-01-19T21:44:38Z")

</div>

I am trying to export some targets I have in a project, and I’ve been using the install command for that. I need to export and install both Debug and Release configurations since I need to export some of the targets to c…

---

## [New MacOS and Xcode update incompatible with Cmake?](https://discourse.cmake.org/t/new-macos-and-xcode-update-incompatible-with-cmake/9876)

<div class="topic-metadata">

**Author:** [@alexgav02](https://discourse.cmake.org/u/alexgav02)\
**Replies:** 8\
**Last updated:** [January 19, 2024, 2:53pm UTC](https://discourse.cmake.org/t/new-macos-and-xcode-update-incompatible-with-cmake/9876 "2024-01-19T14:53:42Z")

</div>

I’ve been running code smoothly for the last few weeks up until today after my macOS updated to Sonoma 14.2.1 and Xcode to 15.2 overnight. I updated cmake using homebrew to the latest version: 3.28.1, but now I’m getting…

---

## [Assembler and C - handle flags and defines](https://discourse.cmake.org/t/assembler-and-c-handle-flags-and-defines/9872)

<div class="topic-metadata">

**Author:** [@Claudio\_Eterno](https://discourse.cmake.org/u/Claudio_Eterno)\
**Replies:** 6\
**Last updated:** [January 19, 2024, 5:58am UTC](https://discourse.cmake.org/t/assembler-and-c-handle-flags-and-defines/9872 "2024-01-19T05:58:41Z")

</div>

Hi, today I have been working with cmake in order to translate a project based on eclipse. I faced a problem and really don’t know if the founded solution is good or not. So, if you have a minute, tell me what you think…

---

## [CDash + grafana](https://discourse.cmake.org/t/cdash-grafana/9868)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 2\
**Last updated:** [January 18, 2024, 10:53pm UTC](https://discourse.cmake.org/t/cdash-grafana/9868 "2024-01-18T22:53:21Z")

</div>

Hi all, General question to the community, Since we can use postgres or mysql backend for CDash dashboard, is it possible to hook up grafana to CDash, in case we want to have some additional visualizations? Has someone …

---

## [Changes do not apply when changing an option variable](https://discourse.cmake.org/t/changes-do-not-apply-when-changing-an-option-variable/9871)

<div class="topic-metadata">

**Author:** [@asimplecoder](https://discourse.cmake.org/u/asimplecoder)\
**Replies:** 3\
**Last updated:** [January 17, 2024, 7:50pm UTC](https://discourse.cmake.org/t/changes-do-not-apply-when-changing-an-option-variable/9871 "2024-01-17T19:50:54Z")

</div>

Hi everyone, I noticed that when I change the value ON\\OFF of some option variables, re-running cmake -S -B \[...\] without the --fresh flag does not apply the changes to those option variables. From the option CMake doc…

---

## [How to prevent CMake File API from generating irrelevant build information](https://discourse.cmake.org/t/how-to-prevent-cmake-file-api-from-generating-irrelevant-build-information/9865)

<div class="topic-metadata">

**Author:** [@Jason\_Cao](https://discourse.cmake.org/u/Jason_Cao)\
**Replies:** 1\
**Last updated:** [January 16, 2024, 2:00pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-file-api-from-generating-irrelevant-build-information/9865 "2024-01-16T14:00:10Z")

</div>

I am currently developing a tool that utilizes the CMake File API to obtain build information from a CMake project, such as targets, source files, compilation options, etc., to facilitate the porting of build scripts. Th…

---

## [make cannot find the Protobuf include headers](https://discourse.cmake.org/t/make-cannot-find-the-protobuf-include-headers/9695)

<div class="topic-metadata">

**Author:** [@poldi](https://discourse.cmake.org/u/poldi)\
**Replies:** 13\
**Last updated:** [January 13, 2024, 11:13pm UTC](https://discourse.cmake.org/t/make-cannot-find-the-protobuf-include-headers/9695 "2024-01-13T23:13:12Z")

</div>

I’m trying to get a tiny test with Protobuf to compile and cannot figure out why this fails. I tried to upload the code, but don’t have the rights, so bear with me when I add the code to this post. I have the Protobuf s…

---

## [Test start time stamp in junit xml output](https://discourse.cmake.org/t/test-start-time-stamp-in-junit-xml-output/9800)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 3\
**Last updated:** [January 13, 2024, 10:34am UTC](https://discourse.cmake.org/t/test-start-time-stamp-in-junit-xml-output/9800 "2024-01-13T10:34:48Z")

</div>

Hi all, Would it be possible to add the timestamp for a test node when the test starts, in the generated junit xml. I would suggest Unix epoch in milliseconds. Think it would be useful in generating a timeline of execut…

---

## [Uninstall CMake from Compile and Install](https://discourse.cmake.org/t/uninstall-cmake-from-compile-and-install/9833)

<div class="topic-metadata">

**Author:** [@Hemiao\_Zhang](https://discourse.cmake.org/u/Hemiao_Zhang)\
**Replies:** 5\
**Last updated:** [January 13, 2024, 10:31am UTC](https://discourse.cmake.org/t/uninstall-cmake-from-compile-and-install/9833 "2024-01-13T10:31:50Z")

</div>

Hi CMake Community, I recently uninstall a cmake on my WSL Ubuntu 22.04.3 and manually download + compile + install a new one following Teo Answer B: https://askubuntu.com/questions/355565/how-do-i-install-the-latest-ve…

---

## [msvc how to handle declspecs](https://discourse.cmake.org/t/msvc-how-to-handle-declspecs/9779)

<div class="topic-metadata">

**Author:** [@JuliusCaesar](https://discourse.cmake.org/u/JuliusCaesar)\
**Replies:** 6\
**Last updated:** [January 12, 2024, 6:21pm UTC](https://discourse.cmake.org/t/msvc-how-to-handle-declspecs/9779 "2024-01-12T18:21:34Z")

</div>

Hey guys, I’m struggling to get msvc to work for my project. I’m getting some undefined symbol linker errors for some const global data. I’m using Cmake 3.27 with latest MSVC 17 and set(CMAKE\_WINDOWS\_EXPORT\_ALL\_SYMBO…

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

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