# Usage

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

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

**Page:** 74

---

## [Does \`find\_package\` find in \`CMAKE\_INSTALL\_PREFIX\`?](https://discourse.cmake.org/t/does-find-package-find-in-cmake-install-prefix/4063)

<div class="topic-metadata">

**Author:** [@Ronald](https://discourse.cmake.org/u/Ronald)\
**Replies:** 5\
**Last updated:** [September 12, 2021, 5:36am UTC](https://discourse.cmake.org/t/does-find-package-find-in-cmake-install-prefix/4063 "2021-09-12T05:36:29Z")

</div>

Env OS: Windows cmake: 3.21.2 Case wxWidgets installed in a custom folder like C:\\Users\\abc\\AppData\\Local\\Programs\\installed\_libs. CMAKE\_PREFIX\_PATH not set only -DCMAKE\_INSTALL\_PREFIX=C:\\Users\\abc\\AppData\\Local\\Prog…

---

## [How get get the path of the installed executable?](https://discourse.cmake.org/t/how-get-get-the-path-of-the-installed-executable/4054)

<div class="topic-metadata">

**Author:** [@Ronald](https://discourse.cmake.org/u/Ronald)\
**Replies:** 7\
**Last updated:** [September 12, 2021, 2:18am UTC](https://discourse.cmake.org/t/how-get-get-the-path-of-the-installed-executable/4054 "2021-09-12T02:18:37Z")

</div>

On Linux for item Exec of .desktop, it needs the path of the executable? Is there any better way than manully constructing as below? set(Item\_Exec ${CMAKE\_INSTALL\_FULL\_BINDIR}\>/\<target\_name\>)

---

## [Boost minimum version isn't?](https://discourse.cmake.org/t/boost-minimum-version-isnt/4055)

<div class="topic-metadata">

**Author:** [@jwm](https://discourse.cmake.org/u/jwm)\
**Replies:** 3\
**Last updated:** [September 10, 2021, 6:02am UTC](https://discourse.cmake.org/t/boost-minimum-version-isnt/4055 "2021-09-10T06:02:34Z")

</div>

I’m trying to build GNU Radio (master). It has a minimum Boost version of 1.65 asserted. However, it appears that their custom CMake module is unintentionally allowing older Boost versions. (I’ve looked at Best practice…

---

## [cmake build disregards CMAKE\_BUILD\_TYPE for the Visual Studio generator](https://discourse.cmake.org/t/cmake-build-disregards-cmake-build-type-for-the-visual-studio-generator/4051)

<div class="topic-metadata">

**Author:** [@bjornblissing](https://discourse.cmake.org/u/bjornblissing)\
**Replies:** 2\
**Last updated:** [September 8, 2021, 11:26am UTC](https://discourse.cmake.org/t/cmake-build-disregards-cmake-build-type-for-the-visual-studio-generator/4051 "2021-09-08T11:26:43Z")

</div>

I tried building via the command line interface: cmake ../path\_to\_source -G "Visual Studio 16 2019" -DCMAKE\_BUILD\_TYPE=Release cmake --build . But when I ran the built target I got some strange dll errors. II discover…

---

## [Transitive dependencies for include directories break](https://discourse.cmake.org/t/transitive-dependencies-for-include-directories-break/4035)

<div class="topic-metadata">

**Author:** [@Ronald](https://discourse.cmake.org/u/Ronald)\
**Replies:** 5\
**Last updated:** [September 6, 2021, 2:21pm UTC](https://discourse.cmake.org/t/transitive-dependencies-for-include-directories-break/4035 "2021-09-06T14:21:14Z")

</div>

dump\_target\_includes is a macro for testing macro(dump\_target\_includes TARGET\_NAME) set(OUT\_TMP "====dump\_target\_includes begin (${TARGET\_NAME})====") set(INCLUDE\_DIRS $\<TARGET\_PROPERTY:${TARGET\_NAME},INCLUDE\_D…

---

## [How to make pkg-config libs not using RPATH after pkg\_check\_modules](https://discourse.cmake.org/t/how-to-make-pkg-config-libs-not-using-rpath-after-pkg-check-modules/4029)

<div class="topic-metadata">

**Author:** [@leaveye](https://discourse.cmake.org/u/leaveye)\
**Replies:** 1\
**Last updated:** [September 6, 2021, 6:01am UTC](https://discourse.cmake.org/t/how-to-make-pkg-config-libs-not-using-rpath-after-pkg-check-modules/4029 "2021-09-06T06:01:05Z")

</div>

I am working on a kind-of-outdated aarch64 system. And want to add support of new gRPC version for my program. The system already have a old gRPC which i dont want to break off. so i build my project dependencies like th…

---

## [INTERFACE\_INCLUDE\_DIRECTORIES not transitive for target\_link\_libraries](https://discourse.cmake.org/t/interface-include-directories-not-transitive-for-target-link-libraries/4028)

<div class="topic-metadata">

**Author:** [@Ronald](https://discourse.cmake.org/u/Ronald)\
**Replies:** 6\
**Last updated:** [September 3, 2021, 3:06pm UTC](https://discourse.cmake.org/t/interface-include-directories-not-transitive-for-target-link-libraries/4028 "2021-09-03T15:06:08Z")

</div>

Env OS: Linux cmake: 3.21.1 Test Code cmake\_minimum\_required(VERSION 3.20) project(test\_cmake\_transitive\_deps LANGUAGES CXX) set(CMAKE\_CXX\_STANDARD 17) set(CMAKE\_CXX\_STANDARD\_REQUIRED ON) macro(dump\_target\_includes …

---

## [Shared lib on windows with debug suffix tries to load dll without suffix](https://discourse.cmake.org/t/shared-lib-on-windows-with-debug-suffix-tries-to-load-dll-without-suffix/4032)

<div class="topic-metadata">

**Author:** [@jshanab](https://discourse.cmake.org/u/jshanab)\
**Replies:** 0\
**Last updated:** [September 3, 2021, 3:05pm UTC](https://discourse.cmake.org/t/shared-lib-on-windows-with-debug-suffix-tries-to-load-dll-without-suffix/4032 "2021-09-03T15:05:52Z")

</div>

This used to work but after a rather big jump in CMake version I am seeing a strange behaviour on a lib that I build with cmake. live555. It has a def file and now cmake has modified my def file and added/update the ;Lib…

---

## [Customize CPack NSIS](https://discourse.cmake.org/t/customize-cpack-nsis/3902)

<div class="topic-metadata">

**Author:** [@vallant](https://discourse.cmake.org/u/vallant)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 12:39pm UTC](https://discourse.cmake.org/t/customize-cpack-nsis/3902 "2021-09-02T12:39:04Z")

</div>

Hello, i’m trying to customize a NSIS installer generated via CPack. Specifically, we do not need shortcuts and a custom install location, since the location of the to-be-installed files is fixed, and choosing a custom…

---

## [Exporting and packaging prebuilt libraries in cmake](https://discourse.cmake.org/t/exporting-and-packaging-prebuilt-libraries-in-cmake/3988)

<div class="topic-metadata">

**Author:** [@Le\_MonSiC](https://discourse.cmake.org/u/Le_MonSiC)\
**Replies:** 3\
**Last updated:** [September 1, 2021, 6:17am UTC](https://discourse.cmake.org/t/exporting-and-packaging-prebuilt-libraries-in-cmake/3988 "2021-09-01T06:17:58Z")

</div>

instead of asking a question directly, I’ll expose my use case and the way I tried (but failed) to solve it. Say I have: 3 shared libraries A, B and C A require B and C A comes with a set of headers That’s it, no ext…

---

## [How to handle failure of multiple \`execute\_process\` calls](https://discourse.cmake.org/t/how-to-handle-failure-of-multiple-execute-process-calls/4004)

<div class="topic-metadata">

**Author:** [@morrisonlevi](https://discourse.cmake.org/u/morrisonlevi)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 9:52pm UTC](https://discourse.cmake.org/t/how-to-handle-failure-of-multiple-execute-process-calls/4004 "2021-08-31T21:52:14Z")

</div>

I’m writing a find module for php-config. I need to run a bunch of commands to gather what I need e.g. php-config --includes php-config --ldflags php-config --libs php-config --version So, I have an execute\_process for…

---

## [UNIX not defined on Windows HOST](https://discourse.cmake.org/t/unix-not-defined-on-windows-host/4002)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 6:34pm UTC](https://discourse.cmake.org/t/unix-not-defined-on-windows-host/4002 "2021-08-31T18:34:01Z")

</div>

I wrote some code that used the variable UNIX I assumed UNIX would be set to false on non-UNIX platforms. Instead it was undefined (on Windows at least). Which caused an issue with a CMake function I wrote. Why is it p…

---

## [get/print the value of variables](https://discourse.cmake.org/t/get-print-the-value-of-variables/4001)

<div class="topic-metadata">

**Author:** [@Master\_Andreas](https://discourse.cmake.org/u/Master_Andreas)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 2:48pm UTC](https://discourse.cmake.org/t/get-print-the-value-of-variables/4001 "2021-08-31T14:48:12Z")

</div>

I am looking for a way to get the value of CMAKE variables specifically i want to see the value of CMAKE\_CXX\_FLAGS\_DEBUG and CAME\_CXX\_FLAGS\_RELWITHDEBINFO

---

## [Implement custom Msbuild target](https://discourse.cmake.org/t/implement-custom-msbuild-target/4000)

<div class="topic-metadata">

**Author:** [@yurybura](https://discourse.cmake.org/u/yurybura)\
**Replies:** 0\
**Last updated:** [August 31, 2021, 9:56am UTC](https://discourse.cmake.org/t/implement-custom-msbuild-target/4000 "2021-08-31T09:56:00Z")

</div>

I’m trying to implement custom Msbuild target to use with VS generator. My use case will be: cmake -G"Visual Studio 16 2019" -A x64 -T"custom\_cpp\_toolset,VCTargetsPath=path\_to\_my\_targets" .. Documentation says: Specify…

---

## [Where is $\<COMMAND\_CONFIG:...\> allowed?](https://discourse.cmake.org/t/where-is-command-config-allowed/3998)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 1\
**Last updated:** [August 30, 2021, 12:39pm UTC](https://discourse.cmake.org/t/where-is-command-config-allowed/3998 "2021-08-30T12:39:53Z")

</div>

The documentation for the $\<COMMAND\_CONFIG:...\> generator expression (introduced in CMake 3.20) is a bit ambiguous regarding where it is allowed to be used. It states the following: Only valid in add\_custom\_command() a…

---

## [CPack adds absolute path of build machine install dir as a prefix to relocatable rpm package](https://discourse.cmake.org/t/cpack-adds-absolute-path-of-build-machine-install-dir-as-a-prefix-to-relocatable-rpm-package/3992)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 1\
**Last updated:** [August 27, 2021, 8:04pm UTC](https://discourse.cmake.org/t/cpack-adds-absolute-path-of-build-machine-install-dir-as-a-prefix-to-relocatable-rpm-package/3992 "2021-08-27T20:04:17Z")

</div>

I am creating rpm package in cmake as relocatable package however CPack writes absolute path of the cmake build machine install directory ${CMAKE\_CURRENT\_LIST\_DIR}/install as a prefix to all %files. How do I drop /strip…

---

## [How to set CMAKE\_MSVC\_RUNTIME\_LIBRARY for an external project?](https://discourse.cmake.org/t/how-to-set-cmake-msvc-runtime-library-for-an-external-project/2805)

<div class="topic-metadata">

**Author:** [@TomzBench](https://discourse.cmake.org/u/TomzBench)\
**Replies:** 7\
**Last updated:** [March 1, 2021, 3:16pm UTC](https://discourse.cmake.org/t/how-to-set-cmake-msvc-runtime-library-for-an-external-project/2805 "2021-03-01T15:16:37Z")

</div>

When building my project for Windows - I notice the external project does not seem to honor my root project MSVC\_RUNTIME\_LIBRARY flag. I tested this by modifying my external project CMAKELISTS and the results were more a…

---

## [find\_library but can't link framework](https://discourse.cmake.org/t/find-library-but-cant-link-framework/3954)

<div class="topic-metadata">

**Author:** [@ChangyinN](https://discourse.cmake.org/u/ChangyinN)\
**Replies:** 2\
**Last updated:** [August 25, 2021, 12:32pm UTC](https://discourse.cmake.org/t/find-library-but-cant-link-framework/3954 "2021-08-25T12:32:32Z")

</div>

when i use find\_library(A NAMES a PATHS /path/to/a.framework) to find a framework A and message(status ${A}) show its full path, then I do target\_link\_libraries(program ${A}) Xcode shows an framework not found a, do some…

---

## [Looking for suggestions on how I might improve upon this cmake build](https://discourse.cmake.org/t/looking-for-suggestions-on-how-i-might-improve-upon-this-cmake-build/3969)

<div class="topic-metadata">

**Author:** [@whitwhoa](https://discourse.cmake.org/u/whitwhoa)\
**Replies:** 0\
**Last updated:** [August 23, 2021, 5:59pm UTC](https://discourse.cmake.org/t/looking-for-suggestions-on-how-i-might-improve-upon-this-cmake-build/3969 "2021-08-23T17:59:18Z")

</div>

I am in the process of converting a visual studio project into cmake, and have gotten a working build. However, since I knew nothing of cmake before starting, and am still learning things, I was wondering if any of you k…

---

## [\[BEGINNER\] How do I generate CMAKE\_AR configuration?](https://discourse.cmake.org/t/beginner-how-do-i-generate-cmake-ar-configuration/3964)

<div class="topic-metadata">

**Author:** [@JupiterJack](https://discourse.cmake.org/u/JupiterJack)\
**Replies:** 2\
**Last updated:** [August 21, 2021, 1:14am UTC](https://discourse.cmake.org/t/beginner-how-do-i-generate-cmake-ar-configuration/3964 "2021-08-21T01:14:01Z")

</div>

I am following a tutorial on youtube by freecodecamp.org about OpenGL, creating 3D and 2D graphics in C++. At around 3:13 in the video, I generated everything seen in the list besides CMAKE\_AR. I’ve tried researching it …

---

## [problem with find\_package()](https://discourse.cmake.org/t/problem-with-find-package/2266)

<div class="topic-metadata">

**Author:** [@kondachaitanya1993](https://discourse.cmake.org/u/kondachaitanya1993)\
**Replies:** 11\
**Last updated:** [August 19, 2021, 4:54pm UTC](https://discourse.cmake.org/t/problem-with-find-package/2266 "2021-08-19T16:54:55Z")

</div>

i am completely new to use cmake. i am facing an issue with debugging the following error. Observed: CMake Error at CMakeLists.txt:30 (find\_package): find\_package called with incorrect number of arguments was not f…

---

## [Porting linker flags from Eclipse](https://discourse.cmake.org/t/porting-linker-flags-from-eclipse/3951)

<div class="topic-metadata">

**Author:** [@sarm](https://discourse.cmake.org/u/sarm)\
**Replies:** 0\
**Last updated:** [August 18, 2021, 7:31am UTC](https://discourse.cmake.org/t/porting-linker-flags-from-eclipse/3951 "2021-08-18T07:31:09Z")

</div>

I have an eclipse project and wanna port to cmake. In eclipse, my project (Xenomai based) has linker flags (set in Linker/Miscellaneous) like this: -Wl,–no-as-needed -Wl,@"…/…/…/libraries/xenomai/lib/modechk.wrappers" “…

---

## [How to install latest cmake-gui and ccmake in virtual environment](https://discourse.cmake.org/t/how-to-install-latest-cmake-gui-and-ccmake-in-virtual-environment/3941)

<div class="topic-metadata">

**Author:** [@murtiko](https://discourse.cmake.org/u/murtiko)\
**Replies:** 2\
**Last updated:** [August 17, 2021, 12:47pm UTC](https://discourse.cmake.org/t/how-to-install-latest-cmake-gui-and-ccmake-in-virtual-environment/3941 "2021-08-17T12:47:24Z")

</div>

I am using the latest cmake binary provided by python wheels. pip install cmake This approach does not provide cmake-gui and ccmake. And unfortunately building it from source is not an option. Is there any other way to…

---

## [Different behaviour of \`make clean\` and \`ninja clean\` on \`GENERATED\` source files](https://discourse.cmake.org/t/different-behaviour-of-make-clean-and-ninja-clean-on-generated-source-files/3920)

<div class="topic-metadata">

**Author:** [@oiffrig](https://discourse.cmake.org/u/oiffrig)\
**Replies:** 1\
**Last updated:** [August 16, 2021, 3:39pm UTC](https://discourse.cmake.org/t/different-behaviour-of-make-clean-and-ninja-clean-on-generated-source-files/3920 "2021-08-16T15:39:41Z")

</div>

I am using configure\_file to generate a source file containing version information for my project: CMakeLists.txtcmake\_minimum\_required(VERSION 3.12 FATAL\_ERROR) project(dummy VERSION 0.1 LANGUAGES C) configure\_file(ver…

---

## [FindBLAS: Could not find BLAS on Windows](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346)

<div class="topic-metadata">

**Author:** [@balamurata123](https://discourse.cmake.org/u/balamurata123)\
**Replies:** 5\
**Last updated:** [August 16, 2021, 7:38am UTC](https://discourse.cmake.org/t/findblas-could-not-find-blas-on-windows/3346 "2021-08-16T07:38:11Z")

</div>

Hello, I have been trying to use cmake for the build of some libraries from GitHub - Argonne-National-Laboratory/neml: Modular consitutive modeling library for structural materials. For this package, BLAS and LAPACK are…

---

## [cmake support shortname on windows](https://discourse.cmake.org/t/cmake-support-shortname-on-windows/3304)

<div class="topic-metadata">

**Author:** [@FROMAGMA](https://discourse.cmake.org/u/FROMAGMA)\
**Replies:** 6\
**Last updated:** [August 15, 2021, 11:39am UTC](https://discourse.cmake.org/t/cmake-support-shortname-on-windows/3304 "2021-08-15T11:39:57Z")

</div>

Hi, We use cmake 3.20.0 with ninja 1.9 on windows and linux. Question: Is there a cmake function to convert path names like C:\\Program Files (x86)\\compilerpath to short names (dos naming) C:\\PROGRA~2\\compilerpath …

---

## [target\_link\_libraries adds files to vcproj](https://discourse.cmake.org/t/target-link-libraries-adds-files-to-vcproj/3915)

<div class="topic-metadata">

**Author:** [@jshanab](https://discourse.cmake.org/u/jshanab)\
**Replies:** 12\
**Last updated:** [August 13, 2021, 11:01pm UTC](https://discourse.cmake.org/t/target-link-libraries-adds-files-to-vcproj/3915 "2021-08-13T23:01:03Z")

</div>

When I used target\_link\_libraries in cmake 3.21.0-rc2 on a test application in a solution that has a static lib, all public headers are being added to the vcproject. I expect the directories, flags, etc, but I do want f…

---

## [Linking against non versioned or major library](https://discourse.cmake.org/t/linking-against-non-versioned-or-major-library/3931)

<div class="topic-metadata">

**Author:** [@emiliogq](https://discourse.cmake.org/u/emiliogq)\
**Replies:** 11\
**Last updated:** [August 13, 2021, 3:21pm UTC](https://discourse.cmake.org/t/linking-against-non-versioned-or-major-library/3931 "2021-08-13T15:21:30Z")

</div>

Hello, I am trying to compile a cpp code which has some external library calls (libnova) among others. That lib is found using the find\_library call: find\_library(NOVA\_LIBRARIES NAMES nova PATHS ${NOVA\_ROOT} ENV …

---

## [Framework generated by cmake for catalyst don't work](https://discourse.cmake.org/t/framework-generated-by-cmake-for-catalyst-dont-work/3926)

<div class="topic-metadata">

**Author:** [@paulocoutinho](https://discourse.cmake.org/u/paulocoutinho)\
**Replies:** 1\
**Last updated:** [August 13, 2021, 2:11am UTC](https://discourse.cmake.org/t/framework-generated-by-cmake-for-catalyst-dont-work/3926 "2021-08-13T02:11:26Z")

</div>

Hi guys, Im trying use a framework generated by cmake for mac catalyst, but it is not working when try use on xcode: mkdir -p /Users/paulo/Library/Developer/Xcode/DerivedData/Sample-abxdtyhuvlqxbfhcnvbmzhxhtwjl/Build/P…

---

## [Using cmake to include libheif as an external dependency](https://discourse.cmake.org/t/using-cmake-to-include-libheif-as-an-external-dependency/2623)

<div class="topic-metadata">

**Author:** [@charstiles](https://discourse.cmake.org/u/charstiles)\
**Replies:** 22\
**Last updated:** [August 13, 2021, 12:35am UTC](https://discourse.cmake.org/t/using-cmake-to-include-libheif-as-an-external-dependency/2623 "2021-08-13T00:35:15Z")

</div>

I’m trying to include libheif into my project using cmake. Libheif is more complicated than what I’ve worked with before because it requires you to externally build and include libde265. Attempt #1: I have used vcpkg t…

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

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