# Usage

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

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

**Page:** 45

---

## [NSIS - allowing user to select per-component install locations?](https://discourse.cmake.org/t/nsis-allowing-user-to-select-per-component-install-locations/8135)

<div class="topic-metadata">

**Author:** [@benthevining](https://discourse.cmake.org/u/benthevining)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 8:45pm UTC](https://discourse.cmake.org/t/nsis-allowing-user-to-select-per-component-install-locations/8135 "2023-05-16T20:45:50Z")

</div>

I’m working on creating CPack installers for an audio plugin. We distribute several different formats - on Windows, AAX, VST3, and a standalone GUI app. These all need to be installed to different directories - by defaul…

---

## [TI CGT: How to stop cmake converting libc.a to c?](https://discourse.cmake.org/t/ti-cgt-how-to-stop-cmake-converting-libc-a-to-c/8121)

<div class="topic-metadata">

**Author:** [@Freed-Wu](https://discourse.cmake.org/u/Freed-Wu)\
**Replies:** 5\
**Last updated:** [May 15, 2023, 3:13pm UTC](https://discourse.cmake.org/t/ti-cgt-how-to-stop-cmake-converting-libc-a-to-c/8121 "2023-05-15T15:13:13Z")

</div>

When I link\_libraries(libc.a) cmake --build build will run /opt/ccstudio/ccs/tools/compiler/c6000\_7.4.24/bin/cl6x --run\_linker --output\_file=x264 --map\_file=x264.map -heap=0x1000000 -stack=0x1000000 CMakeFiles/XXX/X.c…

---

## [VS: Select Windows SDK version](https://discourse.cmake.org/t/vs-select-windows-sdk-version/5603)

<div class="topic-metadata">

**Author:** [@flaviu2](https://discourse.cmake.org/u/flaviu2)\
**Replies:** 8\
**Last updated:** [May 15, 2023, 9:50am UTC](https://discourse.cmake.org/t/vs-select-windows-sdk-version/5603 "2023-05-15T09:50:13Z")

</div>

I have Win10 64 bit, and VS2017. I have a CMakeLists.txt and a Makefile which looks like this: build/Makefile: CMakeLists.txt mkdir -p build; \\ cd build; \\ cmake ../ -DCMAKE\_TOOLCHAIN\_FILE=~/github/vcpkg/scripts/buil…

---

## [Selecting Windows SDK 8.1](https://discourse.cmake.org/t/selecting-windows-sdk-8-1/7822)

<div class="topic-metadata">

**Author:** [@pedahl](https://discourse.cmake.org/u/pedahl)\
**Replies:** 6\
**Last updated:** [May 15, 2023, 9:48am UTC](https://discourse.cmake.org/t/selecting-windows-sdk-8-1/7822 "2023-05-15T09:48:03Z")

</div>

Hello, I want to build my project against the Windows SDK 8.1. I have no idea how to configure cmake to use it? Can someone help me?

---

## [FetchContent error](https://discourse.cmake.org/t/fetchcontent-error/8109)

<div class="topic-metadata">

**Author:** [@Nitr0-G](https://discourse.cmake.org/u/Nitr0-G)\
**Replies:** 2\
**Last updated:** [May 12, 2023, 10:09pm UTC](https://discourse.cmake.org/t/fetchcontent-error/8109 "2023-05-12T22:09:11Z")

</div>

Hello everyone. When I try to run my cmake, I get an error message (it started after I decided to reinstall my system, the same cmake used to work without any problems (I tried Googling, but I didn’t find anything sane e…

---

## [install TARGETS given target "Boost::boost" which does not exist](https://discourse.cmake.org/t/install-targets-given-target-boost-boost-which-does-not-exist/8104)

<div class="topic-metadata">

**Author:** [@Fabio\_Mussi](https://discourse.cmake.org/u/Fabio_Mussi)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 5:25pm UTC](https://discourse.cmake.org/t/install-targets-given-target-boost-boost-which-does-not-exist/8104 "2023-05-11T17:25:50Z")

</div>

Hi, when I try to build the project with cmake this error appears: CMake Error at cmake/Modules/AddBoost.cmake:74 (install): install TARGETS given target “Boost::boost” which does not exist. Call Stack (most recent ca…

---

## [Grouping hierarchy in debian packages](https://discourse.cmake.org/t/grouping-hierarchy-in-debian-packages/8084)

<div class="topic-metadata">

**Author:** [@kingtim](https://discourse.cmake.org/u/kingtim)\
**Replies:** 3\
**Last updated:** [May 10, 2023, 11:03am UTC](https://discourse.cmake.org/t/grouping-hierarchy-in-debian-packages/8084 "2023-05-10T11:03:26Z")

</div>

I’d like to build 2 debian packages: A Runtime package which has some files and a Develop package. Which has ALL the files from the Runtime package as well as some additional files. Is this possible? With CPack i’d exp…

---

## [How to handle install+target\_link\_libraries+FetchContent](https://discourse.cmake.org/t/how-to-handle-install-target-link-libraries-fetchcontent/8087)

<div class="topic-metadata">

**Author:** [@Lecris](https://discourse.cmake.org/u/Lecris)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 4:32am UTC](https://discourse.cmake.org/t/how-to-handle-install-target-link-libraries-fetchcontent/8087 "2023-05-10T04:32:19Z")

</div>

I am having some trouble understanding how this scenario should be handled. I have a header only library DepPkg that is downloaded automatically via FetchContent if it is not found on the system. Then my target MyPkg ha…

---

## [Setting ulimit in a test?](https://discourse.cmake.org/t/setting-ulimit-in-a-test/8077)

<div class="topic-metadata">

**Author:** [@shabiel](https://discourse.cmake.org/u/shabiel)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 6:49pm UTC](https://discourse.cmake.org/t/setting-ulimit-in-a-test/8077 "2023-05-08T18:49:22Z")

</div>

Hello everybody, I need to artificially limit memory for a test to simulate an out of memory error (perhaps by setting ulimit). Is there a CTest way of doing that? –Sam

---

## [Libraries and Native Visualization Files (.natvis)](https://discourse.cmake.org/t/libraries-and-native-visualization-files-natvis/8069)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 6:35pm UTC](https://discourse.cmake.org/t/libraries-and-native-visualization-files-natvis/8069 "2023-05-08T18:35:19Z")

</div>

I have a header only library that provides a natvis file to users. This is useful to users of my library on MSVC in particular. Since it provides a friendlier debugging interface for custom containers. If I was shipping…

---

## [CMake manage multiple different projects](https://discourse.cmake.org/t/cmake-manage-multiple-different-projects/8065)

<div class="topic-metadata">

**Author:** [@charlieye007](https://discourse.cmake.org/u/charlieye007)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 6:30pm UTC](https://discourse.cmake.org/t/cmake-manage-multiple-different-projects/8065 "2023-05-08T18:30:31Z")

</div>

Hello, There are multiple independent projects, and i use CMake to build each project. (each projects has it’s config/build/install) Now I want to integrate all projects by using cmake and git submodules, there is a ro…

---

## [not able to generate compile\_commands.json on cmake 3.22.1](https://discourse.cmake.org/t/not-able-to-generate-compile-commands-json-on-cmake-3-22-1/8063)

<div class="topic-metadata">

**Author:** [@cmade](https://discourse.cmake.org/u/cmade)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 4:44am UTC](https://discourse.cmake.org/t/not-able-to-generate-compile-commands-json-on-cmake-3-22-1/8063 "2023-05-08T04:44:31Z")

</div>

(I’m fairly new to cmake) I’ve tried turning on this setting a few different ways, and from reading some Stackoverflow posts it seems like this was mostly an issue in older cmake versions. I’ve tried: cmake -DCMAKE\_EX…

---

## [Disabling present for Linux-arm64 on Linux-arm64 target machine.](https://discourse.cmake.org/t/disabling-present-for-linux-arm64-on-linux-arm64-target-machine/8058)

<div class="topic-metadata">

**Author:** [@siddmohsin](https://discourse.cmake.org/u/siddmohsin)\
**Replies:** 1\
**Last updated:** [May 5, 2023, 10:17pm UTC](https://discourse.cmake.org/t/disabling-present-for-linux-arm64-on-linux-arm64-target-machine/8058 "2023-05-05T22:17:08Z")

</div>

Hello All, I am trying to disable Linux-arm64 preset (defined in our CMakePresets.json) on linux x64 machine. To do that we tried below { "name": "Linux-arm64", "inherits": \[ …

---

## [How to use Intel MPI library with cmake on Windows (VS2017)?](https://discourse.cmake.org/t/how-to-use-intel-mpi-library-with-cmake-on-windows-vs2017/5270)

<div class="topic-metadata">

**Author:** [@AllenZhao](https://discourse.cmake.org/u/AllenZhao)\
**Replies:** 3\
**Last updated:** [May 5, 2023, 7:09pm UTC](https://discourse.cmake.org/t/how-to-use-intel-mpi-library-with-cmake-on-windows-vs2017/5270 "2023-05-05T19:09:49Z")

</div>

I have a mixed language MPI package that uses cmake on linux. While on Windows, I am using Visual Studio 2017. The C/C++ compiler will be the Microsoft cl, and Fortran compiler will be the Intel ifort 2017 (hosted in VS …

---

## [How to use all cross configs for custom targets ?](https://discourse.cmake.org/t/how-to-use-all-cross-configs-for-custom-targets/7908)

<div class="topic-metadata">

**Author:** [@abdelmaged](https://discourse.cmake.org/u/abdelmaged)\
**Replies:** 4\
**Last updated:** [May 5, 2023, 12:27pm UTC](https://discourse.cmake.org/t/how-to-use-all-cross-configs-for-custom-targets/7908 "2023-05-05T12:27:39Z")

</div>

I’m trying to use Ninja Multi-Config, and setting CMAKE\_CROSS\_CONFIGS to all, so that I can build all configuration at once with command line “cmake --build build -t world:all” Where world is a custom targets, and just …

---

## [Linking JOB\_POOL](https://discourse.cmake.org/t/linking-job-pool/8007)

<div class="topic-metadata">

**Author:** [@abdelmaged](https://discourse.cmake.org/u/abdelmaged)\
**Replies:** 3\
**Last updated:** [May 5, 2023, 12:19pm UTC](https://discourse.cmake.org/t/linking-job-pool/8007 "2023-05-05T12:19:53Z")

</div>

I’ve noticed that CMAKE\_JOB\_POOL\_LINK specifies the pool for static libraries archive step, this step is not always considered as linking, if this is intended, is there a way to specify the job pool for linking executabl…

---

## [qt\_generate\_deploy\_qml\_app\_script generates script with empty include()](https://discourse.cmake.org/t/qt-generate-deploy-qml-app-script-generates-script-with-empty-include/8057)

<div class="topic-metadata">

**Author:** [@Rich\_von\_Lehe](https://discourse.cmake.org/u/Rich_von_Lehe)\
**Replies:** 1\
**Last updated:** [May 5, 2023, 2:53am UTC](https://discourse.cmake.org/t/qt-generate-deploy-qml-app-script-generates-script-with-empty-include/8057 "2023-05-05T02:53:41Z")

</div>

Here’s a CMakeLists.txt that is attempting to use the CMake macro qt\_generate\_deploy\_qml\_app\_script. I’m following the blog here \[1\]. Everything seems fine until the install stage, where it seems the deploy script is m…

---

## [FIND\_PACKAGE(Doxygen 1.9.0): found unsuitale version error](https://discourse.cmake.org/t/find-package-doxygen-1-9-0-found-unsuitale-version-error/8056)

<div class="topic-metadata">

**Author:** [@Simon1](https://discourse.cmake.org/u/Simon1)\
**Replies:** 2\
**Last updated:** [May 4, 2023, 6:36pm UTC](https://discourse.cmake.org/t/find-package-doxygen-1-9-0-found-unsuitale-version-error/8056 "2023-05-04T18:36:58Z")

</div>

Dear all, I use cmake 3.23.1. My top-level CmakeLists.txt contains the command FIND\_PACKAGE(Doxygen 1.9.0) which triggers the following error message Obviously, cmake finds the installed version 1.9.0 of Doxygen …

---

## [How to enable trace mode when CMake is re-run?](https://discourse.cmake.org/t/how-to-enable-trace-mode-when-cmake-is-re-run/8033)

<div class="topic-metadata">

**Author:** [@Panu](https://discourse.cmake.org/u/Panu)\
**Replies:** 4\
**Last updated:** [May 3, 2023, 6:16am UTC](https://discourse.cmake.org/t/how-to-enable-trace-mode-when-cmake-is-re-run/8033 "2023-05-03T06:16:51Z")

</div>

Trace mode can be enabled with --trace option when cmake is called to generate a project buildsystem. When a project is built with ‘cmake --build’ the buildsystem is regenerated if needed but there seems to be no way to …

---

## [CMAKE ZLIB path not found](https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037)

<div class="topic-metadata">

**Author:** [@Gudimetla\_Kowshik](https://discourse.cmake.org/u/Gudimetla_Kowshik)\
**Replies:** 3\
**Last updated:** [May 2, 2023, 8:17pm UTC](https://discourse.cmake.org/t/cmake-zlib-path-not-found/8037 "2023-05-02T20:17:39Z")

</div>

I am receiving an error while generating files for opencv as below. CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv\_core" which requires target "zlib" that is not in any export set. CMake Error:…

---

## [Imported shared library - can't seem to get rid fixed path to it in exe](https://discourse.cmake.org/t/imported-shared-library-cant-seem-to-get-rid-fixed-path-to-it-in-exe/8009)

<div class="topic-metadata">

**Author:** [@Rich\_von\_Lehe](https://discourse.cmake.org/u/Rich_von_Lehe)\
**Replies:** 11\
**Last updated:** [May 2, 2023, 1:32pm UTC](https://discourse.cmake.org/t/imported-shared-library-cant-seem-to-get-rid-fixed-path-to-it-in-exe/8009 "2023-05-02T13:32:47Z")

</div>

I have a shared library that is provided to me for for target aarch64. I wrote some quick CMake to create an import target for it as follows: add\_library(BeClearWrapper SHARED IMPORTED GLOBAL) set\_target\_properties(BeC…

---

## [Reuse c++20 modules in multiple targets](https://discourse.cmake.org/t/reuse-c-20-modules-in-multiple-targets/8015)

<div class="topic-metadata">

**Author:** [@koponomarenko7](https://discourse.cmake.org/u/koponomarenko7)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:27pm UTC](https://discourse.cmake.org/t/reuse-c-20-modules-in-multiple-targets/8015 "2023-05-01T15:27:47Z")

</div>

I am trying to reuse C++20 modules in test target, but it fails with this error: $ ninja -C cmake-build-release ninja: Entering directory \`cmake-build-release' \[19/22\] Building CXX object bravo/CMakeFiles/bravo\_test\_mod…

---

## [\#cmakedefine and Fortran](https://discourse.cmake.org/t/cmakedefine-and-fortran/8013)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:26pm UTC](https://discourse.cmake.org/t/cmakedefine-and-fortran/8013 "2023-05-01T15:26:13Z")

</div>

All, I’m pretty sure the answer to this is “Nope!” but, I thought I’d ask. Namely, I have a case where: #cmakedefine PFUNIT\_EXTRA\_USE @PFUNIT\_EXTRA\_USE@ is used and then configure\_file is run on this file. The extra t…

---

## [scan tailor advanced build](https://discourse.cmake.org/t/scan-tailor-advanced-build/8006)

<div class="topic-metadata">

**Author:** [@konos93](https://discourse.cmake.org/u/konos93)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:16pm UTC](https://discourse.cmake.org/t/scan-tailor-advanced-build/8006 "2023-05-01T15:16:46Z")

</div>

hey i am not programmer i am trying to make windows and linux backage from this project GitHub - 4lex4/scantailor-libs-build: Building scantailor and its dependencies using this docker file docker\_scantailor/Dockerfile…

---

## [CMake ignores WIN32\_EXECUTABLE TRUE for C# target](https://discourse.cmake.org/t/cmake-ignores-win32-executable-true-for-c-target/8001)

<div class="topic-metadata">

**Author:** [@yzakharchuk](https://discourse.cmake.org/u/yzakharchuk)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:14pm UTC](https://discourse.cmake.org/t/cmake-ignores-win32-executable-true-for-c-target/8001 "2023-05-01T15:14:43Z")

</div>

I’m trying to create .NET 6.0 WinForms application with CMake. I use the WIN32\_EXECUTABLE property to hide a console during execution, but it doesn’t work and I have to change Output Type from Exe to WinExe manually fro…

---

## [Private Linking Public Compile Usage](https://discourse.cmake.org/t/private-linking-public-compile-usage/7998)

<div class="topic-metadata">

**Author:** [@abdelmaged](https://discourse.cmake.org/u/abdelmaged)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:13pm UTC](https://discourse.cmake.org/t/private-linking-public-compile-usage/7998 "2023-05-01T15:13:10Z")

</div>

Is there a way when linking with target to link privately and make the compile usage requirements public ? Example add\_library(A STATIC a.c) target\_include\_directories(A PUBLIC "dir1") target\_compile\_definitions(A PUBL…

---

## [Are \`IF\` generator expressions short circuit?](https://discourse.cmake.org/t/are-if-generator-expressions-short-circuit/8000)

<div class="topic-metadata">

**Author:** [@gabyx](https://discourse.cmake.org/u/gabyx)\
**Replies:** 1\
**Last updated:** [April 29, 2023, 6:20am UTC](https://discourse.cmake.org/t/are-if-generator-expressions-short-circuit/8000 "2023-04-29T06:20:05Z")

</div>

Are generator expression short circuit: $\<$\<IN\_LIST, $\<TARGET\_PROPERTY:${targetName},TYPE\>, EXECUTABLE;SHARED\_LIBRARY;MODULE\_LIBRARY\>: $\<TARGET\_RUNTIME\_DLLS:${targetName}\>\> So if targetName is an STATIC\_LIBRARY …

---

## [Unable to open CMake on Windows 10](https://discourse.cmake.org/t/unable-to-open-cmake-on-windows-10/816)

<div class="topic-metadata">

**Author:** [@jannepietila](https://discourse.cmake.org/u/jannepietila)\
**Replies:** 6\
**Last updated:** [April 28, 2023, 1:42pm UTC](https://discourse.cmake.org/t/unable-to-open-cmake-on-windows-10/816 "2023-04-28T13:42:51Z")

</div>

Hello, I’m trying to use CMake GUI (cmake-3.16.5-win64-x64) for building a certain project. I’m using Windows 10 Pro version 1903. When I’m trying to open CMake (executing cmake-gui), the program appears in the windows…

---

## [doxygen not found, \`DOXYGEN\_FOUND\` is \`false\`](https://discourse.cmake.org/t/doxygen-not-found-doxygen-found-is-false/8005)

<div class="topic-metadata">

**Author:** [@jankap](https://discourse.cmake.org/u/jankap)\
**Replies:** 1\
**Last updated:** [April 27, 2023, 4:35pm UTC](https://discourse.cmake.org/t/doxygen-not-found-doxygen-found-is-false/8005 "2023-04-27T16:35:26Z")

</div>

Not sure what I’m doing wrong here. I try to use DOXYGEN\_FOUND, but that variable seems to be unset though doxygen is available. The CMakeLists.txt contains cmake\_minimum\_required(VERSION 3.18) if (DOXYGEN\_FOUND) …

---

## [Precedence of \<PackageName\>\_ROOT in package search](https://discourse.cmake.org/t/precedence-of-packagename-root-in-package-search/7993)

<div class="topic-metadata">

**Author:** [@xmk253](https://discourse.cmake.org/u/xmk253)\
**Replies:** 1\
**Last updated:** [April 26, 2023, 9:46pm UTC](https://discourse.cmake.org/t/precedence-of-packagename-root-in-package-search/7993 "2023-04-26T21:46:19Z")

</div>

I have a cmake file that searches for OpenSSL using find\_package(OpenSSL REQUIRED), I noticed that paths that appear in CMAKE\_PREFIX\_PATH have precedence over the OPENSSL\_ROOT\_DIR i.e. CMAKE\_PREFIX\_PATH="" CMAKE\_LIBRARY…

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

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