# Usage

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

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

**Page:** 59

---

## [Retry build steps on specific errors](https://discourse.cmake.org/t/retry-build-steps-on-specific-errors/6221)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 2\
**Last updated:** [August 5, 2022, 4:17pm UTC](https://discourse.cmake.org/t/retry-build-steps-on-specific-errors/6221 "2022-08-05T16:17:12Z")

</div>

Is it possible to (silently) retry build steps if specific errors occur? If some pattern is in stdout/err, it will not log the error but retry it (maybe after some sleep). Details: The particular error is mt.exe : ge…

---

## [execute\_process and add\_custom\_target behave differently with respect to COMMAND](https://discourse.cmake.org/t/execute-process-and-add-custom-target-behave-differently-with-respect-to-command/6196)

<div class="topic-metadata">

**Author:** [@Maitrey](https://discourse.cmake.org/u/Maitrey)\
**Replies:** 5\
**Last updated:** [August 4, 2022, 9:44pm UTC](https://discourse.cmake.org/t/execute-process-and-add-custom-target-behave-differently-with-respect-to-command/6196 "2022-08-04T21:44:22Z")

</div>

Dear CMake Folks, I have a strange issue, I need to run matlab script and use the generated code for compilation. I would like to run matlab2018b(64 bit) in Windows without display and I am using MinGW as makefile gene…

---

## [Trouble installing cMake on macOS Monterey 12.5](https://discourse.cmake.org/t/trouble-installing-cmake-on-macos-monterey-12-5/6214)

<div class="topic-metadata">

**Author:** [@GeneBuchite](https://discourse.cmake.org/u/GeneBuchite)\
**Replies:** 1\
**Last updated:** [August 4, 2022, 7:39pm UTC](https://discourse.cmake.org/t/trouble-installing-cmake-on-macos-monterey-12-5/6214 "2022-08-04T19:39:02Z")

</div>

when running the cMake GUI I’m not sure where to find the source code. I try entering the Directory where the tar/gz file is. also where the app is located. both give the same error when attempting to configure. error is …

---

## [lost with getting CPack to make a macOS Bundle](https://discourse.cmake.org/t/lost-with-getting-cpack-to-make-a-macos-bundle/2102)

<div class="topic-metadata">

**Author:** [@Be.0](https://discourse.cmake.org/u/Be.0)\
**Replies:** 10\
**Last updated:** [August 3, 2022, 9:48pm UTC](https://discourse.cmake.org/t/lost-with-getting-cpack-to-make-a-macos-bundle/2102 "2022-08-03T21:48:53Z")

</div>

I am having trouble getting CPack working to build a bundle on macOS using fixup\_bundle. I can’t figure out how to get fixup\_bundle to recognize the installation path as a bundle. If I comment out fixup\_bundle, cpack bui…

---

## [Issue about PRIVATE in target\_link\_libraries](https://discourse.cmake.org/t/issue-about-private-in-target-link-libraries/6182)

<div class="topic-metadata">

**Author:** [@FuXii](https://discourse.cmake.org/u/FuXii)\
**Replies:** 2\
**Last updated:** [August 2, 2022, 12:51pm UTC](https://discourse.cmake.org/t/issue-about-private-in-target-link-libraries/6182 "2022-08-02T12:51:09Z")

</div>

I create a static lib project called TCore and dependent many thirdparty lib project : glslang VulkanMemoryAllocator SPIRV-Cross project(TCore) aux\_source\_directory(./src/ SRCS) add\_library(${PROJECT\_NAME} STATIC ${…

---

## [CPack Debian package.links Support](https://discourse.cmake.org/t/cpack-debian-package-links-support/6199)

<div class="topic-metadata">

**Author:** [@codeInnovation](https://discourse.cmake.org/u/codeInnovation)\
**Replies:** 1\
**Last updated:** [August 2, 2022, 11:17am UTC](https://discourse.cmake.org/t/cpack-debian-package-links-support/6199 "2022-08-02T11:17:32Z")

</div>

The CPACK\_DEBIAN\_PACKAGE\_CONTROL\_EXTRA variable can be used to specify other files such as a postinst script. When I also store a path in CPACK\_DEBIAN\_PACKAGE\_CONTROL\_EXTRA to a links file I expected CPack to create the…

---

## [cmake 3.23.2 - Error: Could not find MPI\_C on Macbook Pro os 10.13.6; elmerfem, FindMPI](https://discourse.cmake.org/t/cmake-3-23-2-error-could-not-find-mpi-c-on-macbook-pro-os-10-13-6-elmerfem-findmpi/6161)

<div class="topic-metadata">

**Author:** [@Tom-Bertin](https://discourse.cmake.org/u/Tom-Bertin)\
**Replies:** 1\
**Last updated:** [August 2, 2022, 11:09am UTC](https://discourse.cmake.org/t/cmake-3-23-2-error-could-not-find-mpi-c-on-macbook-pro-os-10-13-6-elmerfem-findmpi/6161 "2022-08-02T11:09:57Z")

</div>

First of all: it’s the first time I’m filing an issue here. I also don’t know if I’m in the right place here for asking help for this issue. I also am NOT an advanced user of cmake, compilers, macports, etc. I just wante…

---

## [Specify conflicts for packages with CPack](https://discourse.cmake.org/t/specify-conflicts-for-packages-with-cpack/6166)

<div class="topic-metadata">

**Author:** [@martijntje](https://discourse.cmake.org/u/martijntje)\
**Replies:** 2\
**Last updated:** [August 1, 2022, 7:31am UTC](https://discourse.cmake.org/t/specify-conflicts-for-packages-with-cpack/6166 "2022-08-01T07:31:59Z")

</div>

I’m using CPack to generate packages. Some of these packages conflict with eachother, so only one of them can be installed at the same time. Since I’m generating debian packages, they support storing this information ins…

---

## [CMake issues](https://discourse.cmake.org/t/cmake-issues/6147)

<div class="topic-metadata">

**Author:** [@skgoswami](https://discourse.cmake.org/u/skgoswami)\
**Replies:** 14\
**Last updated:** [August 1, 2022, 2:04am UTC](https://discourse.cmake.org/t/cmake-issues/6147 "2022-08-01T02:04:32Z")

</div>

I installed Qt Creator version 7.0.2 with cmake and namke option few months back. In the IDE kit I am able to find Cmake version 3.21.1 and it is working with single source file. However with multiple files it is working…

---

## [virtualbox, cmake, nautilus samba mountpoints leading to system and compilers undefined](https://discourse.cmake.org/t/virtualbox-cmake-nautilus-samba-mountpoints-leading-to-system-and-compilers-undefined/6167)

<div class="topic-metadata">

**Author:** [@Gonzalo\_Garramuno](https://discourse.cmake.org/u/Gonzalo_Garramuno)\
**Replies:** 3\
**Last updated:** [July 29, 2022, 10:10pm UTC](https://discourse.cmake.org/t/virtualbox-cmake-nautilus-samba-mountpoints-leading-to-system-and-compilers-undefined/6167 "2022-07-29T22:10:20Z")

</div>

I am using virtualbox’s bridge adapter on Ubuntu host with guest CentOS 7. I am running samba server on the Ubuntu machine. I can mount the directory I want from nautilus and the directory appears on the desktop, with …

---

## [Interface Library Directory Structure vs #include Path](https://discourse.cmake.org/t/interface-library-directory-structure-vs-include-path/6069)

<div class="topic-metadata">

**Author:** [@RespiteSage](https://discourse.cmake.org/u/RespiteSage)\
**Replies:** 1\
**Last updated:** [July 28, 2022, 3:20pm UTC](https://discourse.cmake.org/t/interface-library-directory-structure-vs-include-path/6069 "2022-07-28T15:20:27Z")

</div>

Hey, there. I suspect there’s a simple answer to my question but that I’m using the wrong search terms to find it, so please bear with me if this has been asked and answered before. I’m trying to write a CPP library to …

---

## [What is that number represent in cmake eg: cmake(1) and cmake-buildsystem(7)](https://discourse.cmake.org/t/what-is-that-number-represent-in-cmake-eg-cmake-1-and-cmake-buildsystem-7/6157)

<div class="topic-metadata">

**Author:** [@bhavith](https://discourse.cmake.org/u/bhavith)\
**Replies:** 1\
**Last updated:** [July 27, 2022, 8:07am UTC](https://discourse.cmake.org/t/what-is-that-number-represent-in-cmake-eg-cmake-1-and-cmake-buildsystem-7/6157 "2022-07-27T08:07:27Z")

</div>

Can anyone please let me know what does the number 1 and 7 represents in cmake(1) and cmake-buildsystem(7).

---

## [Adding CMakelist.txt to source directory](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124)

<div class="topic-metadata">

**Author:** [@mali.solangi](https://discourse.cmake.org/u/mali.solangi)\
**Replies:** 5\
**Last updated:** [July 27, 2022, 7:12am UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124 "2022-07-27T07:12:45Z")

</div>

Hello sir, I am trying to setting up this (aviso-fes/INSTALL.md at main · CNES/aviso-fes · GitHub). installed successfully this command (conda install pyfes -c fbriol ) Then successfully ran this command ( mkdir build…

---

## [Where is find\_package() finding the package?](https://discourse.cmake.org/t/where-is-find-package-finding-the-package/6150)

<div class="topic-metadata">

**Author:** [@tomoreilly](https://discourse.cmake.org/u/tomoreilly)\
**Replies:** 2\
**Last updated:** [July 26, 2022, 4:51pm UTC](https://discourse.cmake.org/t/where-is-find-package-finding-the-package/6150 "2022-07-26T16:51:07Z")

</div>

Does cmake provide some way of knowing exactly where find\_package(X) finds package X? E.g. can I find the installation location of package X files on my machine after calling find\_package(X)? Thanks!

---

## [VCTargetsPath error while using VS 10 2010 generator](https://discourse.cmake.org/t/vctargetspath-error-while-using-vs-10-2010-generator/6063)

<div class="topic-metadata">

**Author:** [@lsoranco](https://discourse.cmake.org/u/lsoranco)\
**Replies:** 9\
**Last updated:** [July 26, 2022, 4:48pm UTC](https://discourse.cmake.org/t/vctargetspath-error-while-using-vs-10-2010-generator/6063 "2022-07-26T16:48:33Z")

</div>

Hello! I am absolutely new to CMake (in fact I am still figuring out its purpose, not usually to languages that are complex to compile, programmed most of my stuff on Python and Rust), so please bear with me if the ques…

---

## [CMAKE\_CXX\_USE\_RESPONSE\_FILE\_FOR\_INCLUDES Not working](https://discourse.cmake.org/t/cmake-cxx-use-response-file-for-includes-not-working/6118)

<div class="topic-metadata">

**Author:** [@Charles\_Sweeney](https://discourse.cmake.org/u/Charles_Sweeney)\
**Replies:** 1\
**Last updated:** [July 25, 2022, 8:08pm UTC](https://discourse.cmake.org/t/cmake-cxx-use-response-file-for-includes-not-working/6118 "2022-07-25T20:08:50Z")

</div>

I’m trying to better understand disabling response files as I have a situation where disabling them in the top parent level CMake file with. SET(CMAKE\_C\_USE\_RESPONSE\_FILE\_FOR\_INCLUDES 0) SET(CMAKE\_CXX\_USE\_RESPONSE\_FILE…

---

## [How to set host application for XCTest?](https://discourse.cmake.org/t/how-to-set-host-application-for-xctest/3401)

<div class="topic-metadata">

**Author:** [@zhang\_kai](https://discourse.cmake.org/u/zhang_kai)\
**Replies:** 1\
**Last updated:** [July 25, 2022, 8:24am UTC](https://discourse.cmake.org/t/how-to-set-host-application-for-xctest/3401 "2022-07-25T08:24:31Z")

</div>

Hi, when I use xctest\_add\_bundle to add a XCTest in XCode, the host application is not set. But the host application is needed to run the tests. Since we want to cmake, build and run test in CI/CD pipeline, we can’t ope…

---

## [\`cmake --test .\`?](https://discourse.cmake.org/t/cmake-test/6122)

<div class="topic-metadata">

**Author:** [@h-vetinari](https://discourse.cmake.org/u/h-vetinari)\
**Replies:** 1\
**Last updated:** [July 22, 2022, 5:34pm UTC](https://discourse.cmake.org/t/cmake-test/6122 "2022-07-22T17:34:26Z")

</div>

Hey all I’m not a heavy C/C++ developer, but I help package stuff for the python ecosystem (specifically conda-forge), and – thankfully – more packages are moving to CMake, and away from autotools et al. In the sequenc…

---

## [Why add\_dependencies() doesn't have any effect?](https://discourse.cmake.org/t/why-add-dependencies-doesnt-have-any-effect/6131)

<div class="topic-metadata">

**Author:** [@yurivict](https://discourse.cmake.org/u/yurivict)\
**Replies:** 1\
**Last updated:** [July 22, 2022, 5:08pm UTC](https://discourse.cmake.org/t/why-add-dependencies-doesnt-have-any-effect/6131 "2022-07-22T17:08:01Z")

</div>

The EternalTerminal project contains the add\_dependencies statement here but the generated Makefile doesn’t contain the line that the target et-lib depends on the target generated-code. Docs say that add\_dependencies ap…

---

## [Best Practice: Separate CMake targets for declaration and definition?](https://discourse.cmake.org/t/best-practice-separate-cmake-targets-for-declaration-and-definition/6112)

<div class="topic-metadata">

**Author:** [@developer](https://discourse.cmake.org/u/developer)\
**Replies:** 4\
**Last updated:** [July 20, 2022, 9:04pm UTC](https://discourse.cmake.org/t/best-practice-separate-cmake-targets-for-declaration-and-definition/6112 "2022-07-20T21:04:42Z")

</div>

I have a project where we have multiple threading libraries: Threading\_Linux, Threading\_Baremetal, etc. They all implement the same threading interfaces (function declarations and C++ interfaces), declared in it’s own IN…

---

## [Better contextual introduction for new users](https://discourse.cmake.org/t/better-contextual-introduction-for-new-users/6075)

<div class="topic-metadata">

**Author:** [@loren-osborn](https://discourse.cmake.org/u/loren-osborn)\
**Replies:** 2\
**Last updated:** [July 19, 2022, 3:09pm UTC](https://discourse.cmake.org/t/better-contextual-introduction-for-new-users/6075 "2022-07-19T15:09:09Z")

</div>

I’m a moderately advanced GNU Make user new to CMake, and I have some questions I’d expect to find in the FAQ to help me better contextualize what CMake can and can’t do, and what it is and isn’t good at, and understandi…

---

## [MSYS2 MINGW64\_NT System is unknown to cmake](https://discourse.cmake.org/t/msys2-mingw64-nt-system-is-unknown-to-cmake/6035)

<div class="topic-metadata">

**Author:** [@bradbell](https://discourse.cmake.org/u/bradbell)\
**Replies:** 1\
**Last updated:** [July 18, 2022, 6:15pm UTC](https://discourse.cmake.org/t/msys2-mingw64-nt-system-is-unknown-to-cmake/6035 "2022-07-18T18:15:56Z")

</div>

I am using a modified version the following suggestion for a msys2 environment on github: I get the following message during my cmake command: System is unknown to cmake, create: Platform/MINGW64\_NT-10.0-20348 to use…

---

## [Getting Unresolved symbols](https://discourse.cmake.org/t/getting-unresolved-symbols/6078)

<div class="topic-metadata">

**Author:** [@vasantharaj](https://discourse.cmake.org/u/vasantharaj)\
**Replies:** 2\
**Last updated:** [July 18, 2022, 4:35am UTC](https://discourse.cmake.org/t/getting-unresolved-symbols/6078 "2022-07-18T04:35:56Z")

</div>

Hello All, Need your help resolve following error.

---

## [nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified](https://discourse.cmake.org/t/nvcc-fatal-a-single-input-file-is-required-for-a-non-link-phase-when-an-outputfile-is-specified/6060)

<div class="topic-metadata">

**Author:** [@Raven\_Ridge](https://discourse.cmake.org/u/Raven_Ridge)\
**Replies:** 3\
**Last updated:** [July 17, 2022, 8:46pm UTC](https://discourse.cmake.org/t/nvcc-fatal-a-single-input-file-is-required-for-a-non-link-phase-when-an-outputfile-is-specified/6060 "2022-07-17T20:46:50Z")

</div>

On running “E:\\software for programming\\nvidia NeRF\\Thecodes\\instant-ngp\>cmake --build build --config RelWithDebInfo -j 16” in Developer Command Prompt for VS 2019 I get this error: I followed this tutorial: https:/…

---

## [target\_link\_libraries just referencing?](https://discourse.cmake.org/t/target-link-libraries-just-referencing/6050)

<div class="topic-metadata">

**Author:** [@Glad](https://discourse.cmake.org/u/Glad)\
**Replies:** 2\
**Last updated:** [July 16, 2022, 10:16am UTC](https://discourse.cmake.org/t/target-link-libraries-just-referencing/6050 "2022-07-16T10:16:53Z")

</div>

Hi, I am not sure to understand something. Context: I have separate folders, each one having header/source files and a CMakelist.txt. Each CMakelist defines a project. They are created with: add\_library(${APP\_NAME} …

---

## [cmake how to make the build final execute file to another directory](https://discourse.cmake.org/t/cmake-how-to-make-the-build-final-execute-file-to-another-directory/6044)

<div class="topic-metadata">

**Author:** [@jian\_he](https://discourse.cmake.org/u/jian_he)\
**Replies:** 1\
**Last updated:** [July 15, 2022, 2:19pm UTC](https://discourse.cmake.org/t/cmake-how-to-make-the-build-final-execute-file-to-another-directory/6044 "2022-07-15T14:19:50Z")

</div>

Allow me: https://cmake.org/cmake/help/latest/guide/tutorial/A%20Basic%20Starting%20Point.html current directory: /home/jian/helloc/cmake\_begin/step1 then cd …/step1 then it will return the same directory. Current …

---

## [Post copy files to currently building target directory.](https://discourse.cmake.org/t/post-copy-files-to-currently-building-target-directory/6027)

<div class="topic-metadata">

**Author:** [@marksibly](https://discourse.cmake.org/u/marksibly)\
**Replies:** 2\
**Last updated:** [July 15, 2022, 12:58am UTC](https://discourse.cmake.org/t/post-copy-files-to-currently-building-target-directory/6027 "2022-07-15T00:58:53Z")

</div>

Hi, I have a cmake project that contains multiple libs and multiple exes (mostly tests and demos). Is there any way to setup cmake to copy data files from one of the libs to whichever exe target is being built? I have…

---

## ["undefined reference to \`\_exit'" on compiler check](https://discourse.cmake.org/t/undefined-reference-to-exit-on-compiler-check/6071)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.cmake.org/u/pauljurczak)\
**Replies:** 1\
**Last updated:** [July 14, 2022, 7:22pm UTC](https://discourse.cmake.org/t/undefined-reference-to-exit-on-compiler-check/6071 "2022-07-14T19:22:17Z")

</div>

I installed the newest Pico SDK 1.4.0 on Ubuntu 22.04 (x86) with GCC 10.3.1 and CMake 3.21.4. I followed instructions in “Getting started with Raspberry Pi Pico”. When building a “blink” example, I’m getting “undefined r…

---

## [FindPython3: how to change the location of python](https://discourse.cmake.org/t/findpython3-how-to-change-the-location-of-python/6034)

<div class="topic-metadata">

**Author:** [@zhang-qiang-github](https://discourse.cmake.org/u/zhang-qiang-github)\
**Replies:** 7\
**Last updated:** [July 13, 2022, 7:21am UTC](https://discourse.cmake.org/t/findpython3-how-to-change-the-location-of-python/6034 "2022-07-13T07:21:20Z")

</div>

I am using find\_package(Python3 COMPONENTS Interpreter Development) to find python, and it can successfully find my conda python. However, I can not change the location of python. CMake find my conda/envA, but I want to…

---

## [Bug with GENERATED file and target\_sources PRIVATE](https://discourse.cmake.org/t/bug-with-generated-file-and-target-sources-private/5262)

<div class="topic-metadata">

**Author:** [@marstaik](https://discourse.cmake.org/u/marstaik)\
**Replies:** 16\
**Last updated:** [July 12, 2022, 6:54pm UTC](https://discourse.cmake.org/t/bug-with-generated-file-and-target-sources-private/5262 "2022-07-12T18:54:02Z")

</div>

Version: 3.23.0-rc2 Hi, I believe I have run into a bug regarding generated files via add\_custom\_command and target\_sources when subdirectories are involved. Bear with me please, as this is a bit weird. Here is a dire…

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

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