# Usage

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

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

**Page:** 19

---

## [Why do private linked targets leak out in install targets ?](https://discourse.cmake.org/t/why-do-private-linked-targets-leak-out-in-install-targets/13076)

<div class="topic-metadata">

**Author:** [@a4z](https://discourse.cmake.org/u/a4z)\
**Replies:** 9\
**Last updated:** [November 28, 2024, 6:37pm UTC](https://discourse.cmake.org/t/why-do-private-linked-targets-leak-out-in-install-targets/13076 "2024-11-28T18:37:47Z")

</div>

I have added a make install target to my library , and this library links private against another one. There are no build or runtime dependencies to other one. Why do I need the other one in the export targets? How ca…

---

## [Latest CMAKE, ExternalProject\_Add not generating library build files](https://discourse.cmake.org/t/latest-cmake-externalproject-add-not-generating-library-build-files/13066)

<div class="topic-metadata">

**Author:** [@GameCodingNinja](https://discourse.cmake.org/u/GameCodingNinja)\
**Replies:** 1\
**Last updated:** [November 28, 2024, 4:21pm UTC](https://discourse.cmake.org/t/latest-cmake-externalproject-add-not-generating-library-build-files/13066 "2024-11-28T16:21:15Z")

</div>

I have a game I develop in Arch Linux. I use CMake to generate the build files for the game level code and the other libraries. I use ExternalProject\_Add to generate the build files for the libraries. For the longest ti…

---

## [Set global Compile option flag, Intel compiler Vectorization report txt file for each generated object.](https://discourse.cmake.org/t/set-global-compile-option-flag-intel-compiler-vectorization-report-txt-file-for-each-generated-object/13089)

<div class="topic-metadata">

**Author:** [@MickeJ](https://discourse.cmake.org/u/MickeJ)\
**Replies:** 1\
**Last updated:** [November 28, 2024, 4:01pm UTC](https://discourse.cmake.org/t/set-global-compile-option-flag-intel-compiler-vectorization-report-txt-file-for-each-generated-object/13089 "2024-11-28T16:01:38Z")

</div>

Hi Intel compiler has an compile option flag that generates a vectorization report txt file. I am looking for tips on how to set this as an global option and put the report for each Cmake generated sub directories “CM…

---

## [CheckIPOSupported not regarded CMAKE\_LINKER\_TYPE](https://discourse.cmake.org/t/checkiposupported-not-regarded-cmake-linker-type/13082)

<div class="topic-metadata">

**Author:** [@gyatpear](https://discourse.cmake.org/u/gyatpear)\
**Replies:** 3\
**Last updated:** [November 28, 2024, 9:02am UTC](https://discourse.cmake.org/t/checkiposupported-not-regarded-cmake-linker-type/13082 "2024-11-28T09:02:32Z")

</div>

At the present time, GCC LTO cannot link with LLVM LLD, but CheckIPOSupported may give different answer depending on how cmake command line invoked. For CC=gcc CXX=g++ LDFLAGS=-fuse-ld=lld cmake CheckIPOSupported retu…

---

## [run-clang-tidy checks each source file N times on Multi-Config generator projects?](https://discourse.cmake.org/t/run-clang-tidy-checks-each-source-file-n-times-on-multi-config-generator-projects/13046)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 4\
**Last updated:** [November 27, 2024, 8:05pm UTC](https://discourse.cmake.org/t/run-clang-tidy-checks-each-source-file-n-times-on-multi-config-generator-projects/13046 "2024-11-27T20:05:07Z")

</div>

How to check the source files only 1 times with run-clang-tidy? I have an header only library with one example and one test source. I create a “Ninja Multi-Config” generator with this types: CMAKE\_CONFIGURATION\_TYPES=“…

---

## [I am getting error by installing a treeseg package in virtual ubuntu](https://discourse.cmake.org/t/i-am-getting-error-by-installing-a-treeseg-package-in-virtual-ubuntu/13078)

<div class="topic-metadata">

**Author:** [@hermane](https://discourse.cmake.org/u/hermane)\
**Replies:** 1\
**Last updated:** [November 27, 2024, 8:20pm UTC](https://discourse.cmake.org/t/i-am-getting-error-by-installing-a-treeseg-package-in-virtual-ubuntu/13078 "2024-11-27T20:20:47Z")

</div>

hermane@DESKTOP-CAF2ER5:/mnt/c/Users/Precision 7510/treeseg/build$ ls -l total 120 -rwxrwxrwx 1 hermane hermane 88962 Nov 27 2024 CMakeCache.txt drwxrwxrwx 1 hermane hermane 4096 Nov 27 2024 CMakeFiles -rwxrwxrwx …

---

## [custom linker tool using 3.29 LINKER\_TYPE](https://discourse.cmake.org/t/custom-linker-tool-using-3-29-linker-type/13075)

<div class="topic-metadata">

**Author:** [@FloneStar](https://discourse.cmake.org/u/FloneStar)\
**Replies:** 5\
**Last updated:** [November 27, 2024, 2:04pm UTC](https://discourse.cmake.org/t/custom-linker-tool-using-3-29-linker-type/13075 "2024-11-27T14:04:25Z")

</div>

in our project we have the need to run a custom linker tool. This custom linker tool is supposed to be used for only some targets (some shared libs will be linked the normal way), not all. I have successfully registered …

---

## [CMake works for Linux but not for Windows: runtime error, DLLS not found](https://discourse.cmake.org/t/cmake-works-for-linux-but-not-for-windows-runtime-error-dlls-not-found/12998)

<div class="topic-metadata">

**Author:** [@ferdymercury](https://discourse.cmake.org/u/ferdymercury)\
**Replies:** 3\
**Last updated:** [November 24, 2024, 10:10am UTC](https://discourse.cmake.org/t/cmake-works-for-linux-but-not-for-windows-runtime-error-dlls-not-found/12998 "2024-11-24T10:10:38Z")

</div>

I have a CMake project which builds fine both on Windows and on Linux. However, the program only runs well on Linux. On Windows, it fails with a runtime error about the DLLs not being found in the runtime path: \[Qt\] E…

---

## [Special Characters within the folder structure of CMake project causing compilation and execution issues](https://discourse.cmake.org/t/special-characters-within-the-folder-structure-of-cmake-project-causing-compilation-and-execution-issues/12971)

<div class="topic-metadata">

**Author:** [@VaishnaviCherukuri](https://discourse.cmake.org/u/VaishnaviCherukuri)\
**Replies:** 9\
**Last updated:** [November 21, 2024, 10:11pm UTC](https://discourse.cmake.org/t/special-characters-within-the-folder-structure-of-cmake-project-causing-compilation-and-execution-issues/12971 "2024-11-21T22:11:07Z")

</div>

Hi CMake Community, I recently migrated my development environment from Windows 10 to Windows 11, and I’ve run into a problem with compiling my project using CMake. The error message I’m getting is: ERROR: ‘c:\\users\\…

---

## [Using VS Generator without a vswhere findable VS install](https://discourse.cmake.org/t/using-vs-generator-without-a-vswhere-findable-vs-install/13009)

<div class="topic-metadata">

**Author:** [@Neumann-A](https://discourse.cmake.org/u/Neumann-A)\
**Replies:** 2\
**Last updated:** [November 21, 2024, 12:58pm UTC](https://discourse.cmake.org/t/using-vs-generator-without-a-vswhere-findable-vs-install/13009 "2024-11-21T12:58:13Z")

</div>

Following situation: I have a “portable” (meaning it wasn’t installed) VS and the environment is already set up similar to vcvars env (Meaning it works without problems for Ninja & MSBuild). I would like to run CMake c…

---

## [VERIFY\_INTERFACE\_HEADER\_SETS and private headers](https://discourse.cmake.org/t/verify-interface-header-sets-and-private-headers/13006)

<div class="topic-metadata">

**Author:** [@tsdgeos](https://discourse.cmake.org/u/tsdgeos)\
**Replies:** 0\
**Last updated:** [November 20, 2024, 10:12pm UTC](https://discourse.cmake.org/t/verify-interface-header-sets-and-private-headers/13006 "2024-11-20T22:12:42Z")

</div>

I have recently discovered VERIFY\_INTERFACE\_HEADER\_SETS and it seems like a super useful tool, but I am having trouble making it be useful in a project that uses private headers (i.e. headers that don’t get installed). T…

---

## [CMake two projects for a game/engine, what am I trying to do?](https://discourse.cmake.org/t/cmake-two-projects-for-a-game-engine-what-am-i-trying-to-do/13001)

<div class="topic-metadata">

**Author:** [@freddycatking](https://discourse.cmake.org/u/freddycatking)\
**Replies:** 1\
**Last updated:** [November 20, 2024, 2:25pm UTC](https://discourse.cmake.org/t/cmake-two-projects-for-a-game-engine-what-am-i-trying-to-do/13001 "2024-11-20T14:25:36Z")

</div>

I am a new C++ programmer so I’m only just getting a grasp on the language itself, but learning the CMake has been an absolute pitfall for me. I’ve gotten the hang of it (mostly) for one project, but my plan for making a…

---

## [Can't add linker options no matter what](https://discourse.cmake.org/t/cant-add-linker-options-no-matter-what/12941)

<div class="topic-metadata">

**Author:** [@nolan](https://discourse.cmake.org/u/nolan)\
**Replies:** 2\
**Last updated:** [November 20, 2024, 7:54am UTC](https://discourse.cmake.org/t/cant-add-linker-options-no-matter-what/12941 "2024-11-20T07:54:33Z")

</div>

Hey folks, not sure what I’m doing wrong here. I’m attempting to build a CMake project, github .com/duckdb/duckdb\_spatial for Android and am failing to set linker options for a dependency. The project uses a Makefile to…

---

## [compile flags for SwiftUI previews](https://discourse.cmake.org/t/compile-flags-for-swiftui-previews/12989)

<div class="topic-metadata">

**Author:** [@purpleKarrot](https://discourse.cmake.org/u/purpleKarrot)\
**Replies:** 0\
**Last updated:** [November 19, 2024, 11:27am UTC](https://discourse.cmake.org/t/compile-flags-for-swiftui-previews/12989 "2024-11-19T11:27:46Z")

</div>

Xcode complains that my app needs the -Onone optimisation level to use previews, while the current setting was -O. Is there a way to change the compile flags for SwiftUI previews from CMake? Even if I change CMAKE\_Swift…

---

## [CMAKE\_LINKER\_TYPE when cross-compiling not passing correct options](https://discourse.cmake.org/t/cmake-linker-type-when-cross-compiling-not-passing-correct-options/12985)

<div class="topic-metadata">

**Author:** [@palmerc](https://discourse.cmake.org/u/palmerc)\
**Replies:** 6\
**Last updated:** [November 19, 2024, 10:30am UTC](https://discourse.cmake.org/t/cmake-linker-type-when-cross-compiling-not-passing-correct-options/12985 "2024-11-19T10:30:29Z")

</div>

Cross-compiling for CMAKE\_SYSTEM\_NAME Darwin using CMAKE\_LINKER\_TYPE LLD does not provide valid command-line options to the linker. Is this expected?

---

## ["Unresolved external symbol" while trying to include a header](https://discourse.cmake.org/t/unresolved-external-symbol-while-trying-to-include-a-header/12980)

<div class="topic-metadata">

**Author:** [@AndrewC243](https://discourse.cmake.org/u/AndrewC243)\
**Replies:** 1\
**Last updated:** [November 19, 2024, 1:40am UTC](https://discourse.cmake.org/t/unresolved-external-symbol-while-trying-to-include-a-header/12980 "2024-11-19T01:40:06Z")

</div>

Hi all, apologies if this is obvious or a commonly asked question but I feel truly helpless right now; I’ve searched what feels like countless similar questions and am unable to figure out what I’m doing wrong for what I…

---

## [Creating shared library using Cmake](https://discourse.cmake.org/t/creating-shared-library-using-cmake/12960)

<div class="topic-metadata">

**Author:** [@Umer](https://discourse.cmake.org/u/Umer)\
**Replies:** 3\
**Last updated:** [November 15, 2024, 3:25pm UTC](https://discourse.cmake.org/t/creating-shared-library-using-cmake/12960 "2024-11-15T15:25:12Z")

</div>

Hello everyone, I need some guidance on creating a shared library using CMake. My C++ project is already configured in Visual Studio, with the target set to generate a DLL library. I now need to create a shared library …

---

## [Preventing auto-update](https://discourse.cmake.org/t/preventing-auto-update/12958)

<div class="topic-metadata">

**Author:** [@Rickular](https://discourse.cmake.org/u/Rickular)\
**Replies:** 5\
**Last updated:** [November 14, 2024, 8:52pm UTC](https://discourse.cmake.org/t/preventing-auto-update/12958 "2024-11-14T20:52:06Z")

</div>

Is there a way to prevent CMake from automatically updating to the newest version without asking? I install CMake on Windows using chocolatey, but even if I ‘choco pin’ it to a known working version, it still automatica…

---

## [Behavior of CMake installed export files with multiple configurations](https://discourse.cmake.org/t/behavior-of-cmake-installed-export-files-with-multiple-configurations/12959)

<div class="topic-metadata">

**Author:** [@nappl](https://discourse.cmake.org/u/nappl)\
**Replies:** 0\
**Last updated:** [November 13, 2024, 5:13am UTC](https://discourse.cmake.org/t/behavior-of-cmake-installed-export-files-with-multiple-configurations/12959 "2024-11-13T05:13:08Z")

</div>

I have a C project which depends on a set of various other components. These components also use CMake for their build system and have installation directives similar to the following: add\_library(libfoo STATIC) # ... s…

---

## [Ask for help in reading generator expression](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920)

<div class="topic-metadata">

**Author:** [@Fabian188](https://discourse.cmake.org/u/Fabian188)\
**Replies:** 4\
**Last updated:** [November 12, 2024, 9:20pm UTC](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920 "2024-11-12T21:20:28Z")

</div>

Can I somehow print what this expression sets? target\_link\_libraries(cfs PUBLIC $\<LINK\_ONLY:MKL::MKL\>) Thanks

---

## [Getting a linker error on one of the dll on windows-latest](https://discourse.cmake.org/t/getting-a-linker-error-on-one-of-the-dll-on-windows-latest/12898)

<div class="topic-metadata">

**Author:** [@Shepard](https://discourse.cmake.org/u/Shepard)\
**Replies:** 1\
**Last updated:** [November 12, 2024, 12:59am UTC](https://discourse.cmake.org/t/getting-a-linker-error-on-one-of-the-dll-on-windows-latest/12898 "2024-11-12T00:59:56Z")

</div>

So I’m working on a project that has build&test on ubuntu-latest and windows-latest. Ubuntu-latest workflow works without a problem, but the windows-latest returns a linker error: 2024-11-05T10:50:55.6113330Z LINK : fa…

---

## [how to depend on unknown generated files?](https://discourse.cmake.org/t/how-to-depend-on-unknown-generated-files/12939)

<div class="topic-metadata">

**Author:** [@yushang](https://discourse.cmake.org/u/yushang)\
**Replies:** 0\
**Last updated:** [November 11, 2024, 1:26pm UTC](https://discourse.cmake.org/t/how-to-depend-on-unknown-generated-files/12939 "2024-11-11T13:26:08Z")

</div>

Hi guys, I have a scenario that will compile all files generated by a custom target. The files are unknown(but all cpp files) until the cutsom command is run. So, I can’t add the generated files to my executable target …

---

## [Graphviz, how to configure graphviz options?](https://discourse.cmake.org/t/graphviz-how-to-configure-graphviz-options/12938)

<div class="topic-metadata">

**Author:** [@MickeJ](https://discourse.cmake.org/u/MickeJ)\
**Replies:** 1\
**Last updated:** [November 11, 2024, 12:51pm UTC](https://discourse.cmake.org/t/graphviz-how-to-configure-graphviz-options/12938 "2024-11-11T12:51:23Z")

</div>

Hi. I can not get Graphviz options to work. I generate a graph using a custom module below, and executing the target produces a png graph. include\_guard(GLOBAL) add\_custom\_target(graphviz ALL COMMAND ${CMAKE\_COMMAND…

---

## [The new cmake version cannot overwrite the old version](https://discourse.cmake.org/t/the-new-cmake-version-cannot-overwrite-the-old-version/12904)

<div class="topic-metadata">

**Author:** [@Tom\_Xu](https://discourse.cmake.org/u/Tom_Xu)\
**Replies:** 8\
**Last updated:** [November 11, 2024, 2:28am UTC](https://discourse.cmake.org/t/the-new-cmake-version-cannot-overwrite-the-old-version/12904 "2024-11-11T02:28:28Z")

</div>

I installed the new version of Cmake and configured the path,but it didn’t work,I also can’t find how to uninstall version 2.8.2

---

## [Single user customization point for multiple build tools](https://discourse.cmake.org/t/single-user-customization-point-for-multiple-build-tools/12932)

<div class="topic-metadata">

**Author:** [@gaz0](https://discourse.cmake.org/u/gaz0)\
**Replies:** 0\
**Last updated:** [November 10, 2024, 8:24pm UTC](https://discourse.cmake.org/t/single-user-customization-point-for-multiple-build-tools/12932 "2024-11-10T20:24:54Z")

</div>

I’m using Catch2 that I have cloned into a local Git repository. I am testing with multiple compilers, so I have multiple binary directories and so multiple cache files. I’d like to specify the Catch2 location in one …

---

## [Total newbie: needs help converting filenames to corresponding identifiers](https://discourse.cmake.org/t/total-newbie-needs-help-converting-filenames-to-corresponding-identifiers/12930)

<div class="topic-metadata">

**Author:** [@Johnwz](https://discourse.cmake.org/u/Johnwz)\
**Replies:** 0\
**Last updated:** [November 10, 2024, 5:47pm UTC](https://discourse.cmake.org/t/total-newbie-needs-help-converting-filenames-to-corresponding-identifiers/12930 "2024-11-10T17:47:02Z")

</div>

Greetings CMake forum! This place looks familiar because I’m a member of another Discourse-powered forum :slight\_smile: Here’s my situation. I wrote several SFML projects for my own amusement, and hardcoded paths to all…

---

## [Problems linking on Linux](https://discourse.cmake.org/t/problems-linking-on-linux/12922)

<div class="topic-metadata">

**Author:** [@perdrix](https://discourse.cmake.org/u/perdrix)\
**Replies:** 5\
**Last updated:** [November 10, 2024, 9:12am UTC](https://discourse.cmake.org/t/problems-linking-on-linux/12922 "2024-11-10T09:12:59Z")

</div>

I’m not very experienced at Linux development, so please be kind :slight\_smile: I’m trying to link with libtiff.a (static library) which is in /usr/local/lib I have this in my CMakeLists.txt: # Link with other targets…

---

## [CMake Warning: No source or binary directory provided.](https://discourse.cmake.org/t/cmake-warning-no-source-or-binary-directory-provided/12883)

<div class="topic-metadata">

**Author:** [@HallofFamer](https://discourse.cmake.org/u/HallofFamer)\
**Replies:** 3\
**Last updated:** [November 10, 2024, 3:00am UTC](https://discourse.cmake.org/t/cmake-warning-no-source-or-binary-directory-provided/12883 "2024-11-10T03:00:06Z")

</div>

Hi, I’ve been using CMake for my project since almost 2 years ago, it always worked fine for me both on Windows and Linux. However, recently when I try to build it locally in my windows machine following an update to Vi…

---

## [Weird flags diagnostics](https://discourse.cmake.org/t/weird-flags-diagnostics/12912)

<div class="topic-metadata">

**Author:** [@kurapov-peter](https://discourse.cmake.org/u/kurapov-peter)\
**Replies:** 1\
**Last updated:** [November 8, 2024, 2:35am UTC](https://discourse.cmake.org/t/weird-flags-diagnostics/12912 "2024-11-08T02:35:14Z")

</div>

Hi! I noticed some confusing behavior in arguments parsing/diagnostics when mistyped --build: cmake --bulid build/RelWithDebInfo/ --parallel 8 CMake Warning: Ignoring extra path from command line: "8" CMake …

---

## [Test.xml documentation](https://discourse.cmake.org/t/test-xml-documentation/12910)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 0\
**Last updated:** [November 7, 2024, 12:48pm UTC](https://discourse.cmake.org/t/test-xml-documentation/12910 "2024-11-07T12:48:05Z")

</div>

Hello, Could you please point me to some documentation on the contents and fields of Test.xml file, output of ctest. Trued to find some information on what “Exit Code” and “Exit Value” entries are, but could not find so…

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

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