# Usage

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

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

**Page:** 62

---

## [Newbie: Can CMake be used to generate embedded systems?](https://discourse.cmake.org/t/newbie-can-cmake-be-used-to-generate-embedded-systems/5763)

<div class="topic-metadata">

**Author:** [@Ignace](https://discourse.cmake.org/u/Ignace)\
**Replies:** 1\
**Last updated:** [May 30, 2022, 9:00pm UTC](https://discourse.cmake.org/t/newbie-can-cmake-be-used-to-generate-embedded-systems/5763 "2022-05-30T21:00:35Z")

</div>

We are currently using a home brewed python based buildsystem. The compiler is the Tasking Compiler which is used to compile sources for embedded system (Infineon Aurix Tricore 32 bit TC27x controller). I want to swit…

---

## [cmake find\_package(X \[version\]) always finds highest version of X if multiple versions installed](https://discourse.cmake.org/t/cmake-find-package-x-version-always-finds-highest-version-of-x-if-multiple-versions-installed/5750)

<div class="topic-metadata">

**Author:** [@tomoreilly](https://discourse.cmake.org/u/tomoreilly)\
**Replies:** 7\
**Last updated:** [May 30, 2022, 12:43pm UTC](https://discourse.cmake.org/t/cmake-find-package-x-version-always-finds-highest-version-of-x-if-multiple-versions-installed/5750 "2022-05-30T12:43:26Z")

</div>

I’m running cmake 3.23.0. I want to find\_library(VTK) based on version criteria. My ubuntu 20.04 system has two installed versions of VTK: /usr/local/lib/cmake/vtk-8.2 /usr/local/lib/cmake/vtk-9.0 My project requires V…

---

## [Multiple conflicting paths for install RUNTIME\_DEPENDENCY SET when library is not header-only on linux](https://discourse.cmake.org/t/multiple-conflicting-paths-for-install-runtime-dependency-set-when-library-is-not-header-only-on-linux/5736)

<div class="topic-metadata">

**Author:** [@pmtneuro](https://discourse.cmake.org/u/pmtneuro)\
**Replies:** 6\
**Last updated:** [May 27, 2022, 6:18pm UTC](https://discourse.cmake.org/t/multiple-conflicting-paths-for-install-runtime-dependency-set-when-library-is-not-header-only-on-linux/5736 "2022-05-27T18:18:48Z")

</div>

I have a cmake project that creates a shared library that uses FFMPEG from vcpkg, and installs the shared library along with FFMPEG .so (or .dll) files using the RUNTIME\_DEPENDENCY\_SET option. On Windows, this works fine…

---

## [Infinite re-run loop with CMake 3.5.1 and Ninja 1.10.0](https://discourse.cmake.org/t/infinite-re-run-loop-with-cmake-3-5-1-and-ninja-1-10-0/1435)

<div class="topic-metadata">

**Author:** [@Holger](https://discourse.cmake.org/u/Holger)\
**Replies:** 16\
**Last updated:** [May 27, 2022, 4:24pm UTC](https://discourse.cmake.org/t/infinite-re-run-loop-with-cmake-3-5-1-and-ninja-1-10-0/1435 "2022-05-27T16:24:08Z")

</div>

I encounter strange behavior when running CMake (3.5.1) in tandem with Ninja (1.10.0): CMake is constantly re-run until Ninja finally gives up with the following message: ninja: error: manifest 'build.ninja' still…

---

## [How to get package X header files if find\_package(X) only sets X\_LIBRARIES but not X\_INCLUDE\_DIRS?](https://discourse.cmake.org/t/how-to-get-package-x-header-files-if-find-package-x-only-sets-x-libraries-but-not-x-include-dirs/5746)

<div class="topic-metadata">

**Author:** [@tomoreilly](https://discourse.cmake.org/u/tomoreilly)\
**Replies:** 1\
**Last updated:** [May 27, 2022, 1:03pm UTC](https://discourse.cmake.org/t/how-to-get-package-x-header-files-if-find-package-x-only-sets-x-libraries-but-not-x-include-dirs/5746 "2022-05-27T13:03:39Z")

</div>

I am trying to understand how to use imported libraries in my project. I have read this documentation, but the concept and jargon are not clear to me. Let’s take a real-world example I’m dealing with now; my project buil…

---

## [cmake find\_package(VTK) doesn't find VTK\_INCLUDE\_DIRS after building VTK from source and installing](https://discourse.cmake.org/t/cmake-find-package-vtk-doesnt-find-vtk-include-dirs-after-building-vtk-from-source-and-installing/5742)

<div class="topic-metadata">

**Author:** [@tomoreilly](https://discourse.cmake.org/u/tomoreilly)\
**Replies:** 1\
**Last updated:** [May 27, 2022, 1:02am UTC](https://discourse.cmake.org/t/cmake-find-package-vtk-doesnt-find-vtk-include-dirs-after-building-vtk-from-source-and-installing/5742 "2022-05-27T01:02:26Z")

</div>

I’m running cmake version 3.23.0-rc1, on ubuntu 20.04. I built vtk-8.2 from source; cmake, make, then ‘make install’. Now I am trying to find the VTK package for my own application, using cmake’s find\_package(VTK). The a…

---

## [How to find directory from glob expression?](https://discourse.cmake.org/t/how-to-find-directory-from-glob-expression/5740)

<div class="topic-metadata">

**Author:** [@tomoreilly](https://discourse.cmake.org/u/tomoreilly)\
**Replies:** 6\
**Last updated:** [May 27, 2022, 1:01am UTC](https://discourse.cmake.org/t/how-to-find-directory-from-glob-expression/5740 "2022-05-27T01:01:21Z")

</div>

My linux machine has directory /usr/local/include/vtk-8.2/ How can cmake find this directory using glob expression “vtk-8”? I tried this: file(GLOB result LIST\_DIRECTORIES true RELATIVE /usr/local “\*vtk-8\*”) But ${re…

---

## [Auto-detect "bad" compiler flags](https://discourse.cmake.org/t/auto-detect-bad-compiler-flags/5738)

<div class="topic-metadata">

**Author:** [@tom](https://discourse.cmake.org/u/tom)\
**Replies:** 3\
**Last updated:** [May 26, 2022, 6:50pm UTC](https://discourse.cmake.org/t/auto-detect-bad-compiler-flags/5738 "2022-05-26T18:50:29Z")

</div>

Hi all, I’ve got an old project that uses the clang /Ox flag for certain configurations on Windows. According to the online clang documentation (Clang Compiler User’s Manual — Clang 11 documentation), this flag is dep…

---

## [Apple Silicon, CMake, Homebrew, Libicu](https://discourse.cmake.org/t/apple-silicon-cmake-homebrew-libicu/5718)

<div class="topic-metadata">

**Author:** [@sprout](https://discourse.cmake.org/u/sprout)\
**Replies:** 13\
**Last updated:** [May 26, 2022, 1:32pm UTC](https://discourse.cmake.org/t/apple-silicon-cmake-homebrew-libicu/5718 "2022-05-26T13:32:20Z")

</div>

Okay, as you can guess from the subject header this is a complex question spanning multiple systems but I think the problem is with cmake. For a project, a small interpreter named egel, I now develop on a Macbook Air M1…

---

## [Newbie needs help on Step4](https://discourse.cmake.org/t/newbie-needs-help-on-step4/5722)

<div class="topic-metadata">

**Author:** [@BlueFlash](https://discourse.cmake.org/u/BlueFlash)\
**Replies:** 4\
**Last updated:** [May 25, 2022, 4:25pm UTC](https://discourse.cmake.org/t/newbie-needs-help-on-step4/5722 "2022-05-25T16:25:23Z")

</div>

I’m completely new to CMake, so I’m running through the Tutorial. Everything seems to be working fine, until I reach Step4. https://cmake.org/cmake/help/latest/guide/tutorial/Installing%20and%20Testing.html I have cma…

---

## [What CMake generation parameter determines CMAKE\_CXX\_STANDARD\_LIBRARIES ?](https://discourse.cmake.org/t/what-cmake-generation-parameter-determines-cmake-cxx-standard-libraries/5724)

<div class="topic-metadata">

**Author:** [@Rich\_von\_Lehe](https://discourse.cmake.org/u/Rich_von_Lehe)\
**Replies:** 1\
**Last updated:** [May 24, 2022, 11:11pm UTC](https://discourse.cmake.org/t/what-cmake-generation-parameter-determines-cmake-cxx-standard-libraries/5724 "2022-05-24T23:11:57Z")

</div>

I had some trouble getting the correct value for CMAKE\_CXX\_STANDARD\_LIBRARIES when doing my CMake generation via a Qt Creator ‘kit’. With the following generation command I ended up with those libraries set to: kernel32…

---

## [Install library with GET\_RUNTIME\_DEPENDENCIES from POST\_EXCLUDE\_FILES\_STRICT](https://discourse.cmake.org/t/install-library-with-get-runtime-dependencies-from-post-exclude-files-strict/5715)

<div class="topic-metadata">

**Author:** [@NathanielMcVicar](https://discourse.cmake.org/u/NathanielMcVicar)\
**Replies:** 2\
**Last updated:** [May 23, 2022, 10:43pm UTC](https://discourse.cmake.org/t/install-library-with-get-runtime-dependencies-from-post-exclude-files-strict/5715 "2022-05-23T22:43:21Z")

</div>

I’ve looked through the many posts about GET\_RUNTIME\_DEPENDENCIES and don’t see my question answered, but I apologize if I missed something. I am trying to install some libraries required for a target. These libraries a…

---

## [Cmake in a Conda Environment](https://discourse.cmake.org/t/cmake-in-a-conda-environment/5697)

<div class="topic-metadata">

**Author:** [@dbalentine](https://discourse.cmake.org/u/dbalentine)\
**Replies:** 3\
**Last updated:** [May 23, 2022, 9:45pm UTC](https://discourse.cmake.org/t/cmake-in-a-conda-environment/5697 "2022-05-23T21:45:55Z")

</div>

Hello. I am using anaconda 21.48.22.159-1 to create an env. I would like to install the ANTs package (refferenced via this tutorial) Install Advanced Normalization Tools | Greydon Gilmore. In terms of the environment I…

---

## [CMAKE\_TOOLCHAIN\_FILE properly updated by profiles but still somehow cached after switching](https://discourse.cmake.org/t/cmake-toolchain-file-properly-updated-by-profiles-but-still-somehow-cached-after-switching/5713)

<div class="topic-metadata">

**Author:** [@Jebolicious](https://discourse.cmake.org/u/Jebolicious)\
**Replies:** 3\
**Last updated:** [May 23, 2022, 9:43pm UTC](https://discourse.cmake.org/t/cmake-toolchain-file-properly-updated-by-profiles-but-still-somehow-cached-after-switching/5713 "2022-05-23T21:43:13Z")

</div>

Hi, I’m fairly new to CMake but quickly diving into its features. As we are compiling for MCU’s we’re using arm-none-eabi as the primary toolchain. However, our unit tests are executed on x86, requiring multiple toolch…

---

## [Setting compiler floating point behavior](https://discourse.cmake.org/t/setting-compiler-floating-point-behavior/5705)

<div class="topic-metadata">

**Author:** [@ramcdona](https://discourse.cmake.org/u/ramcdona)\
**Replies:** 1\
**Last updated:** [May 22, 2022, 8:36am UTC](https://discourse.cmake.org/t/setting-compiler-floating-point-behavior/5705 "2022-05-22T08:36:10Z")

</div>

Is there a CMake way of setting a compiler’s floating point behavior? Specifically, I’d like to set Strict IEEE 754 compliance and have it take effect across platforms.

---

## [for android build cmake](https://discourse.cmake.org/t/for-android-build-cmake/5682)

<div class="topic-metadata">

**Author:** [@mumin16](https://discourse.cmake.org/u/mumin16)\
**Replies:** 3\
**Last updated:** [May 19, 2022, 11:30am UTC](https://discourse.cmake.org/t/for-android-build-cmake/5682 "2022-05-19T11:30:56Z")

</div>

for android build, CMAKE\_C\_COMPILER must manually set FILEPATH for c compiler. otherwise we get error “incompatible with elf\_x86\_64”. i think that cmake can’t choose correct c compiler for android build. i set those: …

---

## [CMake install does not respect the SGID bit](https://discourse.cmake.org/t/cmake-install-does-not-respect-the-sgid-bit/5685)

<div class="topic-metadata">

**Author:** [@dipietrantonio](https://discourse.cmake.org/u/dipietrantonio)\
**Replies:** 3\
**Last updated:** [May 18, 2022, 4:12pm UTC](https://discourse.cmake.org/t/cmake-install-does-not-respect-the-sgid-bit/5685 "2022-05-18T16:12:55Z")

</div>

Dear Cmake devs, I am having issues with files installed using CMake in a directory tree with the SGID bit set. When set on a directory, the SGID permission bit makes such that all files under that directory will have …

---

## [using ctest -T memcheck - corrupt log files?](https://discourse.cmake.org/t/using-ctest-t-memcheck-corrupt-log-files/5689)

<div class="topic-metadata">

**Author:** [@KentWilliams](https://discourse.cmake.org/u/KentWilliams)\
**Replies:** 2\
**Last updated:** [May 18, 2022, 3:13pm UTC](https://discourse.cmake.org/t/using-ctest-t-memcheck-corrupt-log-files/5689 "2022-05-18T15:13:12Z")

</div>

ENVIRONMENT: Intel Core I5 running Rocky Linux 8 and Cmake/CTest 3.20.2 I include this in our top level CMakeLists.txt: find\_program(MEMORYCHECK\_COMMAND valgrind) include(CTest) enable\_testing() We don’t have a dashbo…

---

## [How to get C system header search directories?](https://discourse.cmake.org/t/how-to-get-c-system-header-search-directories/5683)

<div class="topic-metadata">

**Author:** [@tomoreilly](https://discourse.cmake.org/u/tomoreilly)\
**Replies:** 1\
**Last updated:** [May 17, 2022, 9:38pm UTC](https://discourse.cmake.org/t/how-to-get-c-system-header-search-directories/5683 "2022-05-17T21:38:44Z")

</div>

How to get the C system header directories, e.g. where does gcc look to find a system header file ("#include \<someSystemHeader\>")? I have a very short test file: cmake\_minimum\_required(VERSION 3.18) set(CMAKE\_SYSTEM\_NA…

---

## [find\_package can't find Find\<lib\>.cmake](https://discourse.cmake.org/t/find-package-cant-find-find-lib-cmake/5673)

<div class="topic-metadata">

**Author:** [@Rince](https://discourse.cmake.org/u/Rince)\
**Replies:** 3\
**Last updated:** [May 17, 2022, 11:08am UTC](https://discourse.cmake.org/t/find-package-cant-find-find-lib-cmake/5673 "2022-05-17T11:08:24Z")

</div>

I get the following error for a dependency fetched by Conan: CMake Error at /home/rince/MyApp/CMakeLists.txt:19 (find\_package): By not providing "Findyaml-cpp.cmake" in CMAKE\_MODULE\_PATH this project has asked CMake…

---

## [Do CMake "interface"(?) presets exist?](https://discourse.cmake.org/t/do-cmake-interface-presets-exist/5671)

<div class="topic-metadata">

**Author:** [@Cascades](https://discourse.cmake.org/u/Cascades)\
**Replies:** 3\
**Last updated:** [May 17, 2022, 8:55am UTC](https://discourse.cmake.org/t/do-cmake-interface-presets-exist/5671 "2022-05-17T08:55:09Z")

</div>

Hi all, given a situation where a CMakePresets.json is distributed in a codebase, and users are expected to modify certain values in their own CMakeUserPresets.json, is there any way to suggests to an IDE (or even cmake …

---

## [target\_include\_directory SYSTEM fails with Xcode](https://discourse.cmake.org/t/target-include-directory-system-fails-with-xcode/5423)

<div class="topic-metadata">

**Author:** [@jakemumu](https://discourse.cmake.org/u/jakemumu)\
**Replies:** 2\
**Last updated:** [May 16, 2022, 10:25pm UTC](https://discourse.cmake.org/t/target-include-directory-system-fails-with-xcode/5423 "2022-05-16T22:25:08Z")

</div>

Hi – Attempting to include a portion of code as a “system” header group fails in Xcode: The library: file(GLOB\_RECURSE Sources ${CMAKE\_CURRENT\_LIST\_DIR}/\*.cpp ${CMAKE\_CURRENT\_LIST\_DIR}/\*.c ${CMAKE\_CUR…

---

## [make install error](https://discourse.cmake.org/t/make-install-error/5654)

<div class="topic-metadata">

**Author:** [@Urinboev\_i](https://discourse.cmake.org/u/Urinboev_i)\
**Replies:** 1\
**Last updated:** [May 11, 2022, 8:09pm UTC](https://discourse.cmake.org/t/make-install-error/5654 "2022-05-11T20:09:09Z")

</div>

Hi, I encountered the following error while installing the cmake on my server. how can i fix this CMake Error at Source/kwsys/cmake\_install.cmake:46 (file): file cannot create directory: /usr/local/doc/cmake-3.22/cmsys…

---

## [CMake pulls this empty libdl.a and compilation ends with nvlink fatal : Could not open input file '/usr/lib/libdl.a'.](https://discourse.cmake.org/t/cmake-pulls-this-empty-libdl-a-and-compilation-ends-with-nvlink-fatal-could-not-open-input-file-usr-lib-libdl-a/5642)

<div class="topic-metadata">

**Author:** [@miguelcarcamov](https://discourse.cmake.org/u/miguelcarcamov)\
**Replies:** 3\
**Last updated:** [May 11, 2022, 1:42pm UTC](https://discourse.cmake.org/t/cmake-pulls-this-empty-libdl-a-and-compilation-ends-with-nvlink-fatal-could-not-open-input-file-usr-lib-libdl-a/5642 "2022-05-11T13:42:39Z")

</div>

Hi there, I’m currently compiling my CUDA project with CMake 3.23.0. However, I’m experiencing an error that haven’t seen before. This is my CMakeLists.txt: cmake\_minimum\_required(VERSION 3.16 FATAL\_ERROR) project(gpuv…

---

## [How to set up compilation with Intel Fortran compiler on Windows correctly?](https://discourse.cmake.org/t/how-to-set-up-compilation-with-intel-fortran-compiler-on-windows-correctly/532)

<div class="topic-metadata">

**Author:** [@MartinBeseda](https://discourse.cmake.org/u/MartinBeseda)\
**Replies:** 11\
**Last updated:** [May 10, 2022, 6:01pm UTC](https://discourse.cmake.org/t/how-to-set-up-compilation-with-intel-fortran-compiler-on-windows-correctly/532 "2022-05-10T18:01:13Z")

</div>

Hello, I’m trying to build my C/C++/Fortran project both on Ubuntu and Windows10. The compilation on Linux posses no problems, but Intel Fortran compiler on Windows seems to cause great complications for CMake. I’ve tr…

---

## [CMake: How to set dependency from executable to custom command](https://discourse.cmake.org/t/cmake-how-to-set-dependency-from-executable-to-custom-command/5623)

<div class="topic-metadata">

**Author:** [@swaraj\_somala](https://discourse.cmake.org/u/swaraj_somala)\
**Replies:** 1\
**Last updated:** [May 6, 2022, 7:37am UTC](https://discourse.cmake.org/t/cmake-how-to-set-dependency-from-executable-to-custom-command/5623 "2022-05-06T07:37:36Z")

</div>

I am trying to generate checksum for the executable using add\_custom\_command. project(demo) cmake\_minimum\_required(VERSION 3.12) set(FILE\_NAME Demo.cpp) set(GEN\_FILE\_NAME ExeHashsha256) set(EXE\_NAME demoExe) add\_executa…

---

## [How to use the CMakeGraphVizOptions support](https://discourse.cmake.org/t/how-to-use-the-cmakegraphvizoptions-support/5609)

<div class="topic-metadata">

**Author:** [@JuliusCaesar](https://discourse.cmake.org/u/JuliusCaesar)\
**Replies:** 2\
**Last updated:** [May 5, 2022, 12:42pm UTC](https://discourse.cmake.org/t/how-to-use-the-cmakegraphvizoptions-support/5609 "2022-05-05T12:42:41Z")

</div>

Hey guys, I noticed that CMake has a nice build in graphviz support. Now I now how that you can generate is graphwiz file using the command line cmake --preset foo --graphviz=foo.dot dot -Tsvg -o foo.dot Now is it po…

---

## [QNX7.0 and openssl 1.1.1](https://discourse.cmake.org/t/qnx7-0-and-openssl-1-1-1/5567)

<div class="topic-metadata">

**Author:** [@georg](https://discourse.cmake.org/u/georg)\
**Replies:** 5\
**Last updated:** [May 4, 2022, 4:47pm UTC](https://discourse.cmake.org/t/qnx7-0-and-openssl-1-1-1/5567 "2022-05-04T16:47:27Z")

</div>

Hi all, QNX 7.0 by default ships with openssl 1.0.2 but allows to install openssl 1.1.1 in parallel, see this technical article: OpenSSL version 1.0.2: libcrypto.so.2 and libssl.so.2, headers under usr/include/openssl …

---

## [WINDOWS\_EXPORT\_ALL\_SYMBOLS vcxproj command failing](https://discourse.cmake.org/t/windows-export-all-symbols-vcxproj-command-failing/5578)

<div class="topic-metadata">

**Author:** [@david-fong](https://discourse.cmake.org/u/david-fong)\
**Replies:** 8\
**Last updated:** [May 2, 2022, 9:48pm UTC](https://discourse.cmake.org/t/windows-export-all-symbols-vcxproj-command-failing/5578 "2022-05-02T21:48:49Z")

</div>

I just tried using CMAKE\_WINDOWS\_EXPORT\_ALL\_SYMBOLS. when I run cmake build, I get an error saying C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets(152…

---

## [Adding a library to a qt6 cmake project](https://discourse.cmake.org/t/adding-a-library-to-a-qt6-cmake-project/5529)

<div class="topic-metadata">

**Author:** [@michaelhue](https://discourse.cmake.org/u/michaelhue)\
**Replies:** 11\
**Last updated:** [May 2, 2022, 11:54am UTC](https://discourse.cmake.org/t/adding-a-library-to-a-qt6-cmake-project/5529 "2022-05-02T11:54:13Z")

</div>

Hello guys, i am just trying to use a library for a robot in my qt6 project. in my cmake file i have added the library.h file to the project sources and i have added the library.lib file like follows: target\_link\_libr…

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

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