# Usage

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

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

**Page:** 34

---

## [Architecture documentation?](https://discourse.cmake.org/t/architecture-documentation/9707)

<div class="topic-metadata">

**Author:** [@Chris\_King](https://discourse.cmake.org/u/Chris_King)\
**Replies:** 1\
**Last updated:** [December 24, 2023, 9:58pm UTC](https://discourse.cmake.org/t/architecture-documentation/9707 "2023-12-24T21:58:57Z")

</div>

I have dabbled in cmake for years. I can usually get what I need working by googling for examples but I really don’t have any idea how cmake works. I was wondering if there is any document that describes the architecture…

---

## [CMake for compiling gtkmm4 : error adding symbols: DSO missing from command line](https://discourse.cmake.org/t/cmake-for-compiling-gtkmm4-error-adding-symbols-dso-missing-from-command-line/9705)

<div class="topic-metadata">

**Author:** [@Raphy](https://discourse.cmake.org/u/Raphy)\
**Replies:** 1\
**Last updated:** [December 24, 2023, 9:34pm UTC](https://discourse.cmake.org/t/cmake-for-compiling-gtkmm4-error-adding-symbols-dso-missing-from-command-line/9705 "2023-12-24T21:34:39Z")

</div>

I’m trying to convert the command-line compilation and building to a CMake one for gtkmm-4 in Ubuntu 22.10 raphy@raohy:~/gtkmm-prj$ cmake -B build -- The CXX compiler identification is GNU 12.3.0 -- Detecting CXX compi…

---

## [Creating CMake module repository: scope issues](https://discourse.cmake.org/t/creating-cmake-module-repository-scope-issues/9566)

<div class="topic-metadata">

**Author:** [@hesperaux](https://discourse.cmake.org/u/hesperaux)\
**Replies:** 10\
**Last updated:** [December 24, 2023, 9:20pm UTC](https://discourse.cmake.org/t/creating-cmake-module-repository-scope-issues/9566 "2023-12-24T21:20:52Z")

</div>

Hello, I am new here. I have been attempting to setup a git repository that will contain cmake modules. I have achieved bringing this into another project using the Fetch Content pattern presented by Craig Scott in his…

---

## [Regex for labels in ctest\_test](https://discourse.cmake.org/t/regex-for-labels-in-ctest-test/9698)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 3\
**Last updated:** [December 24, 2023, 1:14am UTC](https://discourse.cmake.org/t/regex-for-labels-in-ctest-test/9698 "2023-12-24T01:14:26Z")

</div>

Hello, I have several tests described with some of them having multiple labels. I am trying to run tests with multiple labels, like label\_A and label\_B, in ctest\_test(). I am not able to get a regex work for this case, …

---

## [CMAKE\_BUILD\_TYPE, Presets, Multi-config generators](https://discourse.cmake.org/t/cmake-build-type-presets-multi-config-generators/9699)

<div class="topic-metadata">

**Author:** [@jaquilio](https://discourse.cmake.org/u/jaquilio)\
**Replies:** 2\
**Last updated:** [December 23, 2023, 10:39pm UTC](https://discourse.cmake.org/t/cmake-build-type-presets-multi-config-generators/9699 "2023-12-23T22:39:20Z")

</div>

CMake documentation on Build Configurations says that " For multi-configuration generators like Visual Studio,…, the configuration is chosen by the user at build time and CMAKE\_BUILD\_TYPE is ignored". But, then, I see t…

---

## [How to control the location of the c++20 Binary Module Interface (BMI) output directory?](https://discourse.cmake.org/t/how-to-control-the-location-of-the-c-20-binary-module-interface-bmi-output-directory/7968)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 20\
**Last updated:** [December 22, 2023, 9:21pm UTC](https://discourse.cmake.org/t/how-to-control-the-location-of-the-c-20-binary-module-interface-bmi-output-directory/7968 "2023-12-22T21:21:39Z")

</div>

With this CMakeLists.txt, I can build and check the simple example of a module interface. But clang-tidy does not find the BMI file? cmake\_minimum\_required(VERSION 3.26) set(CMAKE\_EXPORT\_COMPILE\_COMMANDS YES) project…

---

## [Is it possible to produce a (clang compatible) compile\_commands database while targeting MSVC?](https://discourse.cmake.org/t/is-it-possible-to-produce-a-clang-compatible-compile-commands-database-while-targeting-msvc/9679)

<div class="topic-metadata">

**Author:** [@Adnn](https://discourse.cmake.org/u/Adnn)\
**Replies:** 9\
**Last updated:** [December 22, 2023, 8:39pm UTC](https://discourse.cmake.org/t/is-it-possible-to-produce-a-clang-compatible-compile-commands-database-while-targeting-msvc/9679 "2023-12-22T20:39:44Z")

</div>

We would like to support a Windows development workflow on Vim. As far as we know, the most convenient LSP option would be clangd, since vscode-cpptools LSP is not licensed for use outside VSCode. As per the documentati…

---

## [CPack adds weird Dll's to the installer](https://discourse.cmake.org/t/cpack-adds-weird-dlls-to-the-installer/9667)

<div class="topic-metadata">

**Author:** [@Chris\_Bielow](https://discourse.cmake.org/u/Chris_Bielow)\
**Replies:** 1\
**Last updated:** [December 22, 2023, 10:28am UTC](https://discourse.cmake.org/t/cpack-adds-weird-dlls-to-the-installer/9667 "2023-12-22T10:28:33Z")

</div>

out project (GitHub - OpenMS/OpenMS: The codebase of the OpenMS project) uses CMake + CPack with NSIS to create a Windows installer. In our CMake scripts we use include(InstallRequiredSystemLibraries) (https://github.co…

---

## [Cmake Cuda Compiling Error (Cuda Compiler Idenfitication Is Unknown)](https://discourse.cmake.org/t/cmake-cuda-compiling-error-cuda-compiler-idenfitication-is-unknown/9694)

<div class="topic-metadata">

**Author:** [@ugurortac](https://discourse.cmake.org/u/ugurortac)\
**Replies:** 2\
**Last updated:** [December 21, 2023, 10:12pm UTC](https://discourse.cmake.org/t/cmake-cuda-compiling-error-cuda-compiler-idenfitication-is-unknown/9694 "2023-12-21T22:12:26Z")

</div>

Hello, I’m getting an error while compiling the cmake project I created. I think this error is caused by the internal structure of cmake. Cmake Version : 3.27.8 (Clion Embedded Compiler) Cuda Version: 12.3 Nvidia Dri…

---

## [Windows defender blocked a exe when configuring](https://discourse.cmake.org/t/windows-defender-blocked-a-exe-when-configuring/9647)

<div class="topic-metadata">

**Author:** [@MrCheese](https://discourse.cmake.org/u/MrCheese)\
**Replies:** 4\
**Last updated:** [December 21, 2023, 7:45pm UTC](https://discourse.cmake.org/t/windows-defender-blocked-a-exe-when-configuring/9647 "2023-12-21T19:45:41Z")

</div>

My windows defender suddenly said it blocked a threat when configuring a cmake list, I have used this cmake list for a while and this has not happened before, should I ignore it? Cmake version: 3.23.1 Here’s the threat …

---

## [How to find OpenMP with clang on macOS](https://discourse.cmake.org/t/how-to-find-openmp-with-clang-on-macos/8860)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 12\
**Last updated:** [December 21, 2023, 7:26am UTC](https://discourse.cmake.org/t/how-to-find-openmp-with-clang-on-macos/8860 "2023-12-21T07:26:16Z")

</div>

All, I’m feeling really stupid right now. Not sure what I’m doing wrong. First, I’m a Fortran programmer, so I am not good at C. But, when I try and use OpenMP and Clang, I can’t seem to. Many things on line say I need …

---

## [Variables used in g++ compiler command line](https://discourse.cmake.org/t/variables-used-in-g-compiler-command-line/9684)

<div class="topic-metadata">

**Author:** [@Chris\_King](https://discourse.cmake.org/u/Chris_King)\
**Replies:** 1\
**Last updated:** [December 21, 2023, 1:21am UTC](https://discourse.cmake.org/t/variables-used-in-g-compiler-command-line/9684 "2023-12-21T01:21:46Z")

</div>

I am trying to build some c++ code. The default command line for the c++ compiler has some include directories that I don’t want. I think this would be easier if I know what variables were used to build the compiler com…

---

## [Visual Studio: Some files not recompiled - how to debug ?](https://discourse.cmake.org/t/visual-studio-some-files-not-recompiled-how-to-debug/8200)

<div class="topic-metadata">

**Author:** [@neundorf](https://discourse.cmake.org/u/neundorf)\
**Replies:** 3\
**Last updated:** [December 20, 2023, 10:14pm UTC](https://discourse.cmake.org/t/visual-studio-some-files-not-recompiled-how-to-debug/8200 "2023-12-20T22:14:37Z")

</div>

Hi, in one of my projects it happens from time to time that when building with Visual Studio (not Code), I get linker errors, because some cpp files have not been recompiled. So it seems that after a header was edited,…

---

## [CMake: reproduce the WebKitGTK building phases within a CMakeLists.txt ?](https://discourse.cmake.org/t/cmake-reproduce-the-webkitgtk-building-phases-within-a-cmakelists-txt/9659)

<div class="topic-metadata">

**Author:** [@Raphy](https://discourse.cmake.org/u/Raphy)\
**Replies:** 1\
**Last updated:** [December 19, 2023, 12:31pm UTC](https://discourse.cmake.org/t/cmake-reproduce-the-webkitgtk-building-phases-within-a-cmakelists-txt/9659 "2023-12-19T12:31:01Z")

</div>

With this CMakeLists.txt file: include(FetchContent) FetchContent\_Declare( WebKit2 #URL https://webkitgtk.org/releases/webkitgtk-2.42.3.tar.xz GIT\_REPOSITORY https://github.com/raphael10-collab/webkitgtkIncludable…

---

## [How CXX\_SCAN\_FOR\_MODULES is connected to precompiled headers?](https://discourse.cmake.org/t/how-cxx-scan-for-modules-is-connected-to-precompiled-headers/9631)

<div class="topic-metadata">

**Author:** [@ixsci](https://discourse.cmake.org/u/ixsci)\
**Replies:** 4\
**Last updated:** [December 19, 2023, 6:26am UTC](https://discourse.cmake.org/t/how-cxx-scan-for-modules-is-connected-to-precompiled-headers/9631 "2023-12-19T06:26:08Z")

</div>

Suppose we have the following files: src/main.cpp and src/PCH.h and the following cmake file: cmake\_minimum\_required(VERSION 3.28) project(Test) set(CMAKE\_CXX\_STANDARD 23) set(CMAKE\_CXX\_STANDARD\_REQUIRED ON) set(CMAKE\_…

---

## [Providing multiple dll PATHs to CTest on Windows](https://discourse.cmake.org/t/providing-multiple-dll-paths-to-ctest-on-windows/9630)

<div class="topic-metadata">

**Author:** [@hesperaux](https://discourse.cmake.org/u/hesperaux)\
**Replies:** 5\
**Last updated:** [December 19, 2023, 4:37am UTC](https://discourse.cmake.org/t/providing-multiple-dll-paths-to-ctest-on-windows/9630 "2023-12-19T04:37:46Z")

</div>

Hello, I’m attempting to discover GTest unit tests and execute the tests with CTest in Windows for a multi-level library project. I have started at the bottom (lowest level library) to simplify things for the moment. M…

---

## [Customizing the junit xml or Jason output of ctest](https://discourse.cmake.org/t/customizing-the-junit-xml-or-jason-output-of-ctest/9638)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 4\
**Last updated:** [December 19, 2023, 3:37am UTC](https://discourse.cmake.org/t/customizing-the-junit-xml-or-jason-output-of-ctest/9638 "2023-12-19T03:37:30Z")

</div>

Hello, Is there a way to add custom fields to the junit or Jason output of a ctest run. For example, fields like the size of executable , ticket id etc . Wondering if such information can be made part of the report. Th…

---

## [Why doesn't "cmake --install --strip" doesn't strip binary if MACOSX\_BUNDLE is set on a target?](https://discourse.cmake.org/t/why-doesnt-cmake-install-strip-doesnt-strip-binary-if-macosx-bundle-is-set-on-a-target/9628)

<div class="topic-metadata">

**Author:** [@equeim](https://discourse.cmake.org/u/equeim)\
**Replies:** 1\
**Last updated:** [December 19, 2023, 3:19am UTC](https://discourse.cmake.org/t/why-doesnt-cmake-install-strip-doesnt-strip-binary-if-macosx-bundle-is-set-on-a-target/9628 "2023-12-19T03:19:56Z")

</div>

Apparently if I set MACOSX\_BUNDLE property on an executable target, CMake will not strip in on installation even if I explicitly request it. I found where in CMake source code it’s done: https://gitlab.kitware.com/cmake…

---

## [\#include errors detected](https://discourse.cmake.org/t/include-errors-detected/9615)

<div class="topic-metadata">

**Author:** [@Sea\_Sea](https://discourse.cmake.org/u/Sea_Sea)\
**Replies:** 1\
**Last updated:** [December 19, 2023, 3:09am UTC](https://discourse.cmake.org/t/include-errors-detected/9615 "2023-12-19T03:09:41Z")

</div>

I use the target\_link\_libraries, but the vscode IDE show the error. Do you know what is the reason? CMakeLists.txt add\_executable(iam ${CMAKE\_CURRENT\_SOURCE\_DIR}/main.cpp) target\_link\_libraries(iam PRIVATE LibDataChan…

---

## [Print cause of rebuilt](https://discourse.cmake.org/t/print-cause-of-rebuilt/9641)

<div class="topic-metadata">

**Author:** [@Martin\_Santa\_Maria](https://discourse.cmake.org/u/Martin_Santa_Maria)\
**Replies:** 2\
**Last updated:** [December 16, 2023, 11:14am UTC](https://discourse.cmake.org/t/print-cause-of-rebuilt/9641 "2023-12-16T11:14:45Z")

</div>

Hello, I have a fairly complicated project with lots of dependencies and custom targets and commands. I’m getting some rebuilds, and until now they have all been proven to be right after analysis; but it is never easy t…

---

## [Set environment variables for doxygen\_add\_docs](https://discourse.cmake.org/t/set-environment-variables-for-doxygen-add-docs/9634)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 4\
**Last updated:** [December 16, 2023, 12:22am UTC](https://discourse.cmake.org/t/set-environment-variables-for-doxygen-add-docs/9634 "2023-12-16T00:22:43Z")

</div>

Hi, in a Doxyfile (supported with CONFIG\_FILE) you can reference files via environment. e.g. @INCLUDE\_PATH = $(DOXYGEN\_INCLUDE\_PATH) @INCLUDE = include.doxygen S.a. Doxygen Manual: Configuration …

---

## [ctest integration with CI/CD](https://discourse.cmake.org/t/ctest-integration-with-ci-cd/9352)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 3\
**Last updated:** [December 15, 2023, 8:44pm UTC](https://discourse.cmake.org/t/ctest-integration-with-ci-cd/9352 "2023-12-15T20:44:37Z")

</div>

Hi all, Would like to get your view on recommended integrations with Ctest for test dashboards, apart from CDash. We have Jenkins CI/CD, any recommendations for jenkins would be welcome, to visualize test results and me…

---

## [Testing a lib with various build configurations](https://discourse.cmake.org/t/testing-a-lib-with-various-build-configurations/9545)

<div class="topic-metadata">

**Author:** [@ach](https://discourse.cmake.org/u/ach)\
**Replies:** 7\
**Last updated:** [December 14, 2023, 6:43am UTC](https://discourse.cmake.org/t/testing-a-lib-with-various-build-configurations/9545 "2023-12-14T06:43:46Z")

</div>

Hello, I’m currently trying to set-up a small embedded-C project using CMake. Part of the code is conditionally built using preprocessor guards. The CMake project uses an option() to enable/disable this. Using generator…

---

## [Refering to generated files specified in top level CMakeList.txt from sub\_directory CMakeList.txt](https://discourse.cmake.org/t/refering-to-generated-files-specified-in-top-level-cmakelist-txt-from-sub-directory-cmakelist-txt/9623)

<div class="topic-metadata">

**Author:** [@Thorbjorn\_Willoch](https://discourse.cmake.org/u/Thorbjorn_Willoch)\
**Replies:** 3\
**Last updated:** [December 14, 2023, 8:30am UTC](https://discourse.cmake.org/t/refering-to-generated-files-specified-in-top-level-cmakelist-txt-from-sub-directory-cmakelist-txt/9623 "2023-12-14T08:30:30Z")

</div>

HI, I am using cmake 3.20. But it also happens with 3.28 In top level CMakeList.txt I do add\_custom\_command( OUTPUT ${CMAKE\_BINARY\_DIR}/version.cpp ${CMAKE\_BINARY\_DIR}/\_version.cpp COMMAND ${CMAKE\_CO…

---

## [Is CMAKE\_FIND\_ROOT\_PATH will overwrite the default search path of compiler?](https://discourse.cmake.org/t/is-cmake-find-root-path-will-overwrite-the-default-search-path-of-compiler/9553)

<div class="topic-metadata">

**Author:** [@Ricky\_Yel](https://discourse.cmake.org/u/Ricky_Yel)\
**Replies:** 4\
**Last updated:** [December 13, 2023, 11:15pm UTC](https://discourse.cmake.org/t/is-cmake-find-root-path-will-overwrite-the-default-search-path-of-compiler/9553 "2023-12-13T23:15:01Z")

</div>

ubuntu 22.04 and gcc9.4.0 After type the command: echo | gcc -Wp,-v -x c++ - -fsyntax-only it will output: ignoring duplicate directory “/usr/include/x86\_64-linux-gnu/c++/9” ignoring nonexistent directory “/usr/local…

---

## [CTest scripting + CMake presets?](https://discourse.cmake.org/t/ctest-scripting-cmake-presets/9610)

<div class="topic-metadata">

**Author:** [@benthevining](https://discourse.cmake.org/u/benthevining)\
**Replies:** 2\
**Last updated:** [December 13, 2023, 3:37am UTC](https://discourse.cmake.org/t/ctest-scripting-cmake-presets/9610 "2023-12-13T03:37:43Z")

</div>

For local development, I’ve got all of my configuration specified in configure/build/test presets. I’ve been looking at CTest scripting, and it looks like you have to specify all these options again in the arguments to c…

---

## [Cmake warnings as error](https://discourse.cmake.org/t/cmake-warnings-as-error/3960)

<div class="topic-metadata">

**Author:** [@chrilleman](https://discourse.cmake.org/u/chrilleman)\
**Replies:** 4\
**Last updated:** [December 12, 2023, 1:15pm UTC](https://discourse.cmake.org/t/cmake-warnings-as-error/3960 "2023-12-12T13:15:25Z")

</div>

I am trying to stop cmake from continuing generation if it outputs a warning, i.e. treat all warnings as errors and stop. I have found the dev and deprecated warning option to do this but ill like this to happen on any …

---

## [\<MyPackage\>Targets.cmake referencing configurations that don't exist anymore](https://discourse.cmake.org/t/mypackage-targets-cmake-referencing-configurations-that-dont-exist-anymore/9578)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 3\
**Last updated:** [December 11, 2023, 4:06pm UTC](https://discourse.cmake.org/t/mypackage-targets-cmake-referencing-configurations-that-dont-exist-anymore/9578 "2023-12-11T16:06:09Z")

</div>

Hi, Targets.cmake is default generated with following code: # Load information for each installed configuration. get\_filename\_component(\_DIR "${CMAKE\_CURRENT\_LIST\_FILE}" PATH) file(GLOB CONFIG\_FILES "${\_DIR}/AlgoBSSTar…

---

## [When building VS project every time, CMake configuration run again.](https://discourse.cmake.org/t/when-building-vs-project-every-time-cmake-configuration-run-again/9603)

<div class="topic-metadata">

**Author:** [@Jerry\_Guo](https://discourse.cmake.org/u/Jerry_Guo)\
**Replies:** 3\
**Last updated:** [December 11, 2023, 3:07pm UTC](https://discourse.cmake.org/t/when-building-vs-project-every-time-cmake-configuration-run-again/9603 "2023-12-11T15:07:08Z")

</div>

Hi, I am using CMake GUI on Windows 10. First I set the source directory and build directory on CMake GUI. Then click the configuration button and generate the Visual Studio project. And there isn’t any error here. Afte…

---

## [Use cmake compiled dlls in other projects and be able to put breakpoints](https://discourse.cmake.org/t/use-cmake-compiled-dlls-in-other-projects-and-be-able-to-put-breakpoints/9496)

<div class="topic-metadata">

**Author:** [@Martin\_Santa\_Maria](https://discourse.cmake.org/u/Martin_Santa_Maria)\
**Replies:** 4\
**Last updated:** [December 11, 2023, 7:56am UTC](https://discourse.cmake.org/t/use-cmake-compiled-dlls-in-other-projects-and-be-able-to-put-breakpoints/9496 "2023-12-11T07:56:40Z")

</div>

Hello community, I have a cmake project that builds dll compiled debug. Now I want to use that dll in another cmake project (it cannot be the same as the other one). I have been able to link with it using target\_link\_l…

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

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