# Usage

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

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

**Page:** 89

---

## [Visual Studio Compile errors](https://discourse.cmake.org/t/visual-studio-compile-errors/2178)

<div class="topic-metadata">

**Author:** [@magicianyuan](https://discourse.cmake.org/u/magicianyuan)\
**Replies:** 2\
**Last updated:** [November 16, 2020, 1:57am UTC](https://discourse.cmake.org/t/visual-studio-compile-errors/2178 "2020-11-16T01:57:10Z")

</div>

There is an error happened while compiling my codes with CMAKE.By the way, i was working on windows system. The detail information is “Check for working CXX compiler: D:/mingw/bin/c++.exe --broken” This error has nev…

---

## [MAP\_IMPORTED\_CONFIG\_RELWITHDEBINFO in ExternalProject\_Add](https://discourse.cmake.org/t/map-imported-config-relwithdebinfo-in-externalproject-add/1785)

<div class="topic-metadata">

**Author:** [@dzenanz](https://discourse.cmake.org/u/dzenanz)\
**Replies:** 1\
**Last updated:** [November 15, 2020, 2:49pm UTC](https://discourse.cmake.org/t/map-imported-config-relwithdebinfo-in-externalproject-add/1785 "2020-11-15T14:49:40Z")

</div>

OpenCV only defines two configurations, Debug and Release. Trying to build a dependent project in RelWithDebInfo causes a link error on MSVC. A solution to that is to set MAP\_IMPORTED\_CONFIG\_RELWITHDEBINFO to RELEASE. H…

---

## [CMake not generating CMakeFiles/Makefile.cmake](https://discourse.cmake.org/t/cmake-not-generating-cmakefiles-makefile-cmake/1758)

<div class="topic-metadata">

**Author:** [@dwnylen](https://discourse.cmake.org/u/dwnylen)\
**Replies:** 1\
**Last updated:** [November 15, 2020, 2:35pm UTC](https://discourse.cmake.org/t/cmake-not-generating-cmakefiles-makefile-cmake/1758 "2020-11-15T14:35:00Z")

</div>

I’m using CMake (3.18.2) with CLion under Linux, and I’m hitting a weird problem with generating unix makefiles in my project. Specifically, CLion expects there to be a CMakeFiles/Makefile.cmake file that it uses for dep…

---

## [CMAKE\_CFG\_INTDIR and file(INSTALL)](https://discourse.cmake.org/t/cmake-cfg-intdir-and-file-install/2169)

<div class="topic-metadata">

**Author:** [@starseeker](https://discourse.cmake.org/u/starseeker)\
**Replies:** 1\
**Last updated:** [November 13, 2020, 2:24pm UTC](https://discourse.cmake.org/t/cmake-cfg-intdir-and-file-install/2169 "2020-11-13T14:24:06Z")

</div>

When attempting to use an install line of the following form with the NSIS package generator: add\_custom\_command( OUTPUT ${CMAKE\_BINARY\_DIR}/${CMAKE\_CFG\_INTDIR}/outfile COMMAND gen\_file ${CMAKE\_BINARY\_DIR}/$…

---

## [Installing Qt libraries on Linux](https://discourse.cmake.org/t/installing-qt-libraries-on-linux/1524)

<div class="topic-metadata">

**Author:** [@EosPengwern](https://discourse.cmake.org/u/EosPengwern)\
**Replies:** 9\
**Last updated:** [November 12, 2020, 9:55pm UTC](https://discourse.cmake.org/t/installing-qt-libraries-on-linux/1524 "2020-11-12T21:55:33Z")

</div>

Is there a way of using install(TARGETS… to install the Qt libraries, together with their namelinks, on Linux? I’d expect the following to work, but it does not, and I don’t understand why: # First locate the Qt instal…

---

## [\[Visual Studio\] Remote debugging](https://discourse.cmake.org/t/visual-studio-remote-debugging/1678)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 2\
**Last updated:** [November 12, 2020, 1:23pm UTC](https://discourse.cmake.org/t/visual-studio-remote-debugging/1678 "2020-11-12T13:23:58Z")

</div>

Is it possible to modify the visual studio remote debugging options with cmake?

---

## [Build fails with Fortran modules nammed with macros](https://discourse.cmake.org/t/build-fails-with-fortran-modules-nammed-with-macros/1595)

<div class="topic-metadata">

**Author:** [@sgilbertjob](https://discourse.cmake.org/u/sgilbertjob)\
**Replies:** 6\
**Last updated:** [November 12, 2020, 1:13pm UTC](https://discourse.cmake.org/t/build-fails-with-fortran-modules-nammed-with-macros/1595 "2020-11-12T13:13:05Z")

</div>

Hello, I am working on a Fortran project that simulates generic programming (or C++ type templates) with include files and macros. We have decided to replace our home-brew build system with CMake and, up to now, things…

---

## [Central logging of all source and project-based try\_compile calls into a file](https://discourse.cmake.org/t/central-logging-of-all-source-and-project-based-try-compile-calls-into-a-file/1720)

<div class="topic-metadata">

**Author:** [@alcroito](https://discourse.cmake.org/u/alcroito)\
**Replies:** 2\
**Last updated:** [November 12, 2020, 9:03am UTC](https://discourse.cmake.org/t/central-logging-of-all-source-and-project-based-try-compile-calls-into-a-file/1720 "2020-11-12T09:03:17Z")

</div>

Hi, Is it possible to somehow redirect the configuration of all try\_compile calls (source and project based) to stdout or to a file, and also the full verbose build commands used? CMakeFiles/CMakeOutput.log and CMakeFi…

---

## [Choice of generator for CPack](https://discourse.cmake.org/t/choice-of-generator-for-cpack/1674)

<div class="topic-metadata">

**Author:** [@EosPengwern](https://discourse.cmake.org/u/EosPengwern)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 9:10pm UTC](https://discourse.cmake.org/t/choice-of-generator-for-cpack/1674 "2020-11-11T21:10:18Z")

</div>

I’d like to package an application on Windows and Linux, which is currently built and installed (on the build machine) using CMake. For the installation on the target machine to work correctly on Windows, there are seve…

---

## [After install, cmd says 'cmake' is not yet installed and can be installed with apt-get](https://discourse.cmake.org/t/after-install-cmd-says-cmake-is-not-yet-installed-and-can-be-installed-with-apt-get/1671)

<div class="topic-metadata">

**Author:** [@PedroRTomas](https://discourse.cmake.org/u/PedroRTomas)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 9:05pm UTC](https://discourse.cmake.org/t/after-install-cmd-says-cmake-is-not-yet-installed-and-can-be-installed-with-apt-get/1671 "2020-11-11T21:05:52Z")

</div>

Hello, I might be doing some confusion, but after: sudo ./bootstrap --prefix=/usr/bin && sudo make && sudo make install inside of cmake-3.16.8 folder, when I type ‘cmake’ in cmd, why do I get: The program ‘cmake’ is …

---

## [Setting environment variables when using CPACK](https://discourse.cmake.org/t/setting-environment-variables-when-using-cpack/1660)

<div class="topic-metadata">

**Author:** [@EosPengwern](https://discourse.cmake.org/u/EosPengwern)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 9:04pm UTC](https://discourse.cmake.org/t/setting-environment-variables-when-using-cpack/1660 "2020-11-11T21:04:10Z")

</div>

I’m trying to work out how I can build an installation package using CPack that will set environment variables and system paths (not only the main system path, but paths to plugins etc.) when the installation takes place…

---

## [CMake transitive dependency linked by name only](https://discourse.cmake.org/t/cmake-transitive-dependency-linked-by-name-only/1635)

<div class="topic-metadata">

**Author:** [@jakecobb](https://discourse.cmake.org/u/jakecobb)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 8:56pm UTC](https://discourse.cmake.org/t/cmake-transitive-dependency-linked-by-name-only/1635 "2020-11-11T20:56:06Z")

</div>

I did ask this on StackOverflow already without much luck, so apologies for the redundancy if you’ve already seen this. It seems that dylibs linked directly in target\_link\_libraries get linked by absolute path, but thos…

---

## [How to properly use TEST\_XML\_OUTPUT\_DIR?](https://discourse.cmake.org/t/how-to-properly-use-test-xml-output-dir/1630)

<div class="topic-metadata">

**Author:** [@mojca](https://discourse.cmake.org/u/mojca)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 8:52pm UTC](https://discourse.cmake.org/t/how-to-properly-use-test-xml-output-dir/1630 "2020-11-11T20:52:03Z")

</div>

I’m writing a CI script for an existing repository. I would like to simply run all the gtest-based unit tests with ctest (in parallel, if possible) and store the summary into one or more xml files, so that the CI system…

---

## [Cmake GUI 'Permission denied' errors, while building caffe.](https://discourse.cmake.org/t/cmake-gui-permission-denied-errors-while-building-caffe/1610)

<div class="topic-metadata">

**Author:** [@Katya](https://discourse.cmake.org/u/Katya)\
**Replies:** 2\
**Last updated:** [November 11, 2020, 5:33pm UTC](https://discourse.cmake.org/t/cmake-gui-permission-denied-errors-while-building-caffe/1610 "2020-11-11T17:33:24Z")

</div>

Hello could you please help with my errors? I have been at this for days trying to install caffe, first via make, now via cmake gui. I do not understand what is the matter with permissions: I have gone to the files about…

---

## [Environmental Variables not setting during SSH session](https://discourse.cmake.org/t/environmental-variables-not-setting-during-ssh-session/1605)

<div class="topic-metadata">

**Author:** [@jwinarske](https://discourse.cmake.org/u/jwinarske)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 5:30pm UTC](https://discourse.cmake.org/t/environmental-variables-not-setting-during-ssh-session/1605 "2020-11-11T17:30:57Z")

</div>

When setting environmental variable in Toolchain file, I see it set when locally logged into build machine. When I run the same thing during a SSH session, it doesn’t set. Is this by design? Example here: https://git…

---

## [Visual Studio Filter Issues "Cmake Rules"](https://discourse.cmake.org/t/visual-studio-filter-issues-cmake-rules/1566)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 3\
**Last updated:** [November 11, 2020, 5:26pm UTC](https://discourse.cmake.org/t/visual-studio-filter-issues-cmake-rules/1566 "2020-11-11T17:26:06Z")

</div>

Why is this filter CMake Rules being created when I create a Visual Studio project? I don’t know what is causing it. Any ideas would be appreciated.

---

## [How to get CMAKE\_NO\_SYSTEM\_FROM\_IMPORTED alike for a selected few of targets?](https://discourse.cmake.org/t/how-to-get-cmake-no-system-from-imported-alike-for-a-selected-few-of-targets/1515)

<div class="topic-metadata">

**Author:** [@Tobias\_Rittweiler](https://discourse.cmake.org/u/Tobias_Rittweiler)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 3:18pm UTC](https://discourse.cmake.org/t/how-to-get-cmake-no-system-from-imported-alike-for-a-selected-few-of-targets/1515 "2020-11-11T15:18:22Z")

</div>

Hi! In our project, we have true third-party dependencies (e.g. Boost, QT, googletest) and we have dependencies from other teams. We use find\_package() and target\_link\_libraries() for both kind of dependencies. While w…

---

## [Disable disector in wireshark](https://discourse.cmake.org/t/disable-disector-in-wireshark/1513)

<div class="topic-metadata">

**Author:** [@bnousilal](https://discourse.cmake.org/u/bnousilal)\
**Replies:** 5\
**Last updated:** [November 11, 2020, 3:15pm UTC](https://discourse.cmake.org/t/disable-disector-in-wireshark/1513 "2020-11-11T15:15:52Z")

</div>

Hi All, I am a newbie to cmake, please help me on the below queries. I have cross-compiled Wireshark 3.2.4 to generate the tsahrk binary and able to run it on the embedded platform. The issue is “libwireshark.so.13” s…

---

## [CMake tool discovery fails with custom compiler](https://discourse.cmake.org/t/cmake-tool-discovery-fails-with-custom-compiler/1508)

<div class="topic-metadata">

**Author:** [@schrc3b6](https://discourse.cmake.org/u/schrc3b6)\
**Replies:** 9\
**Last updated:** [November 11, 2020, 3:14pm UTC](https://discourse.cmake.org/t/cmake-tool-discovery-fails-with-custom-compiler/1508 "2020-11-11T15:14:25Z")

</div>

Hi, I’m trying to build my project with the scorep compiler wrapper for Instrumentation. However when calling cmake and setting the compiler via command line (as is described in their docu) the build fails. (http://s…

---

## [How to depend flags.make in the add\_custom\_command](https://discourse.cmake.org/t/how-to-depend-flags-make-in-the-add-custom-command/1488)

<div class="topic-metadata">

**Author:** [@lxy9527](https://discourse.cmake.org/u/lxy9527)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 3:03pm UTC](https://discourse.cmake.org/t/how-to-depend-flags-make-in-the-add-custom-command/1488 "2020-11-11T15:03:14Z")

</div>

as the title , I need use add\_custom\_command attach a output file to my target , and this output file need depend my\_target/flags.make, how can we get this direcotry ? Is there any macro?

---

## [Cross compilation help](https://discourse.cmake.org/t/cross-compilation-help/1486)

<div class="topic-metadata">

**Author:** [@Arcnor](https://discourse.cmake.org/u/Arcnor)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 3:02pm UTC](https://discourse.cmake.org/t/cross-compilation-help/1486 "2020-11-11T15:02:30Z")

</div>

Hi, I’m trying to use CMake to generate a project for cross compiling for another system (gaming console). The SDK uses MSVC with a property sheet for settings and clang as its compiler. I’ve hacked around to make CMake…

---

## [CMake doesn't change value of all specified cache variables at once](https://discourse.cmake.org/t/cmake-doesnt-change-value-of-all-specified-cache-variables-at-once/1471)

<div class="topic-metadata">

**Author:** [@OntheRocks](https://discourse.cmake.org/u/OntheRocks)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 2:57pm UTC](https://discourse.cmake.org/t/cmake-doesnt-change-value-of-all-specified-cache-variables-at-once/1471 "2020-11-11T14:57:13Z")

</div>

I am trying to build google flatbuffers (https://github.com/google/flatbuffers) in Linux. I need to change the default values of some cache variables after generating the makefile. However to change all of them I need to…

---

## [How is the OSGANIMATION\_LIBRARY\_RELEASE option in the Cmake configuration generated?](https://discourse.cmake.org/t/how-is-the-osganimation-library-release-option-in-the-cmake-configuration-generated/1468)

<div class="topic-metadata">

**Author:** [@mirro187](https://discourse.cmake.org/u/mirro187)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 2:55pm UTC](https://discourse.cmake.org/t/how-is-the-osganimation-library-release-option-in-the-cmake-configuration-generated/1468 "2020-11-11T14:55:24Z")

</div>

It was strange,I did not set this option in findosg. cmake… CMAKE version 3.14.2

---

## [cmake --system-information ignores cross-compilation](https://discourse.cmake.org/t/cmake-system-information-ignores-cross-compilation/1444)

<div class="topic-metadata">

**Author:** [@magnus.grandin](https://discourse.cmake.org/u/magnus.grandin)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 2:51pm UTC](https://discourse.cmake.org/t/cmake-system-information-ignores-cross-compilation/1444 "2020-11-11T14:51:40Z")

</div>

I have been trying to use cmake on the command line with switch --system-information to dump system level information about a given configuration. In particular, I am interested in verifying that certain variables (e.g. …

---

## [Do I need to install IO2D library](https://discourse.cmake.org/t/do-i-need-to-install-io2d-library/1416)

<div class="topic-metadata">

**Author:** [@PaulGureghian](https://discourse.cmake.org/u/PaulGureghian)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 2:46pm UTC](https://discourse.cmake.org/t/do-i-need-to-install-io2d-library/1416 "2020-11-11T14:46:13Z")

</div>

in a specific location so CMake ‘find\_package’ can find it and / or do I need to edit a CMake \_MODULE\_PATH or CMake\_Prefix\_Path file ?

---

## [Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD - Failed](https://discourse.cmake.org/t/performing-test-cmake-have-libc-pthread-failed/1402)

<div class="topic-metadata">

**Author:** [@femifapo](https://discourse.cmake.org/u/femifapo)\
**Replies:** 1\
**Last updated:** [November 11, 2020, 2:43pm UTC](https://discourse.cmake.org/t/performing-test-cmake-have-libc-pthread-failed/1402 "2020-11-11T14:43:26Z")

</div>

Hi, I am trying to build openpose but get stuck with several errors. The first of which is a cmake error mentioned in the title while using “cmake …”. Then I also get this error "CMake Error at cuda\_compile\_1\_generated\_…

---

## [Cmake-gui not detecting top-level project?](https://discourse.cmake.org/t/cmake-gui-not-detecting-top-level-project/2142)

<div class="topic-metadata">

**Author:** [@anon45792294](https://discourse.cmake.org/u/anon45792294)\
**Replies:** 5\
**Last updated:** [November 11, 2020, 11:33am UTC](https://discourse.cmake.org/t/cmake-gui-not-detecting-top-level-project/2142 "2020-11-11T11:33:15Z")

</div>

I’m using cmake 3.19.0-rc1 and I’m currently getting strange behavior from cmake-gui. Here is the code causing the problem: cmake\_minimum\_required(VERSION 3.18) list(APPEND CMAKE\_MODULE\_PATH "${CMAKE\_CURRENT\_SOURCE\_DI…

---

## [CUDA dependency in sub project](https://discourse.cmake.org/t/cuda-dependency-in-sub-project/2144)

<div class="topic-metadata">

**Author:** [@Morteza\_Kianian](https://discourse.cmake.org/u/Morteza_Kianian)\
**Replies:** 1\
**Last updated:** [November 10, 2020, 8:09pm UTC](https://discourse.cmake.org/t/cuda-dependency-in-sub-project/2144 "2020-11-10T20:09:33Z")

</div>

I have a project which is a library that depends on a couple of other libraries (dependencies). The code and CMakeLists.txt for the dependencies are in sub-directories within a directory called depend which contains a CM…

---

## [What is difference between install, install/local and install/strip?](https://discourse.cmake.org/t/what-is-difference-between-install-install-local-and-install-strip/1329)

<div class="topic-metadata">

**Author:** [@cnruby](https://discourse.cmake.org/u/cnruby)\
**Replies:** 2\
**Last updated:** [November 10, 2020, 2:45pm UTC](https://discourse.cmake.org/t/what-is-difference-between-install-install-local-and-install-strip/1329 "2020-11-10T14:45:24Z")

</div>

I run the following command cd build && ninja help to get these targets \[1/1\] All primary targets available: install/strip: phony install/local: phony install: phony ... What is difference between install, install/lo…

---

## [cmake add\_custom\_command + Xcode: multi output = multi command invocation](https://discourse.cmake.org/t/cmake-add-custom-command-xcode-multi-output-multi-command-invocation/1303)

<div class="topic-metadata">

**Author:** [@davemilter](https://discourse.cmake.org/u/davemilter)\
**Replies:** 1\
**Last updated:** [November 10, 2020, 2:33pm UTC](https://discourse.cmake.org/t/cmake-add-custom-command-xcode-multi-output-multi-command-invocation/1303 "2020-11-10T14:33:26Z")

</div>

cross posting I have custom command that generate several headers at once. All works fine with make/ninja files generated by cmake. But if I generate Xcode project via cmake -GXCode, then instead of once gen.sh was i…

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

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