# Usage

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

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

**Page:** 33

---

## [Could not find CMAKE\_C\_COMPILER using the following names: arm-none-eabi-gcc](https://discourse.cmake.org/t/could-not-find-cmake-c-compiler-using-the-following-names-arm-none-eabi-gcc/9761)

<div class="topic-metadata">

**Author:** [@f-zl](https://discourse.cmake.org/u/f-zl)\
**Replies:** 2\
**Last updated:** [January 12, 2024, 9:44am UTC](https://discourse.cmake.org/t/could-not-find-cmake-c-compiler-using-the-following-names-arm-none-eabi-gcc/9761 "2024-01-12T09:44:52Z")

</div>

I need to write a toolchain file that allows the user to specify the compiler binary’s directory, because the user may install different toolchains with the same compiler name. # This file depends on TOOLCHAIN\_BIN\_PATH …

---

## [windows sdk find error](https://discourse.cmake.org/t/windows-sdk-find-error/9839)

<div class="topic-metadata">

**Author:** [@wayne](https://discourse.cmake.org/u/wayne)\
**Replies:** 0\
**Last updated:** [January 12, 2024, 9:04am UTC](https://discourse.cmake.org/t/windows-sdk-find-error/9839 "2024-01-12T09:04:41Z")

</div>

I have been using msquic as a submodule to enable quic feature. I simply use cmake cmd add\_subdirectory and target\_link\_libraries to use quic lib in linux, they works fine. When it comes to windows, the msvc compiler ke…

---

## [Building Project with Depedencies' Tests: CMake FetchContent Conflicting Targets](https://discourse.cmake.org/t/building-project-with-depedencies-tests-cmake-fetchcontent-conflicting-targets/9747)

<div class="topic-metadata">

**Author:** [@eulersson](https://discourse.cmake.org/u/eulersson)\
**Replies:** 2\
**Last updated:** [January 12, 2024, 8:40am UTC](https://discourse.cmake.org/t/building-project-with-depedencies-tests-cmake-fetchcontent-conflicting-targets/9747 "2024-01-12T08:40:41Z")

</div>

Hello, I have problems building a project with two external dependencies that define the same target. My goal is to be able to compile the project’s tests along with the project’s dependencies tests too. For that I was…

---

## [Enabling ANSI escape color code will result in unexpected results](https://discourse.cmake.org/t/enabling-ansi-escape-color-code-will-result-in-unexpected-results/9780)

<div class="topic-metadata">

**Author:** [@cristianadam](https://discourse.cmake.org/u/cristianadam)\
**Replies:** 2\
**Last updated:** [January 12, 2024, 8:35am UTC](https://discourse.cmake.org/t/enabling-ansi-escape-color-code-will-result-in-unexpected-results/9780 "2024-01-12T08:35:33Z")

</div>

At \[QTCREATORBUG-30147\] ERROR\_VARIABLE from execute\_process is not working as expected - Qt Bug Tracker we can see the following code: cmake\_minimum\_required(VERSION 3.14) project(QtCreatoCmakeBug) unset(generated\_file…

---

## [Using CMake FetchContent() to retrieve dependency's binaries, and not sources](https://discourse.cmake.org/t/using-cmake-fetchcontent-to-retrieve-dependencys-binaries-and-not-sources/9762)

<div class="topic-metadata">

**Author:** [@Oodini](https://discourse.cmake.org/u/Oodini)\
**Replies:** 3\
**Last updated:** [January 11, 2024, 3:21pm UTC](https://discourse.cmake.org/t/using-cmake-fetchcontent-to-retrieve-dependencys-binaries-and-not-sources/9762 "2024-01-11T15:21:40Z")

</div>

I am relatively new to CMake. I want to use libpng, and so zlib, for my project. After viewing some tutorials, it seems the standard way to do that is to retrieve the dependencies sources with FetchContent() or Externa…

---

## [Stop CMake before linking MicroPython](https://discourse.cmake.org/t/stop-cmake-before-linking-micropython/9818)

<div class="topic-metadata">

**Author:** [@rcalcagno](https://discourse.cmake.org/u/rcalcagno)\
**Replies:** 2\
**Last updated:** [January 11, 2024, 3:19pm UTC](https://discourse.cmake.org/t/stop-cmake-before-linking-micropython/9818 "2024-01-11T15:19:16Z")

</div>

Good evening. I am using MicroPython on a Raspberry Pi Pico. As my .py script grew too big (+3000 lines) and I still need to add features, I find myself in trouble since I can’t use the MicroPython interpreter anymore; i…

---

## [import so with full path](https://discourse.cmake.org/t/import-so-with-full-path/9796)

<div class="topic-metadata">

**Author:** [@mvandenabeele](https://discourse.cmake.org/u/mvandenabeele)\
**Replies:** 2\
**Last updated:** [January 11, 2024, 2:50pm UTC](https://discourse.cmake.org/t/import-so-with-full-path/9796 "2024-01-11T14:50:08Z")

</div>

Hi I’m trying to create a Find module for an SDK we’re using. What I currently have is this (can’t upload a file as new forum member): find\_package(PkgConfig) pkg\_check\_modules(PC\_Cerence QUIET Cerence) find\_path(Cere…

---

## [VERIFY\_INTERFACE\_HEADER\_SETS grouping in folders](https://discourse.cmake.org/t/verify-interface-header-sets-grouping-in-folders/8092)

<div class="topic-metadata">

**Author:** [@duncanspumpkin](https://discourse.cmake.org/u/duncanspumpkin)\
**Replies:** 4\
**Last updated:** [January 11, 2024, 2:06pm UTC](https://discourse.cmake.org/t/verify-interface-header-sets-grouping-in-folders/8092 "2024-01-11T14:06:49Z")

</div>

I was planning on using VERIFY\_INTERFACE\_HEADER\_SETS to replace custom equivalent code. But one thing I’ve noticed is that the targets generated ${TARGET}\_verify\_interface\_header\_sets don’t appear to be valid targets tha…

---

## [i am completely new to use cmake. i am facing an issue with debugging the following error.](https://discourse.cmake.org/t/i-am-completely-new-to-use-cmake-i-am-facing-an-issue-with-debugging-the-following-error/9823)

<div class="topic-metadata">

**Author:** [@stroll](https://discourse.cmake.org/u/stroll)\
**Replies:** 1\
**Last updated:** [January 11, 2024, 2:01pm UTC](https://discourse.cmake.org/t/i-am-completely-new-to-use-cmake-i-am-facing-an-issue-with-debugging-the-following-error/9823 "2024-01-11T14:01:38Z")

</div>

Obseved: CMake Error at CMakeLists.txt:15 (find\_package): find\_package called with incorrect number of arguments -- Using CATKIN\_DEVEL\_PREFIX: /home/guo/ws4/devel -- Using CMAKE\_PREFIX\_PATH: /opt/ros/noetic -- This …

---

## [CFLAGS and child CMakeFiles.txt](https://discourse.cmake.org/t/cflags-and-child-cmakefiles-txt/9781)

<div class="topic-metadata">

**Author:** [@SparkyNZ](https://discourse.cmake.org/u/SparkyNZ)\
**Replies:** 7\
**Last updated:** [January 11, 2024, 1:38pm UTC](https://discourse.cmake.org/t/cflags-and-child-cmakefiles-txt/9781 "2024-01-11T13:38:21Z")

</div>

Is this the correct way to add a compiler flag to CFLAGS: list (APPEND CFLAGS "-Wdeprecated-copy") I have seen mention of using “CFLAGS+=” but I wasn’t sure upon the syntax for that. The reason I ask is that in one of…

---

## [Automatically set the best argument for msvc /arch option](https://discourse.cmake.org/t/automatically-set-the-best-argument-for-msvc-arch-option/9778)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 1\
**Last updated:** [January 11, 2024, 1:27pm UTC](https://discourse.cmake.org/t/automatically-set-the-best-argument-for-msvc-arch-option/9778 "2024-01-11T13:27:57Z")

</div>

Hi, It does not seem that msvc provides an automatic setting for /arch (which would be the equivalent of -march=native with gcc/clang). Is there a way to achieve it with cmake? I saw in msvc doc about a cpuid command …

---

## [cmake configure project with ewdk toolchain](https://discourse.cmake.org/t/cmake-configure-project-with-ewdk-toolchain/8417)

<div class="topic-metadata">

**Author:** [@sorin\_banc](https://discourse.cmake.org/u/sorin_banc)\
**Replies:** 6\
**Last updated:** [January 11, 2024, 6:45am UTC](https://discourse.cmake.org/t/cmake-configure-project-with-ewdk-toolchain/8417 "2024-01-11T06:45:36Z")

</div>

I am unable to configure a project while inside an EWDK environment because cmake searches for resources in the wrong place. The setup: installed visual studio 2019 with an SDK (something that will bring the windows kit…

---

## [Is it normal to resort to using superbuilds?](https://discourse.cmake.org/t/is-it-normal-to-resort-to-using-superbuilds/9359)

<div class="topic-metadata">

**Author:** [@dylanetaft](https://discourse.cmake.org/u/dylanetaft)\
**Replies:** 3\
**Last updated:** [January 8, 2024, 11:52pm UTC](https://discourse.cmake.org/t/is-it-normal-to-resort-to-using-superbuilds/9359 "2024-01-08T23:52:01Z")

</div>

I’m writing an app, which is using blake3, libsodium, libwebsockets(git master, because I have a patch upstream not in the release yet to support IPV6 PREFER\_SRC\_PUBLIC), google test, and a custom library. Libsodium use…

---

## [Cmake Mingw makefile in windows](https://discourse.cmake.org/t/cmake-mingw-makefile-in-windows/6908)

<div class="topic-metadata">

**Author:** [@Gaurav\_Tiwari](https://discourse.cmake.org/u/Gaurav_Tiwari)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 4:22pm UTC](https://discourse.cmake.org/t/cmake-mingw-makefile-in-windows/6908 "2024-01-05T16:22:58Z")

</div>

I am trying to create a build of MinGW Makefiles using cmake but I get the following error when I execute the command cmake -G "MinGW Makefiles" ..\\source\\ I have added mingw bin and cmake to my path. I get the following…

---

## [Could not find a package configuration file provided by "wxWidgets"](https://discourse.cmake.org/t/could-not-find-a-package-configuration-file-provided-by-wxwidgets/9777)

<div class="topic-metadata">

**Author:** [@Raphy](https://discourse.cmake.org/u/Raphy)\
**Replies:** 1\
**Last updated:** [January 5, 2024, 3:11pm UTC](https://discourse.cmake.org/t/could-not-find-a-package-configuration-file-provided-by-wxwidgets/9777 "2024-01-05T15:11:18Z")

</div>

Hi! To start using wxWidgets in Ubuntu 23.10, I compiled and built the minimum sample : https://github.com/wxWidgets/wxWidgets/blob/master/samples/minimal/ with wx-config: raphy@raohy:~/MyPrj$ g++ \`wx-config --cxxflags…

---

## [CMake nightly URL programmatic](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771)

<div class="topic-metadata">

**Author:** [@scivision](https://discourse.cmake.org/u/scivision)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 1:56am UTC](https://discourse.cmake.org/t/cmake-nightly-url-programmatic/9771 "2024-01-05T01:56:09Z")

</div>

Is there a way to determine the nightly binary URL? I see a hexadecimal string not related to commit hash in the URL. I would like to make a little script that downloads the latest nightly binary (or specific date) but …

---

## [run cmake pointing it to the source directory](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753)

<div class="topic-metadata">

**Author:** [@mali.solangi](https://discourse.cmake.org/u/mali.solangi)\
**Replies:** 4\
**Last updated:** [January 4, 2024, 7:06pm UTC](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753 "2024-01-04T19:06:36Z")

</div>

Building & Installing (https://github.com/CNES/aviso-fes/blob/main/INSTALL.md#building--installing) One nice and highly recommended feature of CMake is the ability to do out of source builds. In this way you can make al…

---

## [\`find\_path\` unable to find correct path](https://discourse.cmake.org/t/find-path-unable-to-find-correct-path/9745)

<div class="topic-metadata">

**Author:** [@lynxnb](https://discourse.cmake.org/u/lynxnb)\
**Replies:** 1\
**Last updated:** [January 2, 2024, 4:18pm UTC](https://discourse.cmake.org/t/find-path-unable-to-find-correct-path/9745 "2024-01-02T16:18:17Z")

</div>

I’m the author of a project (drone-flight-visualizer) using RapidJSON as a dependency, which I add with add\_subdirectory. I’m using CMake 2.28.1. RapidJSON is having trouble with the find\_path call not being able to fin…

---

## [\[FetchContent\] How to include header files of a third-party project whose target does not provide them](https://discourse.cmake.org/t/fetchcontent-how-to-include-header-files-of-a-third-party-project-whose-target-does-not-provide-them/9734)

<div class="topic-metadata">

**Author:** [@eulersson](https://discourse.cmake.org/u/eulersson)\
**Replies:** 3\
**Last updated:** [December 30, 2023, 7:34pm UTC](https://discourse.cmake.org/t/fetchcontent-how-to-include-header-files-of-a-third-party-project-whose-target-does-not-provide-them/9734 "2023-12-30T19:34:45Z")

</div>

Hello, I am trying to install a third-party library cJSON with CMake’s FetchContent and I managed to do it but I find it strange that the header files are not included in the cjson target. Usually the developer would use…

---

## [Why is the default for --build different than --install?](https://discourse.cmake.org/t/why-is-the-default-for-build-different-than-install/3022)

<div class="topic-metadata">

**Author:** [@JRR](https://discourse.cmake.org/u/JRR)\
**Replies:** 3\
**Last updated:** [December 30, 2023, 5:17am UTC](https://discourse.cmake.org/t/why-is-the-default-for-build-different-than-install/3022 "2023-12-30T05:17:59Z")

</div>

I’m working on a Windows machine with Visual Studio’s compiles. I create the visual studio project/solution from a build directory using the command cmake .. When it’s time to compile I will use the command cmake -…

---

## [find\_library misses a framework](https://discourse.cmake.org/t/find-library-misses-a-framework/9736)

<div class="topic-metadata">

**Author:** [@Kentzo](https://discourse.cmake.org/u/Kentzo)\
**Replies:** 2\
**Last updated:** [December 30, 2023, 4:05am UTC](https://discourse.cmake.org/t/find-library-misses-a-framework/9736 "2023-12-30T04:05:51Z")

</div>

I don’t quite understand why find\_library fails locate a framework when cross-compiling for tvOS: CMake Debug Log at qtmultimedia/cmake/FindFFmpeg.cmake:128 (find\_library): find\_library called with the following setti…

---

## [The timing for using \`target\_include\_directories\` and \`target\_link\_libraries\`](https://discourse.cmake.org/t/the-timing-for-using-target-include-directories-and-target-link-libraries/9711)

<div class="topic-metadata">

**Author:** [@Sea\_Sea](https://discourse.cmake.org/u/Sea_Sea)\
**Replies:** 7\
**Last updated:** [December 30, 2023, 1:24am UTC](https://discourse.cmake.org/t/the-timing-for-using-target-include-directories-and-target-link-libraries/9711 "2023-12-30T01:24:37Z")

</div>

According to this project #include errors detected I want to know the usage timing for target\_include\_directories and target\_link\_libraries situation 1: I build a third party lib.so or lib.dll And using it on my proj…

---

## [How to verify configuration of the an external CMake project?](https://discourse.cmake.org/t/how-to-verify-configuration-of-the-an-external-cmake-project/9731)

<div class="topic-metadata">

**Author:** [@Kentzo](https://discourse.cmake.org/u/Kentzo)\
**Replies:** 3\
**Last updated:** [December 29, 2023, 7:09pm UTC](https://discourse.cmake.org/t/how-to-verify-configuration-of-the-an-external-cmake-project/9731 "2023-12-29T19:09:55Z")

</div>

I’m using the ExternalProject module to set up a dependency sub-project. This sub-project does some find\_package-like detection and auto-configures itself accordingly. In the main project I want to verify that it found …

---

## [CMakePresets.json example for Visual Studio](https://discourse.cmake.org/t/cmakepresets-json-example-for-visual-studio/9701)

<div class="topic-metadata">

**Author:** [@jaquilio](https://discourse.cmake.org/u/jaquilio)\
**Replies:** 8\
**Last updated:** [December 27, 2023, 8:24pm UTC](https://discourse.cmake.org/t/cmakepresets-json-example-for-visual-studio/9701 "2023-12-27T20:24:57Z")

</div>

I am looking for a good example of CMakePresets.json file used for building with Visual Studio. Can anybody please share theirs? Thanks! P.S. I did search online, but, only found some toy preset files and not any corre…

---

## [arm-none-eabi link error undefined reference to \`\_exit' undefined reference to \`\_close' undefined reference to \`\_isatty' undefined reference to \`\_kill' undefined reference to \`\_getpid'](https://discourse.cmake.org/t/arm-none-eabi-link-error-undefined-reference-to-exit-undefined-reference-to-close-undefined-reference-to-isatty-undefined-reference-to-kill-undefined-reference-to-getpid/9717)

<div class="topic-metadata">

**Author:** [@sridhar](https://discourse.cmake.org/u/sridhar)\
**Replies:** 3\
**Last updated:** [December 27, 2023, 12:06pm UTC](https://discourse.cmake.org/t/arm-none-eabi-link-error-undefined-reference-to-exit-undefined-reference-to-close-undefined-reference-to-isatty-undefined-reference-to-kill-undefined-reference-to-getpid/9717 "2023-12-27T12:06:51Z")

</div>

Hi all, I got this error when trying to compile my code \[main\] Building folder: test\_cmake1\_nc - Copy (2) \[build\] Starting build \[proc\] Executing command: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\Com…

---

## [Error: selected processor does not support \`cpsid i' in ARM mode](https://discourse.cmake.org/t/error-selected-processor-does-not-support-cpsid-i-in-arm-mode/9726)

<div class="topic-metadata">

**Author:** [@sridhar](https://discourse.cmake.org/u/sridhar)\
**Replies:** 0\
**Last updated:** [December 27, 2023, 10:21am UTC](https://discourse.cmake.org/t/error-selected-processor-does-not-support-cpsid-i-in-arm-mode/9726 "2023-12-27T10:21:49Z")

</div>

I have encountered a error while trying to do build for my cmake file cmake\_minimum\_required (VERSION 3.0.0) set(CMAKE\_SYSTEM\_NAME Generic) set(CMAKE\_SYSTEM\_PROCESSOR arm) set(CMAKE\_C\_COMPILER arm-none-eabi-gcc) set…

---

## [How to structure your project](https://discourse.cmake.org/t/how-to-structure-your-project/9725)

<div class="topic-metadata">

**Author:** [@Sea\_Sea](https://discourse.cmake.org/u/Sea_Sea)\
**Replies:** 0\
**Last updated:** [December 27, 2023, 7:09am UTC](https://discourse.cmake.org/t/how-to-structure-your-project/9725 "2023-12-27T07:09:13Z")

</div>

How to structure your project ? Is it better for this link? It seem to doesnt design the third party place If there are two or above main projcets(like deep learning yolov5 , yolov6, resnet, …), I want to let them i…

---

## [How to generate project files for a project? Could not find a package configuration file provided by "packageName" with any of the following names error](https://discourse.cmake.org/t/how-to-generate-project-files-for-a-project-could-not-find-a-package-configuration-file-provided-by-packagename-with-any-of-the-following-names-error/9722)

<div class="topic-metadata">

**Author:** [@Kulagin](https://discourse.cmake.org/u/Kulagin)\
**Replies:** 1\
**Last updated:** [December 26, 2023, 4:57pm UTC](https://discourse.cmake.org/t/how-to-generate-project-files-for-a-project-could-not-find-a-package-configuration-file-provided-by-packagename-with-any-of-the-following-names-error/9722 "2023-12-26T16:57:59Z")

</div>

I’m trying to generate project files for bencode project. It uses fmt, gsl and expected libraries as dependencies, it adds them using find\_package(fmt CONFIG REQUIRED) find\_package(gsl-lite CONFIG REQUIRED) find\_package…

---

## [The C compiler is not able to compile a simple test program when compiling using ARM-GNU toolchain](https://discourse.cmake.org/t/the-c-compiler-is-not-able-to-compile-a-simple-test-program-when-compiling-using-arm-gnu-toolchain/8215)

<div class="topic-metadata">

**Author:** [@Szakmary\_Szabolcs](https://discourse.cmake.org/u/Szakmary_Szabolcs)\
**Replies:** 2\
**Last updated:** [December 26, 2023, 6:57am UTC](https://discourse.cmake.org/t/the-c-compiler-is-not-able-to-compile-a-simple-test-program-when-compiling-using-arm-gnu-toolchain/8215 "2023-12-26T06:57:07Z")

</div>

Hi! I am trying to use cmake to generate files for an arm based stm32 board running FreeRTOS. I am using Unix Makefiles and arm-none-eabi-gcc and arm-none-eabi-g++ as C/C++ compilers but I keep getting errors such as “T…

---

## [Build presets do not show up in Visual Studio](https://discourse.cmake.org/t/build-presets-do-not-show-up-in-visual-studio/9715)

<div class="topic-metadata">

**Author:** [@jaquilio](https://discourse.cmake.org/u/jaquilio)\
**Replies:** 0\
**Last updated:** [December 26, 2023, 2:03am UTC](https://discourse.cmake.org/t/build-presets-do-not-show-up-in-visual-studio/9715 "2023-12-26T02:03:57Z")

</div>

I placed the following CMakePresets.json at the root of my source directory. But, the build presets do not get displayed at all in Visual Studio. What might be the error? I am using the latest 17.8.3 version of Visual St…

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

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