# Usage

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

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

**Page:** 95

---

## [CMake Error at /.../cmake-3.16/Modules/FilePackageHandleStandarArgs.cmake:146 (message):](https://discourse.cmake.org/t/cmake-error-at-cmake-3-16-modules-filepackagehandlestandarargs-cmake-146-message/995)

<div class="topic-metadata">

**Author:** [@charityAMG](https://discourse.cmake.org/u/charityAMG)\
**Replies:** 3\
**Last updated:** [April 13, 2020, 1:19pm UTC](https://discourse.cmake.org/t/cmake-error-at-cmake-3-16-modules-filepackagehandlestandarargs-cmake-146-message/995 "2020-04-13T13:19:29Z")

</div>

I have a tinycore linux OS, and I want to build webkitgkt+ from source code. I install cmake.tcz( an extension of tinycoreOS). I have error (mentioned in title): could not find Perl (missing: PERL\_EXECUTABLE) (Require a…

---

## [Does target\_compile\_definition assign a value to the item?](https://discourse.cmake.org/t/does-target-compile-definition-assign-a-value-to-the-item/987)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 2\
**Last updated:** [April 12, 2020, 5:18am UTC](https://discourse.cmake.org/t/does-target-compile-definition-assign-a-value-to-the-item/987 "2020-04-12T05:18:04Z")

</div>

For example is there any difference between the two commands? target\_compile\_definitions(target\_foo PRIVATE FOO) And explicitly stating target\_compile\_definitions(target\_foo PRIVATE FOO=1) I’m asking because it matte…

---

## [Incremental build bug? Changing project option default isn't registering on incremental builds.](https://discourse.cmake.org/t/incremental-build-bug-changing-project-option-default-isnt-registering-on-incremental-builds/695)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 21\
**Last updated:** [April 12, 2020, 5:07am UTC](https://discourse.cmake.org/t/incremental-build-bug-changing-project-option-default-isnt-registering-on-incremental-builds/695 "2020-04-12T05:07:59Z")

</div>

Here is a link to a public repository to show the problem: The instructions are in the readme.md but I’ll repeat them here: cmake\_default\_option\_issue By default cmake options do not support incremental builds. If a…

---

## [Intel Coverage documentation](https://discourse.cmake.org/t/intel-coverage-documentation/979)

<div class="topic-metadata">

**Author:** [@Anthony\_Zukaitis](https://discourse.cmake.org/u/Anthony_Zukaitis)\
**Replies:** 0\
**Last updated:** [April 10, 2020, 10:45pm UTC](https://discourse.cmake.org/t/intel-coverage-documentation/979 "2020-04-10T22:45:24Z")

</div>

Is there any documentation on how to use the Intel Coverage tool capability via linux and CTest/CDash. I saw a pull request from about 6 years ago but that’s it. I’m interfacing thru the CTestConfiguration.ini/DartConf…

---

## [\--parallel does not really enable parallel compiles with msbuild?](https://discourse.cmake.org/t/parallel-does-not-really-enable-parallel-compiles-with-msbuild/964)

<div class="topic-metadata">

**Author:** [@Rich\_von\_Lehe](https://discourse.cmake.org/u/Rich_von_Lehe)\
**Replies:** 11\
**Last updated:** [April 10, 2020, 3:18pm UTC](https://discourse.cmake.org/t/parallel-does-not-really-enable-parallel-compiles-with-msbuild/964 "2020-04-10T15:18:47Z")

</div>

Somebody warned me against using (or trusting) the --parallel option on the command line recently saying that it always sets cl\_mpcount to 1 when using msbuild. I tried and sure enough this is true. After reading what …

---

## [Target with multiple interfaces](https://discourse.cmake.org/t/target-with-multiple-interfaces/957)

<div class="topic-metadata">

**Author:** [@rpoisel](https://discourse.cmake.org/u/rpoisel)\
**Replies:** 1\
**Last updated:** [April 9, 2020, 7:23pm UTC](https://discourse.cmake.org/t/target-with-multiple-interfaces/957 "2020-04-09T19:23:15Z")

</div>

I want to implement a CMake-based build system for the following architecture: As you can see: the Model component has two interfaces: ModelRead and ModelEdit. What is the preferred way to implement this architecture…

---

## [exporting target sources?](https://discourse.cmake.org/t/exporting-target-sources/948)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 2\
**Last updated:** [April 7, 2020, 11:08am UTC](https://discourse.cmake.org/t/exporting-target-sources/948 "2020-04-07T11:08:35Z")

</div>

This is for custom build systems. I have sources that I need to prepare from one build system to another for reuse. Unfortunately, products from builds are incompatible to each other, meaning that each needs to build …

---

## [How to easily add CMake files to be visibile in IDE generators (Visual Studio)?](https://discourse.cmake.org/t/how-to-easily-add-cmake-files-to-be-visibile-in-ide-generators-visual-studio/937)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 4\
**Last updated:** [April 7, 2020, 10:56am UTC](https://discourse.cmake.org/t/how-to-easily-add-cmake-files-to-be-visibile-in-ide-generators-visual-studio/937 "2020-04-07T10:56:51Z")

</div>

Throughout my code base I have this re-ocurring pattern to provide friendly Visual Studio Support. target\_sources(foo PRIVATE # Add CMakeLists.txt so it shows up in Visual Studio generated projects CMakeLists.t…

---

## [Getting CMake to detect a new CXX Compiler (CXX\_COMPILER\_ID) without modying CMake's source](https://discourse.cmake.org/t/getting-cmake-to-detect-a-new-cxx-compiler-cxx-compiler-id-without-modying-cmakes-source/916)

<div class="topic-metadata">

**Author:** [@seanbaxter](https://discourse.cmake.org/u/seanbaxter)\
**Replies:** 3\
**Last updated:** [April 3, 2020, 3:02pm UTC](https://discourse.cmake.org/t/getting-cmake-to-detect-a-new-cxx-compiler-cxx-compiler-id-without-modying-cmakes-source/916 "2020-04-03T15:02:06Z")

</div>

I wrote a new C++ compiler and am trying to get it to work with CMake. Setting CMAKE\_CXX\_COMPILER to my compiler’s path is fine: the right compiler gets invoked. The problem is CMakeDetermineCompilerId always detects my…

---

## [Build files not written to current directory](https://discourse.cmake.org/t/build-files-not-written-to-current-directory/925)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 1\
**Last updated:** [April 2, 2020, 2:27pm UTC](https://discourse.cmake.org/t/build-files-not-written-to-current-directory/925 "2020-04-02T14:27:08Z")

</div>

I have: sdk/CMakeLists.txt and I invoke: cd sdk/myBuild cmake -G “Unix Makefiles” -DISA\_AVX512=1 -DCMAKE\_BUILD\_TYPE=Release -DCMAKE\_TOOLCHAIN\_FILE=/opt/flexran/y/sdk/cmake/toolchain-intel-linux.cmake … (there are t…

---

## [Building C++20 Modules](https://discourse.cmake.org/t/building-c-20-modules/898)

<div class="topic-metadata">

**Author:** [@amaclean](https://discourse.cmake.org/u/amaclean)\
**Replies:** 2\
**Last updated:** [April 2, 2020, 10:25am UTC](https://discourse.cmake.org/t/building-c-20-modules/898 "2020-04-02T10:25:40Z")

</div>

Is there a general way to tell the linker that .mpp is a CXX extension? I downloaded cxx-modules-sandbox and I was able to successfully build it by code like this after ever add\_library: set\_target\_properties(simple P…

---

## [Some trouble in configuring cmake when using the libigl](https://discourse.cmake.org/t/some-trouble-in-configuring-cmake-when-using-the-libigl/715)

<div class="topic-metadata">

**Author:** [@Mushroom-turtle](https://discourse.cmake.org/u/Mushroom-turtle)\
**Replies:** 3\
**Last updated:** [April 2, 2020, 10:24am UTC](https://discourse.cmake.org/t/some-trouble-in-configuring-cmake-when-using-the-libigl/715 "2020-04-02T10:24:29Z")

</div>

During the process of cmake configuration, there’s an error stating “error in configuration process, project files may be invalid”. It would be deeply appreciated if anyone can help me out.

---

## [Installing a symlink with a relative path for RPM](https://discourse.cmake.org/t/installing-a-symlink-with-a-relative-path-for-rpm/895)

<div class="topic-metadata">

**Author:** [@atn34](https://discourse.cmake.org/u/atn34)\
**Replies:** 5\
**Last updated:** [April 1, 2020, 5:55pm UTC](https://discourse.cmake.org/t/installing-a-symlink-with-a-relative-path-for-rpm/895 "2020-04-01T17:55:57Z")

</div>

$ cat CMakeLists.txt cmake\_minimum\_required(VERSION 3.14) set(CPACK\_PACKAGING\_INSTALL\_PREFIX "/") execute\_process(COMMAND ${CMAKE\_COMMAND} -E touch ${CMAKE\_BINARY\_DIR}/foo) install(FILES ${CMAKE\_BINARY\_DIR}/foo DESTINATI…

---

## [cmake problems with MSBuild.exe](https://discourse.cmake.org/t/cmake-problems-with-msbuild-exe/875)

<div class="topic-metadata">

**Author:** [@userJB](https://discourse.cmake.org/u/userJB)\
**Replies:** 15\
**Last updated:** [March 31, 2020, 7:46pm UTC](https://discourse.cmake.org/t/cmake-problems-with-msbuild-exe/875 "2020-03-31T19:46:39Z")

</div>

have problems with cmake on Windows 10. I pruned things to the smallest example that will generate the same errors. I run cmake from the Windows command prompt (the same problem occurs with the git bash command-line inte…

---

## [empty output on build command](https://discourse.cmake.org/t/empty-output-on-build-command/859)

<div class="topic-metadata">

**Author:** [@amigo421](https://discourse.cmake.org/u/amigo421)\
**Replies:** 2\
**Last updated:** [March 31, 2020, 10:24am UTC](https://discourse.cmake.org/t/empty-output-on-build-command/859 "2020-03-31T10:24:29Z")

</div>

platform: Win10 cmake: 3.17 compiler: msvc2019 generator : NMake Makefiles - CodeBlocks sources: simple main.c with printf Hello World (no third-pathy libraries) I inserted one simple typo to make the source wrong -…

---

## [How to make a visual studio solution with x64/x86 support?](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 8\
**Last updated:** [March 29, 2020, 7:35pm UTC](https://discourse.cmake.org/t/how-to-make-a-visual-studio-solution-with-x64-x86-support/880 "2020-03-29T19:35:34Z")

</div>

Just like the question says I want to create a visual studio solution that supports both x64/x86. Is this possible? Also is it possible to make a singular visual studio solution that supports 2 toolchains?

---

## [arm-none-eabi-gcc won't pass compiler tests](https://discourse.cmake.org/t/arm-none-eabi-gcc-wont-pass-compiler-tests/801)

<div class="topic-metadata">

**Author:** [@Acsor](https://discourse.cmake.org/u/Acsor)\
**Replies:** 3\
**Last updated:** [March 24, 2020, 11:53am UTC](https://discourse.cmake.org/t/arm-none-eabi-gcc-wont-pass-compiler-tests/801 "2020-03-24T11:53:54Z")

</div>

I’m running an arm-none-eabi-gcc cross-compiler, version 5.4.1 20160919, on two different systems and, on setting up my CMake configuration, the compiler checks fail. The workaround I’m currently resorting to is manuall…

---

## [Make generator: Enter and Leave directory message](https://discourse.cmake.org/t/make-generator-enter-and-leave-directory-message/676)

<div class="topic-metadata">

**Author:** [@Charles\_Gueunet](https://discourse.cmake.org/u/Charles_Gueunet)\
**Replies:** 7\
**Last updated:** [March 21, 2020, 9:38pm UTC](https://discourse.cmake.org/t/make-generator-enter-and-leave-directory-message/676 "2020-03-21T21:38:10Z")

</div>

Hello, Using the current CMake master on linux, I have noticed a lot of make\[2\]: Entering directory '...' make\[2\]: Leaving directory '...' in the make output. These message are usual when using make but where hidden b…

---

## [bind projects](https://discourse.cmake.org/t/bind-projects/820)

<div class="topic-metadata">

**Author:** [@Tomasz](https://discourse.cmake.org/u/Tomasz)\
**Replies:** 0\
**Last updated:** [March 18, 2020, 8:11pm UTC](https://discourse.cmake.org/t/bind-projects/820 "2020-03-18T20:11:32Z")

</div>

Hi I have few projects which are dependent to each other, in this sense that, next project, require and using packages that was builded and installed before. What are the best way to do that in cmake. I really need Yo…

---

## [Problem in Setting up QT to Integrate with OpenCV and C++ in Ubuntu 18.04 using CMake](https://discourse.cmake.org/t/problem-in-setting-up-qt-to-integrate-with-opencv-and-c-in-ubuntu-18-04-using-cmake/786)

<div class="topic-metadata">

**Author:** [@raisa](https://discourse.cmake.org/u/raisa)\
**Replies:** 4\
**Last updated:** [March 18, 2020, 1:29am UTC](https://discourse.cmake.org/t/problem-in-setting-up-qt-to-integrate-with-opencv-and-c-in-ubuntu-18-04-using-cmake/786 "2020-03-18T01:29:06Z")

</div>

Greetings ! It’s my first post in this forum. I’ve been following an OpenCV tutorial from a book. Prior to it, I have OpenCV already installed on my machine. I’m working with OpenCV & C++ on terminal Ubuntu and compile …

---

## [try\_compile with /WX or -Werror](https://discourse.cmake.org/t/try-compile-with-wx-or-werror/811)

<div class="topic-metadata">

**Author:** [@jpboivin](https://discourse.cmake.org/u/jpboivin)\
**Replies:** 1\
**Last updated:** [March 17, 2020, 7:18pm UTC](https://discourse.cmake.org/t/try-compile-with-wx-or-werror/811 "2020-03-17T19:18:54Z")

</div>

Hello, When defining global CMAKE\_C\_FLAGS/CMAKE\_CXX\_FLAGS variables for a platform, most of the time we’ll set /WX and -Werror, but also enable extra warnings (or MSVC also has some undocumented ones for C++/CX). I just…

---

## [CMake Qt5Gui build error](https://discourse.cmake.org/t/cmake-qt5gui-build-error/599)

<div class="topic-metadata">

**Author:** [@Kulagin](https://discourse.cmake.org/u/Kulagin)\
**Replies:** 1\
**Last updated:** [March 17, 2020, 7:09pm UTC](https://discourse.cmake.org/t/cmake-qt5gui-build-error/599 "2020-03-17T19:09:52Z")

</div>

I am following this quick start guide on the opentrack project and I get an error when I try to build it: Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.16299. The C compiler identification is MSVC 19…

---

## [execute\_command and arguments that contain with blank spaces](https://discourse.cmake.org/t/execute-command-and-arguments-that-contain-with-blank-spaces/807)

<div class="topic-metadata">

**Author:** [@sdettmer](https://discourse.cmake.org/u/sdettmer)\
**Replies:** 2\
**Last updated:** [March 17, 2020, 10:24am UTC](https://discourse.cmake.org/t/execute-command-and-arguments-that-contain-with-blank-spaces/807 "2020-03-17T10:24:33Z")

</div>

Hi, I tried two hours to pass an argument with a space to execute\_process, but I didn’t find out how to do it. Cmake performs some magic quoting (“VERBATIM”). I tried using variables, various escaping, but I could not g…

---

## [cmake, ccache, CCACHE\_BASEDIR: wrong paths in compiler error messages](https://discourse.cmake.org/t/cmake-ccache-ccache-basedir-wrong-paths-in-compiler-error-messages/748)

<div class="topic-metadata">

**Author:** [@sdettmer](https://discourse.cmake.org/u/sdettmer)\
**Replies:** 5\
**Last updated:** [March 16, 2020, 6:43pm UTC](https://discourse.cmake.org/t/cmake-ccache-ccache-basedir-wrong-paths-in-compiler-error-messages/748 "2020-03-16T18:43:16Z")

</div>

Hi, Please let me summarize what we have here. We have projects with some hunderds CMakeLists.txt. The “main” one typically use several add\_subdirectory directives for the use libraries in form of: add\_subdirectory($…

---

## [Add extra files to CPack without "install()"-ing them](https://discourse.cmake.org/t/add-extra-files-to-cpack-without-install-ing-them/800)

<div class="topic-metadata">

**Author:** [@Mathsoum](https://discourse.cmake.org/u/Mathsoum)\
**Replies:** 3\
**Last updated:** [March 13, 2020, 1:01pm UTC](https://discourse.cmake.org/t/add-extra-files-to-cpack-without-install-ing-them/800 "2020-03-13T13:01:29Z")

</div>

Hi everyone, I’m building a multi-platform library and I have the cmake && build && install process working everywhere I need it to be working. What I try to do now is create a NSIS packages with CPack for Windows and …

---

## [cmake: error while loading shared libraries: libcom\_err.so.3](https://discourse.cmake.org/t/cmake-error-while-loading-shared-libraries-libcom-err-so-3/795)

<div class="topic-metadata">

**Author:** [@Yadav\_Rashmitha](https://discourse.cmake.org/u/Yadav_Rashmitha)\
**Replies:** 1\
**Last updated:** [March 13, 2020, 12:59pm UTC](https://discourse.cmake.org/t/cmake-error-while-loading-shared-libraries-libcom-err-so-3/795 "2020-03-13T12:59:07Z")

</div>

Hi all, I am getting cmake error when executing cmake --version. I have attached the screenshot of the the error message. I request you let me know the fix for this error. Thanks & Regards, Rashmitha

---

## [find\_package(PNG) failing to find i386 libs when crosscompiling on x86-64 host?](https://discourse.cmake.org/t/find-package-png-failing-to-find-i386-libs-when-crosscompiling-on-x86-64-host/783)

<div class="topic-metadata">

**Author:** [@steven-johnson](https://discourse.cmake.org/u/steven-johnson)\
**Replies:** 6\
**Last updated:** [March 13, 2020, 3:54am UTC](https://discourse.cmake.org/t/find-package-png-failing-to-find-i386-libs-when-crosscompiling-on-x86-64-host/783 "2020-03-13T03:54:55Z")

</div>

The situation: my host system is an x86-64 linux system (running ubuntu 18). I’m trying to cross-compile (and test) for x86-32 on this system. Most of what I need to do seems straightforward, and has worked fine for a l…

---

## [Unnecessary recompilation of out of tree sources](https://discourse.cmake.org/t/unnecessary-recompilation-of-out-of-tree-sources/733)

<div class="topic-metadata">

**Author:** [@Zenn](https://discourse.cmake.org/u/Zenn)\
**Replies:** 8\
**Last updated:** [March 10, 2020, 5:00pm UTC](https://discourse.cmake.org/t/unnecessary-recompilation-of-out-of-tree-sources/733 "2020-03-10T17:00:00Z")

</div>

Hi, I have multiple projects, where each project needs some common files. Before, those files have been in each project separately. After changing these files to a common location outside of each project, ninja keeps r…

---

## [How to add Linker Script for GHS Multi Generator](https://discourse.cmake.org/t/how-to-add-linker-script-for-ghs-multi-generator/770)

<div class="topic-metadata">

**Author:** [@Qichen\_Huang](https://discourse.cmake.org/u/Qichen_Huang)\
**Replies:** 8\
**Last updated:** [March 8, 2020, 8:41pm UTC](https://discourse.cmake.org/t/how-to-add-linker-script-for-ghs-multi-generator/770 "2020-03-08T20:41:29Z")

</div>

When I use Makefile generator, there is no problem to add the linker script as a link option like this: add\_link\_options ( ${PROJECT\_LINK\_FLAGS} ${LD\_MAP} ${LINKER\_SCRIPT} ) However, it doesn’t work for GHS…

---

## [cmake installation error of file & directory not found](https://discourse.cmake.org/t/cmake-installation-error-of-file-directory-not-found/746)

<div class="topic-metadata">

**Author:** [@nachiket\_acharya](https://discourse.cmake.org/u/nachiket_acharya)\
**Replies:** 5\
**Last updated:** [March 4, 2020, 1:49pm UTC](https://discourse.cmake.org/t/cmake-installation-error-of-file-directory-not-found/746 "2020-03-04T13:49:47Z")

</div>

I get the following error after running the command: ./bootstrap && make && sudo make install CMake Error at Modules/CMakeTestCCompiler.cmake:60 (message): The C compiler "/usr/bin/gcc" is not able to compile a simp…

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

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