# Usage

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

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

**Page:** 87

---

## [this commond exe in some computers very slowly](https://discourse.cmake.org/t/this-commond-exe-in-some-computers-very-slowly/2378)

<div class="topic-metadata">

**Author:** [@renpengcheng4612](https://discourse.cmake.org/u/renpengcheng4612)\
**Replies:** 2\
**Last updated:** [December 15, 2020, 4:03pm UTC](https://discourse.cmake.org/t/this-commond-exe-in-some-computers-very-slowly/2378 "2020-12-15T16:03:04Z")

</div>

\[cmake\] D:\\HarmonySdk\\3.0.1.93\\native\\3.0.1.93\\build-tools\\cmake\\bin\\cmake.exe -HC:\\Users\\Administrator\\DevEcoStudioProjects\\cpptest\\entry\\src\\main\\cpp\\ -BC:\\Users\\Administrator\\DevEcoStudioProjects\\cpptest\\entry.cxx\\deb…

---

## [Race condition when multi add\_custom\_target deps on same file generated by add\_custom\_command](https://discourse.cmake.org/t/race-condition-when-multi-add-custom-target-deps-on-same-file-generated-by-add-custom-command/2358)

<div class="topic-metadata">

**Author:** [@hehaoqian](https://discourse.cmake.org/u/hehaoqian)\
**Replies:** 4\
**Last updated:** [December 14, 2020, 5:39pm UTC](https://discourse.cmake.org/t/race-condition-when-multi-add-custom-target-deps-on-same-file-generated-by-add-custom-command/2358 "2020-12-14T17:39:44Z")

</div>

TLDR: I do not understand the behavior of add\_custom\_command/add\_custom\_target when multiple of add\_custom\_command/add\_custom\_target depends on the same generated file created by add\_custom\_command in the same directory…

---

## [Chained compilation](https://discourse.cmake.org/t/chained-compilation/2365)

<div class="topic-metadata">

**Author:** [@robiwano](https://discourse.cmake.org/u/robiwano)\
**Replies:** 3\
**Last updated:** [December 14, 2020, 2:03pm UTC](https://discourse.cmake.org/t/chained-compilation/2365 "2020-12-14T14:03:00Z")

</div>

I’m looking for a way to create a new language, let’s call it LLVM :), and the compilation from C++ to object file would go through: C++ -\> LLVM -\> C -\> object file where LLVM -\> C compilation is defined via https://g…

---

## [Python3\_FIND\_STRATEGY missing python3 link](https://discourse.cmake.org/t/python3-find-strategy-missing-python3-link/2056)

<div class="topic-metadata">

**Author:** [@gruenich](https://discourse.cmake.org/u/gruenich)\
**Replies:** 8\
**Last updated:** [December 12, 2020, 7:18pm UTC](https://discourse.cmake.org/t/python3-find-strategy-missing-python3-link/2056 "2020-12-12T19:18:38Z")

</div>

FindPython3 offers two strategies: VERSION and LOCATION. From a user’s point of view, the best strategy would be to check what python3 is referring to. Assume two version of Python are installed (3.6 and 3.7) and 3.6 is…

---

## [What is the default target when building a project?](https://discourse.cmake.org/t/what-is-the-default-target-when-building-a-project/2341)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 4\
**Last updated:** [December 11, 2020, 8:27pm UTC](https://discourse.cmake.org/t/what-is-the-default-target-when-building-a-project/2341 "2020-12-11T20:27:07Z")

</div>

https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-a-project Looking at the cmake build documentation I’m a bit confused. --target \<tgt\>..., -t \<tgt\>... Build \<tgt\> instead of the default target. Multip…

---

## [how to package a GNU make project?](https://discourse.cmake.org/t/how-to-package-a-gnu-make-project/2350)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 2\
**Last updated:** [December 11, 2020, 6:34pm UTC](https://discourse.cmake.org/t/how-to-package-a-gnu-make-project/2350 "2020-12-11T18:34:32Z")

</div>

I have a CMake project that depends on an external project. The external project is a GNU make build. With external\_project\_add i chose the binaries to install under build/dep1-prefix/bin. Now, i also want to install t…

---

## [CPack doesn't produce a debian dbgsym package alongside debian binary package](https://discourse.cmake.org/t/cpack-doesnt-produce-a-debian-dbgsym-package-alongside-debian-binary-package/1255)

<div class="topic-metadata">

**Author:** [@manuel](https://discourse.cmake.org/u/manuel)\
**Replies:** 3\
**Last updated:** [December 11, 2020, 4:17pm UTC](https://discourse.cmake.org/t/cpack-doesnt-produce-a-debian-dbgsym-package-alongside-debian-binary-package/1255 "2020-12-11T16:17:47Z")

</div>

Hello all, I have a CMake project which successfully builds a static library and packages it as a debian package. I would like to distribute a dgbsym package along with it. Altough I think I followed all the steps neces…

---

## [cpack doesn't produce .ddeb as expected](https://discourse.cmake.org/t/cpack-doesnt-produce-ddeb-as-expected/2349)

<div class="topic-metadata">

**Author:** [@gmabey](https://discourse.cmake.org/u/gmabey)\
**Replies:** 0\
**Last updated:** [December 11, 2020, 4:16pm UTC](https://discourse.cmake.org/t/cpack-doesnt-produce-ddeb-as-expected/2349 "2020-12-11T16:16:14Z")

</div>

---

## [cpack -G NuGet : how does one generate the targets file?](https://discourse.cmake.org/t/cpack-g-nuget-how-does-one-generate-the-targets-file/1633)

<div class="topic-metadata">

**Author:** [@masariello](https://discourse.cmake.org/u/masariello)\
**Replies:** 2\
**Last updated:** [December 10, 2020, 9:31pm UTC](https://discourse.cmake.org/t/cpack-g-nuget-how-does-one-generate-the-targets-file/1633 "2020-12-10T21:31:20Z")

</div>

Hi All First time poster Quick question: what’s the recommended way to add a build/native/some\_pkg\_name.targets file to a NuGet package with CPack? I can certainly use something like the following: install(FILES proj…

---

## [using find\_package between 2 externalProject\_add](https://discourse.cmake.org/t/using-find-package-between-2-externalproject-add/2285)

<div class="topic-metadata">

**Author:** [@grimgort](https://discourse.cmake.org/u/grimgort)\
**Replies:** 11\
**Last updated:** [December 10, 2020, 3:31pm UTC](https://discourse.cmake.org/t/using-find-package-between-2-externalproject-add/2285 "2020-12-10T15:31:53Z")

</div>

Hello, Good morning, I can’t find a solution to run a find\_package() between 2 externalProject\_add() during the “build time”. Indeed, Project2 needs Project1 both being compiled by externalProject. But since Project2 d…

---

## [how to build a .so lib on MacOS](https://discourse.cmake.org/t/how-to-build-a-so-lib-on-macos/2336)

<div class="topic-metadata">

**Author:** [@wangqi](https://discourse.cmake.org/u/wangqi)\
**Replies:** 2\
**Last updated:** [December 10, 2020, 9:36am UTC](https://discourse.cmake.org/t/how-to-build-a-so-lib-on-macos/2336 "2020-12-10T09:36:22Z")

</div>

Can I build a .so lib on MacOS? I have a project using openCV and have built a .dylib on my MacOS, and now I need to deploy my project on docker(Linux) and I hope I can build a .so on my MacOS and directly use it in Linu…

---

## [Simultaneous x86 and x86\_64 build](https://discourse.cmake.org/t/simultaneous-x86-and-x86-64-build/2313)

<div class="topic-metadata">

**Author:** [@mwezdeck](https://discourse.cmake.org/u/mwezdeck)\
**Replies:** 6\
**Last updated:** [December 9, 2020, 12:07am UTC](https://discourse.cmake.org/t/simultaneous-x86-and-x86-64-build/2313 "2020-12-09T00:07:28Z")

</div>

Hi, Thanks in advance for reply. Let’s consider such situation of compiling very complex project. cd \[project\] mkdir x86 cd x86 cmake … -GNinja -A x86 ninja cd \[project\] mkdir x86\_64 cd x86\_64 cmake .. -GNinja…

---

## [CMAKE Build in parallel Fail](https://discourse.cmake.org/t/cmake-build-in-parallel-fail/2299)

<div class="topic-metadata">

**Author:** [@arturoar3nas](https://discourse.cmake.org/u/arturoar3nas)\
**Replies:** 9\
**Last updated:** [December 8, 2020, 11:55pm UTC](https://discourse.cmake.org/t/cmake-build-in-parallel-fail/2299 "2020-12-08T23:55:41Z")

</div>

Hello, Always when I try to build some project with cmake --build \<some dir\> -j n this fail in most cases. How I can fix this? Thanks!

---

## [help passing passing empty parameter ("") indirectly to \`ExternalProject\_Add\`](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307)

<div class="topic-metadata">

**Author:** [@daroxs95](https://discourse.cmake.org/u/daroxs95)\
**Replies:** 4\
**Last updated:** [December 7, 2020, 11:41pm UTC](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307 "2020-12-07T23:41:42Z")

</div>

this code is not working currently(not deactivating the download step), if provided non empty string, it does treat it as the download command set(FRESH\_DOWNLOAD off CACHE BOOL "download a fresh copy of all dependencies…

---

## [How to achieve good dependencie granularity AND allowing source globing AND monkeypatching?](https://discourse.cmake.org/t/how-to-achieve-good-dependencie-granularity-and-allowing-source-globing-and-monkeypatching/2302)

<div class="topic-metadata">

**Author:** [@james\_brown](https://discourse.cmake.org/u/james_brown)\
**Replies:** 5\
**Last updated:** [December 7, 2020, 7:39pm UTC](https://discourse.cmake.org/t/how-to-achieve-good-dependencie-granularity-and-allowing-source-globing-and-monkeypatching/2302 "2020-12-07T19:39:16Z")

</div>

What I am doing I am using a CMake based build system where code is organized into libraries to allow monkeypatching and source globing. Basically, some directory are translated into libraries. Creating libraries rather…

---

## [Error when installing targets and exports in 3.19.1](https://discourse.cmake.org/t/error-when-installing-targets-and-exports-in-3-19-1/2245)

<div class="topic-metadata">

**Author:** [@vre](https://discourse.cmake.org/u/vre)\
**Replies:** 8\
**Last updated:** [December 5, 2020, 1:48pm UTC](https://discourse.cmake.org/t/error-when-installing-targets-and-exports-in-3-19-1/2245 "2020-12-05T13:48:44Z")

</div>

I’m using the following fragments to install targets and exports in a number of projects. install(TARGETS myproj EXPORT myproj ARCHIVE DESTINATION ${CMAKE\_INSTALL\_LIBDIR} COMPONENT development LIBRARY DESTINATION $…

---

## [Clarify note "export name that is the same as the package name" in cmake documetation](https://discourse.cmake.org/t/clarify-note-export-name-that-is-the-same-as-the-package-name-in-cmake-documetation/2280)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 6\
**Last updated:** [December 4, 2020, 10:05pm UTC](https://discourse.cmake.org/t/clarify-note-export-name-that-is-the-same-as-the-package-name-in-cmake-documetation/2280 "2020-12-04T22:05:23Z")

</div>

cmake install man page: Note: The installed \<export-name\>.cmake file may come with additional per-configuration \<export-name\>-\*.cmake files to be loaded by globbing. Do not use an export name that is the same as the pa…

---

## [File TOUCH error](https://discourse.cmake.org/t/file-touch-error/2293)

<div class="topic-metadata">

**Author:** [@VineethV](https://discourse.cmake.org/u/VineethV)\
**Replies:** 1\
**Last updated:** [December 4, 2020, 8:37pm UTC](https://discourse.cmake.org/t/file-touch-error/2293 "2020-12-04T20:37:49Z")

</div>

I have the below code in one of my CMakeList.txt files. # Create a config file to differentiate Release and Debug build version if("${CMAKE\_BUILD\_TYPE}" STREQUAL "Debug") file( TOUCH "${CMAKE\_RUNTIME\_OUTPUT\_DIRECTORY}…

---

## [Cross compile for aarch64 on Ubuntu](https://discourse.cmake.org/t/cross-compile-for-aarch64-on-ubuntu/2161)

<div class="topic-metadata">

**Author:** [@godfool](https://discourse.cmake.org/u/godfool)\
**Replies:** 10\
**Last updated:** [December 4, 2020, 12:45pm UTC](https://discourse.cmake.org/t/cross-compile-for-aarch64-on-ubuntu/2161 "2020-12-04T12:45:12Z")

</div>

I’ve got the tool chain file fairly well figured out. The problem I run into is that the sysroot is at /usr/aarch64-linux-gnu, while the arm64 libs and includes are in /usr/lib/aarch64-linux-gnu and /usr/include/aarch64-…

---

## [Recover compiler warnings of up to date targets](https://discourse.cmake.org/t/recover-compiler-warnings-of-up-to-date-targets/2288)

<div class="topic-metadata">

**Author:** [@bachp](https://discourse.cmake.org/u/bachp)\
**Replies:** 1\
**Last updated:** [December 3, 2020, 4:50pm UTC](https://discourse.cmake.org/t/recover-compiler-warnings-of-up-to-date-targets/2288 "2020-12-03T16:50:13Z")

</div>

Hi All, Is there a way to recover compiler warnings from target that were up to date and thus not run in the current build run. The goal is to be able to show diagnostics for the whole project in Eclipse even tough onl…

---

## [ExternalProject\_Add for Makefile project error during build](https://discourse.cmake.org/t/externalproject-add-for-makefile-project-error-during-build/2275)

<div class="topic-metadata">

**Author:** [@eqbalz](https://discourse.cmake.org/u/eqbalz)\
**Replies:** 1\
**Last updated:** [December 2, 2020, 8:10pm UTC](https://discourse.cmake.org/t/externalproject-add-for-makefile-project-error-during-build/2275 "2020-12-02T20:10:12Z")

</div>

I am trying to add Postgresql as a dependency for my project for which I am using ExternalProject module to download the source from github and build, but the build step fails when running from cmake (cmake --build .). C…

---

## [Help with CC, Clang, Environment, and CMake](https://discourse.cmake.org/t/help-with-cc-clang-environment-and-cmake/2221)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 11\
**Last updated:** [December 1, 2020, 9:26pm UTC](https://discourse.cmake.org/t/help-with-cc-clang-environment-and-cmake/2221 "2020-12-01T21:26:38Z")

</div>

All, I think I might be an idiot, but I’m not sure what’s going on. I’m having issues with CMake because it seems to be finding the “wrong clang”. In an autotools build (controlled by CMake/ExternalProject\_Add), it’s tr…

---

## [cmake command line -D and using DEFINED](https://discourse.cmake.org/t/cmake-command-line-d-and-using-defined/2264)

<div class="topic-metadata">

**Author:** [@bradbell](https://discourse.cmake.org/u/bradbell)\
**Replies:** 6\
**Last updated:** [December 1, 2020, 1:50pm UTC](https://discourse.cmake.org/t/cmake-command-line-d-and-using-defined/2264 "2020-12-01T13:50:13Z")

</div>

I would like to be able to just define a cmake variable without giving it a value, similar to how the C preprocessor can define variables and check if the variable is defined. It seems that I have to use -D variable\_n…

---

## [Can't cross-compile for Windows since CMake \> 3.17.2](https://discourse.cmake.org/t/cant-cross-compile-for-windows-since-cmake-3-17-2/2247)

<div class="topic-metadata">

**Author:** [@Horyu](https://discourse.cmake.org/u/Horyu)\
**Replies:** 3\
**Last updated:** [December 1, 2020, 12:59pm UTC](https://discourse.cmake.org/t/cant-cross-compile-for-windows-since-cmake-3-17-2/2247 "2020-12-01T12:59:41Z")

</div>

Hi, I’m using vcpkg to cross-compile libraries for Windows, I use the llvm 9 + clang-cl 9 toolchains and since the new update of vcpkg that brought cmake to 3.18.4 I can’t cross-compile anymore, it seems the linker sear…

---

## [execute\_process only run once](https://discourse.cmake.org/t/execute-process-only-run-once/2273)

<div class="topic-metadata">

**Author:** [@dalianduzhi](https://discourse.cmake.org/u/dalianduzhi)\
**Replies:** 5\
**Last updated:** [December 1, 2020, 11:16am UTC](https://discourse.cmake.org/t/execute-process-only-run-once/2273 "2020-12-01T11:16:22Z")

</div>

In CMakeLists.txt, execute\_process only run once while run the CMakeLists.txt at first time? If config is done and run the CMakeLists.txt, the execute\_process command will not be run?

---

## [Post-configuration task](https://discourse.cmake.org/t/post-configuration-task/1949)

<div class="topic-metadata">

**Author:** [@tom](https://discourse.cmake.org/u/tom)\
**Replies:** 4\
**Last updated:** [November 30, 2020, 4:03pm UTC](https://discourse.cmake.org/t/post-configuration-task/1949 "2020-11-30T16:03:09Z")

</div>

Hi all, I’m sure this has been asked before, but I couldn’t find any existing threads. I’m developing a C++ platform that our clients regularly compile for themselves. They often compile multiple different configurati…

---

## [Cannot sign up for reporting a cmake bug](https://discourse.cmake.org/t/cannot-sign-up-for-reporting-a-cmake-bug/2263)

<div class="topic-metadata">

**Author:** [@bradbell](https://discourse.cmake.org/u/bradbell)\
**Replies:** 4\
**Last updated:** [November 30, 2020, 2:10pm UTC](https://discourse.cmake.org/t/cannot-sign-up-for-reporting-a-cmake-bug/2263 "2020-11-30T14:10:52Z")

</div>

I tried to register on https://gitlab.kitware.com/users/sign\_in but I never got a confirmation e-mail. Now when I try to register, it says my username is already taken. When I try to log on it says I need to confirm m…

---

## [Problematic absolute paths in cmake file created by INSTALL(EXPORT)](https://discourse.cmake.org/t/problematic-absolute-paths-in-cmake-file-created-by-install-export/2246)

<div class="topic-metadata">

**Author:** [@Holger](https://discourse.cmake.org/u/Holger)\
**Replies:** 3\
**Last updated:** [November 30, 2020, 1:51pm UTC](https://discourse.cmake.org/t/problematic-absolute-paths-in-cmake-file-created-by-install-export/2246 "2020-11-30T13:51:35Z")

</div>

Hi, I am building the NetworkManagerQt package inside a Yocto project. NetworkMangagerQt creates a file called KF5NetworkManagerQtTargets.cmake using the following command inside a CMakeLists.txt file: install(EXPORT…

---

## [Do not let add\_compile\_definitions to change my define](https://discourse.cmake.org/t/do-not-let-add-compile-definitions-to-change-my-define/2252)

<div class="topic-metadata">

**Author:** [@dalianduzhi](https://discourse.cmake.org/u/dalianduzhi)\
**Replies:** 7\
**Last updated:** [November 30, 2020, 1:43pm UTC](https://discourse.cmake.org/t/do-not-let-add-compile-definitions-to-change-my-define/2252 "2020-11-30T13:43:02Z")

</div>

In MSYS2 on windows10, I want to add the following define to the ArmCC compiler via add\_compile\_definitions -D\_\_TIME\_\_="“NO\_TIME”" But no matter how I write,I can not get the what I wanted. How can I get this define?

---

## [Disable compiler checks](https://discourse.cmake.org/t/disable-compiler-checks/735)

<div class="topic-metadata">

**Author:** [@satrapes](https://discourse.cmake.org/u/satrapes)\
**Replies:** 19\
**Last updated:** [November 27, 2020, 9:13pm UTC](https://discourse.cmake.org/t/disable-compiler-checks/735 "2020-11-27T21:13:58Z")

</div>

Hello, When running cmake it will try to find a suitable compiler and try to see if it can program a simple program with it. Can someone verify that if you specify a variable from the command line that this will not b…

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

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