# Latest

**URL:** https://discourse.cmake.org/latest.md?page=199

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

**Page:** 200

---

## [Help with target\_precompile\_headers](https://discourse.cmake.org/t/help-with-target-precompile-headers/1065)

<div class="topic-metadata">

**Author:** [@polar](https://discourse.cmake.org/u/polar)\
**Replies:** 2\
**Last updated:** [April 20, 2020, 6:31pm UTC](https://discourse.cmake.org/t/help-with-target-precompile-headers/1065 "2020-04-20T18:31:07Z")

</div>

Problem, Windows10, vs2019: using target\_precompile\_headers(some\_target PRIVATE \_pch.h) when building a subcomponent of a static library, some.lib. The problem is that when I try to link to some.lib, I get a LNK2011: p…

---

## [Proper usage of HANDLE\_COMPONENTS in custom FindXXX.cmake Module](https://discourse.cmake.org/t/proper-usage-of-handle-components-in-custom-findxxx-cmake-module/1063)

<div class="topic-metadata">

**Author:** [@KBentley57](https://discourse.cmake.org/u/KBentley57)\
**Replies:** 0\
**Last updated:** [April 20, 2020, 2:32pm UTC](https://discourse.cmake.org/t/proper-usage-of-handle-components-in-custom-findxxx-cmake-module/1063 "2020-04-20T14:32:10Z")

</div>

I am modernizing a bit of old CMake, and in the process, am re-writing a few module files. I’m following along the documentation in the cmake-developer man page, and generally have most things sorted. What I can’t seem…

---

## [Install EXPORT for multiple build types](https://discourse.cmake.org/t/install-export-for-multiple-build-types/1023)

<div class="topic-metadata">

**Author:** [@abroekhuis](https://discourse.cmake.org/u/abroekhuis)\
**Replies:** 9\
**Last updated:** [April 20, 2020, 7:20am UTC](https://discourse.cmake.org/t/install-export-for-multiple-build-types/1023 "2020-04-20T07:20:55Z")

</div>

Hi all, I have a project for which I can do a Debug and Release build. Using a debug postfix, libraries are named differently. So I though I could do a make install in both build directories, resulting in a mixed instal…

---

## [add\_custom\_command adds nonsense "driveletter:" to step](https://discourse.cmake.org/t/add-custom-command-adds-nonsense-driveletter-to-step/1049)

<div class="topic-metadata">

**Author:** [@Xaymar](https://discourse.cmake.org/u/Xaymar)\
**Replies:** 9\
**Last updated:** [April 20, 2020, 7:12am UTC](https://discourse.cmake.org/t/add-custom-command-adds-nonsense-driveletter-to-step/1049 "2020-04-20T07:12:43Z")

</div>

CMake Version: 3.17.1 Using the WORKING\_DIRECTORY option in add\_custom\_command completely breaks the generated build step. For an unknown reason, CMake generates an extra line which is usually just “driveletter:” (C:, D…

---

## [FindPythonLibs and pypy](https://discourse.cmake.org/t/findpythonlibs-and-pypy/1050)

<div class="topic-metadata">

**Author:** [@KrisThielemans](https://discourse.cmake.org/u/KrisThielemans)\
**Replies:** 3\
**Last updated:** [April 18, 2020, 9:21am UTC](https://discourse.cmake.org/t/findpythonlibs-and-pypy/1050 "2020-04-18T09:21:18Z")

</div>

I’m somewhat out of my depth here, but trying to get a auto-generated conda PR https://github.com/conda-forge/stir-feedstock/pull/16 to work with pypy. Our CMakeLists.txt uses simply find\_package(PythonInterp) FIN…

---

## [LLVM build error](https://discourse.cmake.org/t/llvm-build-error/1048)

<div class="topic-metadata">

**Author:** [@afernandezody](https://discourse.cmake.org/u/afernandezody)\
**Replies:** 2\
**Last updated:** [April 17, 2020, 4:10pm UTC](https://discourse.cmake.org/t/llvm-build-error/1048 "2020-04-17T16:10:31Z")

</div>

Hello, I’m using cmake (3.16.5) to build the LLVM environment from source. However, the command cmake -DLLVM\_ENABLE\_PROJECTS=“clang;clang-tools-extra;libcxx;libunwind;lldb;compiler-rt;lld” -G “Unix Makefiles” -DCMAKE\_…

---

## [add\_test() has different behaviour for VS and Ninja generator](https://discourse.cmake.org/t/add-test-has-different-behaviour-for-vs-and-ninja-generator/1046)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 4\
**Last updated:** [April 17, 2020, 4:07pm UTC](https://discourse.cmake.org/t/add-test-has-different-behaviour-for-vs-and-ninja-generator/1046 "2020-04-17T16:07:36Z")

</div>

I have this CMakeList: add\_test( NAME with\_command\_and\_configuration COMMAND ${CMAKE\_COMMAND} --version CONFIGURATIONS one another ) Now I configure it. It results in different ctest code: MINGW64 /c/Temp/cte…

---

## [CTest build-and-test with multi-config generators](https://discourse.cmake.org/t/ctest-build-and-test-with-multi-config-generators/1008)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.cmake.org/u/alex)\
**Replies:** 6\
**Last updated:** [April 17, 2020, 3:05pm UTC](https://discourse.cmake.org/t/ctest-build-and-test-with-multi-config-generators/1008 "2020-04-17T15:05:01Z")

</div>

What is the right way to call CTest in build-and-test mode with a multi-config generator? I see there’s a flag --build-config-sample, but it doesn’t let me set the build config directly.

---

## [CTest able to daemonize fixtures?](https://discourse.cmake.org/t/ctest-able-to-daemonize-fixtures/1012)

<div class="topic-metadata">

**Author:** [@warmcat](https://discourse.cmake.org/u/warmcat)\
**Replies:** 9\
**Last updated:** [April 17, 2020, 10:34am UTC](https://discourse.cmake.org/t/ctest-able-to-daemonize-fixtures/1012 "2020-04-17T10:34:11Z")

</div>

Thanks for the work on CMake, it’s a huge help with cross-platform build. We have been using CMake for a long time and at the moment I am trying to transfer our bash scripted testing into CTest… it can handle simple “on…

---

## [ExternalProject\_Add creates wrong folder](https://discourse.cmake.org/t/externalproject-add-creates-wrong-folder/1041)

<div class="topic-metadata">

**Author:** [@Lotte1990](https://discourse.cmake.org/u/Lotte1990)\
**Replies:** 2\
**Last updated:** [April 17, 2020, 9:46am UTC](https://discourse.cmake.org/t/externalproject-add-creates-wrong-folder/1041 "2020-04-17T09:46:01Z")

</div>

In my project’s CMakeLists.txt I’m adding external projects like this: externalproject\_add(xxx GIT\_REPOSITORY xxxrepo SOURCE\_DIR ../../../3rdParty/xxx/src BUILD\_DIR ../../../3rdParty/xxx/build) externalproject\_add(yyy G…

---

## [Any way to tell cmake to prioritise a file in compile order?](https://discourse.cmake.org/t/any-way-to-tell-cmake-to-prioritise-a-file-in-compile-order/1005)

<div class="topic-metadata">

**Author:** [@asm](https://discourse.cmake.org/u/asm)\
**Replies:** 3\
**Last updated:** [April 16, 2020, 8:44pm UTC](https://discourse.cmake.org/t/any-way-to-tell-cmake-to-prioritise-a-file-in-compile-order/1005 "2020-04-16T20:44:49Z")

</div>

I have a large project with many, many files. One file takes a very long time to compile - about 2.5 minutes. I don’t have control over that file because it’s a third party dependency. The build (across cores) looks li…

---

## [Is there a way to query the value of RUNTIME DESTINATION for a target after an install(TARGETS) call](https://discourse.cmake.org/t/is-there-a-way-to-query-the-value-of-runtime-destination-for-a-target-after-an-install-targets-call/1042)

<div class="topic-metadata">

**Author:** [@alcroito](https://discourse.cmake.org/u/alcroito)\
**Replies:** 1\
**Last updated:** [April 16, 2020, 5:45pm UTC](https://discourse.cmake.org/t/is-there-a-way-to-query-the-value-of-runtime-destination-for-a-target-after-an-install-targets-call/1042 "2020-04-16T17:45:35Z")

</div>

Same for LIBRARY DESTINATION / ARCHIVE DESTINATION add\_executable(foo) install(TARGETS foo RUNTIME DESTINATION my\_prefix) # ....... get\_property(TARGET foo PROPERTY ????) It seems that install commands are a separate e…

---

## [MemoryCheckCommand for CTest Memcheck with \[Address/Thread/Memory\]Sanitizer](https://discourse.cmake.org/t/memorycheckcommand-for-ctest-memcheck-with-address-thread-memory-sanitizer/1019)

<div class="topic-metadata">

**Author:** [@shaq](https://discourse.cmake.org/u/shaq)\
**Replies:** 13\
**Last updated:** [April 15, 2020, 9:42pm UTC](https://discourse.cmake.org/t/memorycheckcommand-for-ctest-memcheck-with-address-thread-memory-sanitizer/1019 "2020-04-15T21:42:49Z")

</div>

Hi, I’m trying to setup CTest memcheck for build with sanitizers. I have an issue with missing MemoryCheckCommand/CTEST\_MEMORYCHECK\_COMMAND setting: Memory checker (MemoryCheckCommand) not set, or cannot find the spec…

---

## [How do I properly build OpenCV 4.3 with CUDA 10.1 support ?](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033)

<div class="topic-metadata">

**Author:** [@raisa](https://discourse.cmake.org/u/raisa)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 4:09pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033 "2020-04-15T16:09:58Z")

</div>

Anyone successfully build OpenCV with Cuda using CMake on Linux (Ubuntu) ? I encountered this error : OpenCV requires enabled 'cudev' module from 'opencv\_contrib' I’m using OpenCV 4.3, with Cuda 10.1 and my machine i…

---

## [ccmake . command not foud](https://discourse.cmake.org/t/ccmake-command-not-foud/1038)

<div class="topic-metadata">

**Author:** [@Vaya\_Putra](https://discourse.cmake.org/u/Vaya_Putra)\
**Replies:** 0\
**Last updated:** [April 15, 2020, 4:06pm UTC](https://discourse.cmake.org/t/ccmake-command-not-foud/1038 "2020-04-15T16:06:29Z")

</div>

hi i newbie using linux i have problem i had cmake old version 13.3.3, since i have to update this cmake i already done to uninstall and install new version but when i run cmake --version always state old version wh…

---

## [Best practices for company global compile flags](https://discourse.cmake.org/t/best-practices-for-company-global-compile-flags/1007)

<div class="topic-metadata">

**Author:** [@HenryMiller1](https://discourse.cmake.org/u/HenryMiller1)\
**Replies:** 1\
**Last updated:** [April 15, 2020, 1:58pm UTC](https://discourse.cmake.org/t/best-practices-for-company-global-compile-flags/1007 "2020-04-15T13:58:40Z")

</div>

We have been using cmake for years, and I’m trying to modernize our cmake. One issue that has come up is what about company global flags. We have a company policy that all internally written code is compiled with -Wall…

---

## [When to use ${} around variable names](https://discourse.cmake.org/t/when-to-use-around-variable-names/1021)

<div class="topic-metadata">

**Author:** [@Robert\_Boehne](https://discourse.cmake.org/u/Robert_Boehne)\
**Replies:** 3\
**Last updated:** [April 14, 2020, 10:50pm UTC](https://discourse.cmake.org/t/when-to-use-around-variable-names/1021 "2020-04-14T22:50:27Z")

</div>

All, Recently I put up a change in our product’s CMakeLists.txt to eliminate unnecessary use of ${} in tests around variables CMAKE\_SYSTEM\_NAME and CMAKE\_CXX\_COMPILER\_ID. That prompted a colleague to ask “when is it ne…

---

## [test does not run with configuration](https://discourse.cmake.org/t/test-does-not-run-with-configuration/1018)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 7\
**Last updated:** [April 14, 2020, 7:57pm UTC](https://discourse.cmake.org/t/test-does-not-run-with-configuration/1018 "2020-04-14T19:57:41Z")

</div>

I added a test which does not run: add\_test( NAME debugOnly COMMAND Cap24::testapp CONFIGURATIONS Debug ) the test should be executed only for the ‘Debug’ configuration. I am using the gnu makefiles generator …

---

## [Save CMake function parameter forwarding](https://discourse.cmake.org/t/save-cmake-function-parameter-forwarding/1002)

<div class="topic-metadata">

**Author:** [@mensinda](https://discourse.cmake.org/u/mensinda)\
**Replies:** 10\
**Last updated:** [April 14, 2020, 7:51pm UTC](https://discourse.cmake.org/t/save-cmake-function-parameter-forwarding/1002 "2020-04-14T19:51:52Z")

</div>

Is it generally possible to safely forward function parameters? I know that ${ARGV} is less than ideal since it flattens lists, etc. So I am looking for a solution that doesn’t have the same issues. More specifically I …

---

## [CMAKE\_RANLIB vs CMAKE\_CXX\_COMPILER\_RANLIB](https://discourse.cmake.org/t/cmake-ranlib-vs-cmake-cxx-compiler-ranlib/1017)

<div class="topic-metadata">

**Author:** [@rnyberg](https://discourse.cmake.org/u/rnyberg)\
**Replies:** 1\
**Last updated:** [April 14, 2020, 2:03pm UTC](https://discourse.cmake.org/t/cmake-ranlib-vs-cmake-cxx-compiler-ranlib/1017 "2020-04-14T14:03:02Z")

</div>

Hi! I’m not certain how these variables are to be used. In my case building with clang 7 and -flto I need to run the cxx compiler specific ranlib but CMAKE\_RANLIB is the one actually run. Am I supposed to to something l…

---

## [Running commands in spec file install section using CPackRPM](https://discourse.cmake.org/t/running-commands-in-spec-file-install-section-using-cpackrpm/993)

<div class="topic-metadata">

**Author:** [@praetorian](https://discourse.cmake.org/u/praetorian)\
**Replies:** 6\
**Last updated:** [April 14, 2020, 11:51am UTC](https://discourse.cmake.org/t/running-commands-in-spec-file-install-section-using-cpackrpm/993 "2020-04-14T11:51:38Z")

</div>

Hello, I’m trying to package a project using CPack RPM. During packaging, I need to post process some of the installed files after they’ve been copied to RPM\_BUILD\_ROOT (or whatever temp location install copies them to)…

---

## [XCode 11 / command line tools SDK confusion](https://discourse.cmake.org/t/xcode-11-command-line-tools-sdk-confusion/984)

<div class="topic-metadata">

**Author:** [@zakalawe](https://discourse.cmake.org/u/zakalawe)\
**Replies:** 9\
**Last updated:** [April 14, 2020, 10:28am UTC](https://discourse.cmake.org/t/xcode-11-command-line-tools-sdk-confusion/984 "2020-04-14T10:28:13Z")

</div>

I’m seeing an issue with CMake 3.17 (doesn’t seem to occur with CMake 3.16.5) where the generated command line includes two different macOS SDK locations. The actual active SDK (based on XCode-select) is included via -is…

---

## [\[solved\] what's the deal with CMake 7?](https://discourse.cmake.org/t/solved-whats-the-deal-with-cmake-7/1013)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 1\
**Last updated:** [April 14, 2020, 10:26am UTC](https://discourse.cmake.org/t/solved-whats-the-deal-with-cmake-7/1013 "2020-04-14T10:26:45Z")

</div>

The documentation of CMake uses a prefix 7 to title reference manuals, like CMake language, packages, developer, properties, build system, … I am curious, where is this 7 coming from? What does it mean?

---

## [Contributing: Qt Test discovery](https://discourse.cmake.org/t/contributing-qt-test-discovery/985)

<div class="topic-metadata">

**Author:** [@ocroquette](https://discourse.cmake.org/u/ocroquette)\
**Replies:** 5\
**Last updated:** [April 13, 2020, 4:46pm UTC](https://discourse.cmake.org/t/contributing-qt-test-discovery/985 "2020-04-13T16:46:18Z")

</div>

Hello, I would like to contribute a Qt Test discovery function similar to the one introduced for Google Test in 3.10 (https://blog.kitware.com/dynamic-google-test-discovery-in-cmake-3-10/). I have already implemented a…

---

## [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…

---

## [cannot use gtest\_add\_tests and gtest\_disover\_tests in lates cmake](https://discourse.cmake.org/t/cannot-use-gtest-add-tests-and-gtest-disover-tests-in-lates-cmake/991)

<div class="topic-metadata">

**Author:** [@Fido](https://discourse.cmake.org/u/Fido)\
**Replies:** 1\
**Last updated:** [April 11, 2020, 11:18pm UTC](https://discourse.cmake.org/t/cannot-use-gtest-add-tests-and-gtest-disover-tests-in-lates-cmake/991 "2020-04-11T23:18:32Z")

</div>

When I use any of these two commands, the result is: CMake Error at CMakeLists.txt:67 (gtest\_add\_tests): Unknown CMake command "gtest\_add\_tests". Any suggestion for what I’m doing wrong?

---

## [FetchContent protobuf and use for FindProtobuf functions](https://discourse.cmake.org/t/fetchcontent-protobuf-and-use-for-findprotobuf-functions/739)

<div class="topic-metadata">

**Author:** [@Leonard\_Lausen](https://discourse.cmake.org/u/Leonard_Lausen)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 7:58am UTC](https://discourse.cmake.org/t/fetchcontent-protobuf-and-use-for-findprotobuf-functions/739 "2020-04-11T07:58:08Z")

</div>

Following https://gitlab.kitware.com/cmake/cmake/issues/19875#note\_705896 it is possible to FetchContent protobuf. Is it feasible to use that protobuf and it’s compiler for the protobuf\_generate\_cpp and protobuf\_gene…

---

## [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…

[Previous page](https://discourse.cmake.org/latest.md?page=198)

[Next page](https://discourse.cmake.org/latest.md?page=200)
