# Usage

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

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

**Page:** 78

---

## [Help Getting Started](https://discourse.cmake.org/t/help-getting-started/3500)

<div class="topic-metadata">

**Author:** [@sy0ney](https://discourse.cmake.org/u/sy0ney)\
**Replies:** 1\
**Last updated:** [June 4, 2021, 7:27pm UTC](https://discourse.cmake.org/t/help-getting-started/3500 "2021-06-04T19:27:31Z")

</div>

Hello, I am new to this platform and I am very confused on how to get started. I am no computer scientist. I have a MacBook Pro for reference. This is what is confusing me- when I open my cmake app, I see a window tha…

---

## [Can CMake automatically detect RH devtoolset-7?](https://discourse.cmake.org/t/can-cmake-automatically-detect-rh-devtoolset-7/3496)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 2\
**Last updated:** [June 4, 2021, 4:48pm UTC](https://discourse.cmake.org/t/can-cmake-automatically-detect-rh-devtoolset-7/3496 "2021-06-04T16:48:04Z")

</div>

I am building on Centos 7, which natively has gcc 4.8.5, using CMake 3.16.6 and Ninja. My code requires gcc 7 so I specify RH devtoolset-7: -DCMAKE\_CXX\_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++ My code checks the…

---

## [how to use default webbrowser with cmake-gui](https://discourse.cmake.org/t/how-to-use-default-webbrowser-with-cmake-gui/3495)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 1\
**Last updated:** [June 4, 2021, 12:48pm UTC](https://discourse.cmake.org/t/how-to-use-default-webbrowser-with-cmake-gui/3495 "2021-06-04T12:48:33Z")

</div>

i have 2 web browser installed on my machine - chrome and firefox. cmake-gui uses chrome to open the manual. I would expect it to use the default application, instead. I checked that firefox is set as default applicati…

---

## [Importing OpenCV, versions conflicts](https://discourse.cmake.org/t/importing-opencv-versions-conflicts/3343)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 16\
**Last updated:** [June 4, 2021, 12:45pm UTC](https://discourse.cmake.org/t/importing-opencv-versions-conflicts/3343 "2021-06-04T12:45:20Z")

</div>

Hi, I fail to properly add a dependency to opencv3 in my devs. The setup is the following: I’ve got two version of opencv: 2.4 which is the default one for ubuntu 16.04 3.3 which is provided inside ROS kinetic I’ve…

---

## [automoc](https://discourse.cmake.org/t/automoc/3481)

<div class="topic-metadata">

**Author:** [@Tomasz](https://discourse.cmake.org/u/Tomasz)\
**Replies:** 3\
**Last updated:** [June 4, 2021, 12:43pm UTC](https://discourse.cmake.org/t/automoc/3481 "2021-06-04T12:43:56Z")

</div>

Hi I have a question about qt signals in header file. In documentaion to cmake i read which file will be proccessed by auo-moc: "For all C++ source files \<source\_base\>.\<source\_extension\> in the target’s sources, CMake…

---

## [How to let CMAKE3 to generate Python code for GRPC?](https://discourse.cmake.org/t/how-to-let-cmake3-to-generate-python-code-for-grpc/3491)

<div class="topic-metadata">

**Author:** [@Hao\_Chen](https://discourse.cmake.org/u/Hao_Chen)\
**Replies:** 0\
**Last updated:** [June 4, 2021, 4:40am UTC](https://discourse.cmake.org/t/how-to-let-cmake3-to-generate-python-code-for-grpc/3491 "2021-06-04T04:40:44Z")

</div>

Hi experts, Can you please teach me how to let CMAKE3 to generate Python code for GRPC? There is “protobuf\_generate\_python” in /usr/share/cmake3/Modules/FindProtobuf.cmake. But there is (similar) “grpc\_generate\_python”…

---

## [CMake hung while compiling libical - Continued](https://discourse.cmake.org/t/cmake-hung-while-compiling-libical-continued/3484)

<div class="topic-metadata">

**Author:** [@bremanandjk](https://discourse.cmake.org/u/bremanandjk)\
**Replies:** 0\
**Last updated:** [June 3, 2021, 7:49pm UTC](https://discourse.cmake.org/t/cmake-hung-while-compiling-libical-continued/3484 "2021-06-03T19:49:56Z")

</div>

I am seeing a restriction that a new user can comment only 3 times in a post, I am creating a new thread to discuss… (I am not sure how a new user will get the solution in just 3 replies, I believe this restriction shoul…

---

## [Help with presets: invalid preset](https://discourse.cmake.org/t/help-with-presets-invalid-preset/3483)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 6\
**Last updated:** [June 3, 2021, 7:40pm UTC](https://discourse.cmake.org/t/help-with-presets-invalid-preset/3483 "2021-06-03T19:40:38Z")

</div>

Once again, my CMake lack-of-knowledge is laid bare. I decided today to play around with presets and whipped up this file: { "version": 2, "cmakeMinimumRequired": { "major": 3, "minor": 20, "patch": 3 …

---

## [cmake and build all in one step?](https://discourse.cmake.org/t/cmake-and-build-all-in-one-step/3482)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 2\
**Last updated:** [June 3, 2021, 6:43pm UTC](https://discourse.cmake.org/t/cmake-and-build-all-in-one-step/3482 "2021-06-03T18:43:54Z")

</div>

All, I’m trying to learn how to be “more modern” with CMake and move from doing, say: mkdir build cd build cmake .. make -j6 install to the fancier “built-in” cmake way. So far I’ve gotten this down to: cmake -S . -B…

---

## [Completely hiding output from ExternalProject\_Add](https://discourse.cmake.org/t/completely-hiding-output-from-externalproject-add/3468)

<div class="topic-metadata">

**Author:** [@Barry\_Revzin](https://discourse.cmake.org/u/Barry_Revzin)\
**Replies:** 2\
**Last updated:** [June 2, 2021, 9:45pm UTC](https://discourse.cmake.org/t/completely-hiding-output-from-externalproject-add/3468 "2021-06-02T21:45:09Z")

</div>

As part of my build, I’m building libbacktrace from source, using ExternalProject\_Add: ExternalProject\_Add(libbacktrace-git-repo GIT\_REPOSITORY https://github.com/ianlancetaylor/libbacktrace.git GIT\_TAG 4f57c999…

---

## [CPACK\_PRODUCTBUILD\_RESOURCES\_DIR files not added to pkg](https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460)

<div class="topic-metadata">

**Author:** [@Will](https://discourse.cmake.org/u/Will)\
**Replies:** 3\
**Last updated:** [June 2, 2021, 9:40pm UTC](https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460 "2021-06-02T21:40:33Z")

</div>

I’m trying to add some additional files to the macos installer. So I am using CPACK\_PRODUCTBUILD\_RESOURCES\_DIR that should add the files in the directory to the Resource folder in the pkg. And then add a script that co…

---

## [Documentation of automatic generated targets](https://discourse.cmake.org/t/documentation-of-automatic-generated-targets/3455)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 1\
**Last updated:** [June 1, 2021, 10:54am UTC](https://discourse.cmake.org/t/documentation-of-automatic-generated-targets/3455 "2021-06-01T10:54:15Z")

</div>

CMake automatically generates some targets like all and install. They are documented here: https://cmake.org/cmake/help/latest/guide/user-interaction/index.html#selecting-a-target I recently learned, that it also gene…

---

## [Downloads page is not helping me](https://discourse.cmake.org/t/downloads-page-is-not-helping-me/3444)

<div class="topic-metadata">

**Author:** [@davehitchman](https://discourse.cmake.org/u/davehitchman)\
**Replies:** 3\
**Last updated:** [May 31, 2021, 2:00pm UTC](https://discourse.cmake.org/t/downloads-page-is-not-helping-me/3444 "2021-05-31T14:00:56Z")

</div>

I have centos on my machine (not my machine - supplied by work). I need to upgrade cmake. I downloaded the .sh and then tried the tar. According to the notes I can follow the instructions in README.rst but its not th…

---

## [Downloading pre-built libraries](https://discourse.cmake.org/t/downloading-pre-built-libraries/3247)

<div class="topic-metadata">

**Author:** [@joshua-barnett](https://discourse.cmake.org/u/joshua-barnett)\
**Replies:** 1\
**Last updated:** [May 31, 2021, 3:48am UTC](https://discourse.cmake.org/t/downloading-pre-built-libraries/3247 "2021-05-31T03:48:03Z")

</div>

I’m trying to use FetchContent to download the pre-built development libraries of SDL2. So they can then be subsequently picked up by a FindSDL2.cmake module. However, at the moment I find that find\_package is being ex…

---

## [How to limit find\_package(Python3 \<version\> ...) to select from a directory of multiple python subdirectories](https://discourse.cmake.org/t/how-to-limit-find-package-python3-version-to-select-from-a-directory-of-multiple-python-subdirectories/3441)

<div class="topic-metadata">

**Author:** [@JFlinn](https://discourse.cmake.org/u/JFlinn)\
**Replies:** 1\
**Last updated:** [May 30, 2021, 9:29pm UTC](https://discourse.cmake.org/t/how-to-limit-find-package-python3-version-to-select-from-a-directory-of-multiple-python-subdirectories/3441 "2021-05-30T21:29:19Z")

</div>

I have a Directory: ffs-MacBook-Pro python % pwd /ourbuilds/python ffs-MacBook-Pro python % ls python-2.7 python-3.6.1 python-3.8 python27 python37 python-3.5 python-3.7 python-3.8.0 python-3.8.2 python35 python38 …

---

## [How to configure cmake on Windows to use clang-cl with ninja multi config for intel 32 bits, intel 64 bits and arm64 coming from Visual Studio](https://discourse.cmake.org/t/how-to-configure-cmake-on-windows-to-use-clang-cl-with-ninja-multi-config-for-intel-32-bits-intel-64-bits-and-arm64-coming-from-visual-studio/3430)

<div class="topic-metadata">

**Author:** [@abique](https://discourse.cmake.org/u/abique)\
**Replies:** 10\
**Last updated:** [May 29, 2021, 5:20pm UTC](https://discourse.cmake.org/t/how-to-configure-cmake-on-windows-to-use-clang-cl-with-ninja-multi-config-for-intel-32-bits-intel-64-bits-and-arm64-coming-from-visual-studio/3430 "2021-05-29T17:20:54Z")

</div>

Hi, How to configure cmake on Windows to use clang-cl with ninja multi config for intel 32 bits, intel 64 bits and arm64 bundled with Visual Studio? Thank you very much!

---

## [cmake-DCMAKE\_INSTALL\_PREFIX is not working fine](https://discourse.cmake.org/t/cmake-dcmake-install-prefix-is-not-working-fine/3435)

<div class="topic-metadata">

**Author:** [@Shardul](https://discourse.cmake.org/u/Shardul)\
**Replies:** 1\
**Last updated:** [May 29, 2021, 9:53am UTC](https://discourse.cmake.org/t/cmake-dcmake-install-prefix-is-not-working-fine/3435 "2021-05-29T09:53:58Z")

</div>

I was using cmake commands to build a dependency for my project and the code goes like: ~/game.libretro/build$ cmake -DCMAKE\_BUILD\_TYPE=Debug \\ \> -DCMAKE\_PREFIX\_PATH=$HOME/xbmc \\ \> -DCMAKE\_INSTALL\_PREFIX=$HOME/workspae…

---

## [How to detect VS 2019 Minor Version](https://discourse.cmake.org/t/how-to-detect-vs-2019-minor-version/3423)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 5\
**Last updated:** [May 28, 2021, 3:37pm UTC](https://discourse.cmake.org/t/how-to-detect-vs-2019-minor-version/3423 "2021-05-28T15:37:13Z")

</div>

The latest 16.10 update broke our CMake visual studio builds. They introduced this new “/external” functionality. Which isn’t backward compatible with what we were doing before. How can I detect the 16.10 version numbe…

---

## [can build presets run a configuration?](https://discourse.cmake.org/t/can-build-presets-run-a-configuration/3428)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 1\
**Last updated:** [May 28, 2021, 12:12pm UTC](https://discourse.cmake.org/t/can-build-presets-run-a-configuration/3428 "2021-05-28T12:12:45Z")

</div>

The build preset inherits a configure preset. When building a project from the command line like this cmake --build --preset default can CMake run the configure command for me? Currently it results in Error: /tmp/test/…

---

## [Setup Eclipse](https://discourse.cmake.org/t/setup-eclipse/3410)

<div class="topic-metadata">

**Author:** [@keyara](https://discourse.cmake.org/u/keyara)\
**Replies:** 1\
**Last updated:** [May 28, 2021, 6:49am UTC](https://discourse.cmake.org/t/setup-eclipse/3410 "2021-05-28T06:49:32Z")

</div>

I have everything installed but I don’t have the understanding to set up cmake for eclipse.

---

## [How to edit CMakePresets.json (nativeToolOptions not recognised)](https://discourse.cmake.org/t/how-to-edit-cmakepresets-json-nativetooloptions-not-recognised/3424)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 2\
**Last updated:** [May 27, 2021, 3:55pm UTC](https://discourse.cmake.org/t/how-to-edit-cmakepresets-json-nativetooloptions-not-recognised/3424 "2021-05-27T15:55:17Z")

</div>

I am new to CMake presets. I am experimenting with it in Visual Studio 2019 and Visual Studio Code. I want to add ‘nativeToolOptions’ to a preset but the schema used by these tools seems to disallow it. Maybe I have mis…

---

## [Build (and not run) CUDA app on docker windows image](https://discourse.cmake.org/t/build-and-not-run-cuda-app-on-docker-windows-image/3403)

<div class="topic-metadata">

**Author:** [@soroush](https://discourse.cmake.org/u/soroush)\
**Replies:** 8\
**Last updated:** [May 26, 2021, 7:10pm UTC](https://discourse.cmake.org/t/build-and-not-run-cuda-app-on-docker-windows-image/3403 "2021-05-26T19:10:54Z")

</div>

I am trying to streamline the build process of my application. The idea is to execute a build pipeline of several docker images, each compiling either dependencies or parts of a big C++/CUDA codebase. The problem I face…

---

## [List of source created by Unity](https://discourse.cmake.org/t/list-of-source-created-by-unity/3407)

<div class="topic-metadata">

**Author:** [@Mario\_Not64](https://discourse.cmake.org/u/Mario_Not64)\
**Replies:** 1\
**Last updated:** [May 25, 2021, 8:28pm UTC](https://discourse.cmake.org/t/list-of-source-created-by-unity/3407 "2021-05-25T20:28:01Z")

</div>

Is it possible to get the list of source files created by a Unity build for a perticular executable ? I am using cppcheck and would like it to run on the unity cxx autogenerated files. I’m getting the sources files fr…

---

## [compile and link separately](https://discourse.cmake.org/t/compile-and-link-separately/3405)

<div class="topic-metadata">

**Author:** [@ggghamd](https://discourse.cmake.org/u/ggghamd)\
**Replies:** 2\
**Last updated:** [May 25, 2021, 6:38pm UTC](https://discourse.cmake.org/t/compile-and-link-separately/3405 "2021-05-25T18:38:04Z")

</div>

I need to pass a specific compiler switch to CXX compiler by following statement, in this example use clang and arg: -emit-llvm but during generation, it complains the linker can not use this argument. Apparently cmake …

---

## [CPack Hangs When Creating a Package](https://discourse.cmake.org/t/cpack-hangs-when-creating-a-package/3372)

<div class="topic-metadata">

**Author:** [@J.Think](https://discourse.cmake.org/u/J.Think)\
**Replies:** 1\
**Last updated:** [May 25, 2021, 5:48pm UTC](https://discourse.cmake.org/t/cpack-hangs-when-creating-a-package/3372 "2021-05-25T17:48:08Z")

</div>

I am creating a debian package for a cross-compiled library. The library is being cross-compiled for Ubuntu 16.04 (Xenial), QNX, and ROS. The library compiles without issue in each of the OS’s however, when I execute the…

---

## [make stuck on "\[ 50%\] Linking CXX executable someExecutable"](https://discourse.cmake.org/t/make-stuck-on-50-linking-cxx-executable-someexecutable/3389)

<div class="topic-metadata">

**Author:** [@inevo](https://discourse.cmake.org/u/inevo)\
**Replies:** 1\
**Last updated:** [May 23, 2021, 3:51pm UTC](https://discourse.cmake.org/t/make-stuck-on-50-linking-cxx-executable-someexecutable/3389 "2021-05-23T15:51:25Z")

</div>

Hi, I am trying to compile a simple C++ program and create a library that will later be used in Android Studio. (Compiling the .cpp file via command line works so there is no problem with the code) I am running on a Mac…

---

## [CMAKE3.20 can't generate ... xInt package....](https://discourse.cmake.org/t/cmake3-20-cant-generate-xint-package/2987)

<div class="topic-metadata">

**Author:** [@fly2sky2018](https://discourse.cmake.org/u/fly2sky2018)\
**Replies:** 3\
**Last updated:** [May 22, 2021, 9:33am UTC](https://discourse.cmake.org/t/cmake3-20-cant-generate-xint-package/2987 "2021-05-22T09:33:52Z")

</div>

Configuring done. but can’t generate xInt lib and dll… Please Help ~ thx Erro is below: CMake Error at third-party/libstudxml.build/CMakeLists.txt:52 (add\_library): \*\* Cannot find source file:\*\* \*\* C:/xlnt-mas…

---

## [Avoid duplication of CMake config command line](https://discourse.cmake.org/t/avoid-duplication-of-cmake-config-command-line/3377)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 10\
**Last updated:** [May 21, 2021, 12:36pm UTC](https://discourse.cmake.org/t/avoid-duplication-of-cmake-config-command-line/3377 "2021-05-21T12:36:39Z")

</div>

We have to build for a lot of different OSes with lots of options (Rel/Dbg, SonarQube On/Off, Coverage On/Off…). The scripts to get the config command line are duplicated to: yml (Azure-DevOps Build definition) VS Code…

---

## [Issue with ca-certificates and downloading a file](https://discourse.cmake.org/t/issue-with-ca-certificates-and-downloading-a-file/3321)

<div class="topic-metadata">

**Author:** [@rlemmon](https://discourse.cmake.org/u/rlemmon)\
**Replies:** 1\
**Last updated:** [May 21, 2021, 10:02am UTC](https://discourse.cmake.org/t/issue-with-ca-certificates-and-downloading-a-file/3321 "2021-05-21T10:02:53Z")

</div>

Hi, I have an issue with ca-certificates and downloading a file. Below is an example CMakeLists.txt. # Specify the minimum version for CMake cmake\_minimum\_required(VERSION 3.13.5) # Project's name project(hello) fil…

---

## [using sub builds with file API](https://discourse.cmake.org/t/using-sub-builds-with-file-api/3380)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 3\
**Last updated:** [May 20, 2021, 4:55pm UTC](https://discourse.cmake.org/t/using-sub-builds-with-file-api/3380 "2021-05-20T16:55:31Z")

</div>

When using the file API for ide integration is it possible to create a build per project for Makefile generators? I would like to create a sub project from my main build by using a second project call.

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

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