# Usage

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

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

**Page:** 51

---

## [Non-standard compiler integration](https://discourse.cmake.org/t/non-standard-compiler-integration/7315)

<div class="topic-metadata">

**Author:** [@steffen](https://discourse.cmake.org/u/steffen)\
**Replies:** 1\
**Last updated:** [January 26, 2023, 1:27am UTC](https://discourse.cmake.org/t/non-standard-compiler-integration/7315 "2023-01-26T01:27:50Z")

</div>

I try to build a project with cmake, that uses a quite special compiler. It is about the xcc compiler from MicroSys for the os OS-9. The interface of the compiler differs from other compilers, like its objects files are…

---

## [Correctly setting address sanitizer for usage with clang](https://discourse.cmake.org/t/correctly-setting-address-sanitizer-for-usage-with-clang/7296)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 5\
**Last updated:** [January 25, 2023, 2:04pm UTC](https://discourse.cmake.org/t/correctly-setting-address-sanitizer-for-usage-with-clang/7296 "2023-01-25T14:04:43Z")

</div>

Hi, I’m doing this but, either if it seems to work, I’m not sure it’s the proper way to activate sanitizing with clang set(SANITIZER\_FLAGS -fsanitize=address,undefined,float-divide-by-zero,nullability -fno-omit-frame-po…

---

## [How to add clang-tidy to open source project?](https://discourse.cmake.org/t/how-to-add-clang-tidy-to-open-source-project/7311)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 1\
**Last updated:** [January 23, 2023, 10:12pm UTC](https://discourse.cmake.org/t/how-to-add-clang-tidy-to-open-source-project/7311 "2023-01-23T22:12:38Z")

</div>

CMake currently has built in clang-tidy support via: - \<LANG\>\_CLANG\_TIDY However, it only works on the Makefile / Ninja generator: The Makefile Generators and the Ninja generator will run this tool along with the com…

---

## [FW: Cmake Tutorial Step 1 Error](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273)

<div class="topic-metadata">

**Author:** [@MaxFun](https://discourse.cmake.org/u/MaxFun)\
**Replies:** 9\
**Last updated:** [January 21, 2023, 11:51pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273 "2023-01-21T23:51:24Z")

</div>

Removed embedded media items

---

## [CMake, CPack and IFW, several components but only one in the installer.](https://discourse.cmake.org/t/cmake-cpack-and-ifw-several-components-but-only-one-in-the-installer/7301)

<div class="topic-metadata">

**Author:** [@obiwankennedy](https://discourse.cmake.org/u/obiwankennedy)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 10:06pm UTC](https://discourse.cmake.org/t/cmake-cpack-and-ifw-several-components-but-only-one-in-the-installer/7301 "2023-01-21T22:06:17Z")

</div>

Hello all, I’m working on a cmake project which has several libraries and binaries. I would like to make an installer which installs all the libraries but user must be able to pick which binary to install. Folders tre…

---

## [Correct usage of find\_package(OpenSSL)](https://discourse.cmake.org/t/correct-usage-of-find-package-openssl/5094)

<div class="topic-metadata">

**Author:** [@peter](https://discourse.cmake.org/u/peter)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 5:36pm UTC](https://discourse.cmake.org/t/correct-usage-of-find-package-openssl/5094 "2023-01-20T17:36:35Z")

</div>

Hello, we have multiplatform (Win/Mac/Lin) C++ project tree for building several executable binaries and shared libraries and we use cmake. I found in our code find\_package(OpenSSL) in several CMakeLists.txt. Problem is…

---

## [Error: \`INSTALL(EXPORT) given unknown export \[...\]\` on windows, while working on unix](https://discourse.cmake.org/t/error-install-export-given-unknown-export-on-windows-while-working-on-unix/7278)

<div class="topic-metadata">

**Author:** [@h-vetinari](https://discourse.cmake.org/u/h-vetinari)\
**Replies:** 2\
**Last updated:** [January 19, 2023, 11:08pm UTC](https://discourse.cmake.org/t/error-install-export-given-unknown-export-on-windows-while-working-on-unix/7278 "2023-01-19T23:08:56Z")

</div>

I help package things for conda-forge, where lots of python code wraps lots of C/C++ code. One package I deal with has three components (at least from our POV): a library, some associated binaries, and python bindings. …

---

## [find\_package only works with -DCMAKE\_PREFIX\_PATH with default install directory](https://discourse.cmake.org/t/find-package-only-works-with-dcmake-prefix-path-with-default-install-directory/7264)

<div class="topic-metadata">

**Author:** [@Marc1996](https://discourse.cmake.org/u/Marc1996)\
**Replies:** 6\
**Last updated:** [January 19, 2023, 8:44am UTC](https://discourse.cmake.org/t/find-package-only-works-with-dcmake-prefix-path-with-default-install-directory/7264 "2023-01-19T08:44:54Z")

</div>

Hi! I have a library, say A, which depends on B. A uses find\_dependency in its AConfig.cmake and B is downloaded via FetchContent. A is, before being built manually with cmake, installed in some directory C:/Program fil…

---

## [Clang compiler](https://discourse.cmake.org/t/clang-compiler/7271)

<div class="topic-metadata">

**Author:** [@Alex2671](https://discourse.cmake.org/u/Alex2671)\
**Replies:** 2\
**Last updated:** [January 18, 2023, 5:25pm UTC](https://discourse.cmake.org/t/clang-compiler/7271 "2023-01-18T17:25:58Z")

</div>

Hi! I order to solve the warning “clang version too old to be used with SSCP compiler , diabling WITH\_SSCP\_COMPILER” i used several comands such as: -DLLVM\_DIR=/path/to/llvm/cmake -DCLANG\_EXECUTABLE\_PATH=/path/to/clang…

---

## [Install everything \_but\_certain components](https://discourse.cmake.org/t/install-everything-but-certain-components/6209)

<div class="topic-metadata">

**Author:** [@minrk](https://discourse.cmake.org/u/minrk)\
**Replies:** 5\
**Last updated:** [January 18, 2023, 10:30am UTC](https://discourse.cmake.org/t/install-everything-but-certain-components/6209 "2023-01-18T10:30:20Z")

</div>

I work on packaging for conda-forge, and we often want to separate multiple outputs for one project (commonly separating a shared library and language bindings, but could be any reason to subset files into outputs). Thi…

---

## [trace & debug when cmake use with CMakePresets.json](https://discourse.cmake.org/t/trace-debug-when-cmake-use-with-cmakepresets-json/7262)

<div class="topic-metadata">

**Author:** [@Maziar](https://discourse.cmake.org/u/Maziar)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 4:54pm UTC](https://discourse.cmake.org/t/trace-debug-when-cmake-use-with-cmakepresets-json/7262 "2023-01-17T16:54:13Z")

</div>

Hi I have problem for tracing & find bug in CMakePresets.json Try debugging CMake with CMake --debug-output or --trace also not any help. CMake have CMakePresets.json. For example, my situation CMAKE\_EXPORT\_COMPILE\_CO…

---

## [How to combine all dlls from subproject into one dll?](https://discourse.cmake.org/t/how-to-combine-all-dlls-from-subproject-into-one-dll/7235)

<div class="topic-metadata">

**Author:** [@zhang-qiang-github](https://discourse.cmake.org/u/zhang-qiang-github)\
**Replies:** 9\
**Last updated:** [January 17, 2023, 3:52am UTC](https://discourse.cmake.org/t/how-to-combine-all-dlls-from-subproject-into-one-dll/7235 "2023-01-17T03:52:13Z")

</div>

Now, I have several subprojects, which will export dll files. Let’s say, I will have 10 dlls. Is there any method to combine all 10 dll files into one dll file? In opencv, if we set BUILD\_opencv\_world to on, it will fi…

---

## [cmake linking error on linux using gcc and gfortran](https://discourse.cmake.org/t/cmake-linking-error-on-linux-using-gcc-and-gfortran/7256)

<div class="topic-metadata">

**Author:** [@crobar](https://discourse.cmake.org/u/crobar)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 12:49am UTC](https://discourse.cmake.org/t/cmake-linking-error-on-linux-using-gcc-and-gfortran/7256 "2023-01-17T00:49:15Z")

</div>

I’m building a program which is mostly Fortran, but includes a C++ interface library. This is a cmake project, and you can even find the specific branch on github here. I’m building on Linux using cmake 3.25.1, gcc and g…

---

## [Git clone slowdown with lots of parallelism](https://discourse.cmake.org/t/git-clone-slowdown-with-lots-of-parallelism/7226)

<div class="topic-metadata">

**Author:** [@imikejackson](https://discourse.cmake.org/u/imikejackson)\
**Replies:** 3\
**Last updated:** [January 17, 2023, 12:28am UTC](https://discourse.cmake.org/t/git-clone-slowdown-with-lots-of-parallelism/7226 "2023-01-17T00:28:16Z")

</div>

We were lucky and got a few new workstations with high core counts (Core i9-13900k) and while compiling one of our support projects (it compiles a bunch of dependencies) I noticed that the git clone (though https) slows …

---

## [gcc embedded strange '-march=armv7e-m+fp' added to compiler flags when crossbuilding](https://discourse.cmake.org/t/gcc-embedded-strange-march-armv7e-m-fp-added-to-compiler-flags-when-crossbuilding/7205)

<div class="topic-metadata">

**Author:** [@JuliusCaesar](https://discourse.cmake.org/u/JuliusCaesar)\
**Replies:** 2\
**Last updated:** [January 13, 2023, 5:33pm UTC](https://discourse.cmake.org/t/gcc-embedded-strange-march-armv7e-m-fp-added-to-compiler-flags-when-crossbuilding/7205 "2023-01-13T17:33:29Z")

</div>

Hey guys, I’m trying to cross build an embedded target (arm-none-eabi). On the compiler invocation I have noticed that CMake adds some extra ‘-march=armv7e-m+fp’, which overwrites my compiler flags. The flags I need a…

---

## [Swift Compiler: \`warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX'\`](https://discourse.cmake.org/t/swift-compiler-warning-using-sysroot-for-iphoneos-but-targeting-macosx/7240)

<div class="topic-metadata">

**Author:** [@CraigEmteq](https://discourse.cmake.org/u/CraigEmteq)\
**Replies:** 0\
**Last updated:** [January 13, 2023, 1:21pm UTC](https://discourse.cmake.org/t/swift-compiler-warning-using-sysroot-for-iphoneos-but-targeting-macosx/7240 "2023-01-13T13:21:20Z")

</div>

When building a Swift codebase targeting CMAKE\_SYSTEM\_NAME: "iOS" the platform doesn’t appear to be propagated onto the swiftc call? For what I gather the -target should be passed to swiftc. I checked the source and it…

---

## [Clang-cl with Visual Studio 2019 generator](https://discourse.cmake.org/t/clang-cl-with-visual-studio-2019-generator/4057)

<div class="topic-metadata">

**Author:** [@Julian\_LALU](https://discourse.cmake.org/u/Julian_LALU)\
**Replies:** 0\
**Last updated:** [September 8, 2021, 7:07pm UTC](https://discourse.cmake.org/t/clang-cl-with-visual-studio-2019-generator/4057 "2021-09-08T19:07:26Z")

</div>

Hello, Currently I have a projet that use CMake to generate Visual Studio 2019 solutions. Everything works fine, except that when I want to compile the project to target x86 (32bits) platform with clang-cl. I have an …

---

## [How to import TeamSpeak sdk in Cmake ?](https://discourse.cmake.org/t/how-to-import-teamspeak-sdk-in-cmake/7211)

<div class="topic-metadata">

**Author:** [@Tchoune](https://discourse.cmake.org/u/Tchoune)\
**Replies:** 9\
**Last updated:** [January 10, 2023, 2:47pm UTC](https://discourse.cmake.org/t/how-to-import-teamspeak-sdk-in-cmake/7211 "2023-01-10T14:47:12Z")

</div>

Hi I would like to use Teamspeak in a TrinityCore that uses Cmake. But I have a problem that I can’t import the TeamSpeak library. Here is my Cmakelists.txt configuration: find\_package(TSClientSdk REQUIRED COMPONENTS…

---

## [SWIG : get generated filename for installation purposes](https://discourse.cmake.org/t/swig-get-generated-filename-for-installation-purposes/7221)

<div class="topic-metadata">

**Author:** [@Nicholas\_Yue](https://discourse.cmake.org/u/Nicholas_Yue)\
**Replies:** 1\
**Last updated:** [January 10, 2023, 12:02am UTC](https://discourse.cmake.org/t/swig-get-generated-filename-for-installation-purposes/7221 "2023-01-10T00:02:49Z")

</div>

I am able to use SWIG+Python in my CMake configuration. The generated and compiled code works. I am at the stage of installation/packaging. set\_property(SOURCE src/example.i PROPERTY SWIG\_MODULE\_NAME example\_special)…

---

## [Generation expression based on dependee?](https://discourse.cmake.org/t/generation-expression-based-on-dependee/7220)

<div class="topic-metadata">

**Author:** [@kfsone](https://discourse.cmake.org/u/kfsone)\
**Replies:** 1\
**Last updated:** [January 9, 2023, 10:59pm UTC](https://discourse.cmake.org/t/generation-expression-based-on-dependee/7220 "2023-01-09T22:59:38Z")

</div>

Is it possible to write a generator expression at any point that varies the output based on a property coming from being linked to something? Such that in the following add\_library(widgets ...) add\_library(mouse ...) .…

---

## [CTest skip tests when RESOURCE\_GROUPS is not available](https://discourse.cmake.org/t/ctest-skip-tests-when-resource-groups-is-not-available/7208)

<div class="topic-metadata">

**Author:** [@Barry\_Revzin](https://discourse.cmake.org/u/Barry_Revzin)\
**Replies:** 4\
**Last updated:** [January 9, 2023, 10:26pm UTC](https://discourse.cmake.org/t/ctest-skip-tests-when-resource-groups-is-not-available/7208 "2023-01-09T22:26:25Z")

</div>

Here’s a reduced example. The CMakeLists.txt file is (one executable which I’m running as three tests using the same resource groups): cmake\_minimum\_required(VERSION 3.21) project(foo) set(CMAKE\_CXX\_STANDARD 23) add\_ex…

---

## [Override UseSWIG file extension type.](https://discourse.cmake.org/t/override-useswig-file-extension-type/7214)

<div class="topic-metadata">

**Author:** [@Luke](https://discourse.cmake.org/u/Luke)\
**Replies:** 1\
**Last updated:** [January 9, 2023, 9:12am UTC](https://discourse.cmake.org/t/override-useswig-file-extension-type/7214 "2023-01-09T09:12:29Z")

</div>

Hi, I would like to generate .cpp files with UseSWIG however I believe it is hardcoded to generate .cxx files here. Is there a way to do this?

---

## [cmake target\_link\_libraries INTERFACE works incorrect](https://discourse.cmake.org/t/cmake-target-link-libraries-interface-works-incorrect/7207)

<div class="topic-metadata">

**Author:** [@Sergey\_Vlasov](https://discourse.cmake.org/u/Sergey_Vlasov)\
**Replies:** 9\
**Last updated:** [January 8, 2023, 9:40am UTC](https://discourse.cmake.org/t/cmake-target-link-libraries-interface-works-incorrect/7207 "2023-01-08T09:40:05Z")

</div>

CMAKE 3.25.1, linux, GCC 4.6.4 I have the following CMakeLists.txt: cmake\_minimum\_required(VERSION 3.12) project(all) add\_library(lib1 STATIC lib1.cpp lib1.h) add\_library(lib1\_wrapper INTERFACE) target\_link\_libraries(…

---

## [\[ExternalData\] updating content does not trigger staging of linked content](https://discourse.cmake.org/t/externaldata-updating-content-does-not-trigger-staging-of-linked-content/7196)

<div class="topic-metadata">

**Author:** [@menno](https://discourse.cmake.org/u/menno)\
**Replies:** 2\
**Last updated:** [January 5, 2023, 7:12am UTC](https://discourse.cmake.org/t/externaldata-updating-content-does-not-trigger-staging-of-linked-content/7196 "2023-01-05T07:12:48Z")

</div>

I’m trying to use the ExternalData module. So far it works very well; with a declaration of ExternalData\_LINK\_CONTENT the data marked with DATA{...} in the CMakeLists.txt files gets staged for uploading by moving it to .…

---

## [Reduce number of targets in IDEs](https://discourse.cmake.org/t/reduce-number-of-targets-in-ides/7163)

<div class="topic-metadata">

**Author:** [@edvn0](https://discourse.cmake.org/u/edvn0)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 1:53pm UTC](https://discourse.cmake.org/t/reduce-number-of-targets-in-ides/7163 "2022-12-30T13:53:33Z")

</div>

I typically use (git) submodules into third party libraries I need for my projects. Most of the time, these third party libraries provide several targets, and for my current project, I have 8 submodules. This results in …

---

## [CMake unable to check existing PkgConfig modules](https://discourse.cmake.org/t/cmake-unable-to-check-existing-pkgconfig-modules/7121)

<div class="topic-metadata">

**Author:** [@michael.k](https://discourse.cmake.org/u/michael.k)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 4:53am UTC](https://discourse.cmake.org/t/cmake-unable-to-check-existing-pkgconfig-modules/7121 "2022-12-30T04:53:48Z")

</div>

I tried to add dpdk libraries to my test application, and, almost everything related PkgConfig went wrong. At moment i have: Arch Clion IDE CMake 3.24 dpdk 22.0 CMakeLists.txt is very simple helloworld-like applicati…

---

## [application show the banner image](https://discourse.cmake.org/t/application-show-the-banner-image/7134)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 5\
**Last updated:** [December 29, 2022, 12:54pm UTC](https://discourse.cmake.org/t/application-show-the-banner-image/7134 "2022-12-29T12:54:38Z")

</div>

I write a application with cmake how to show the image when I start my application. Like google, picture, …

---

## [permissioin with deb](https://discourse.cmake.org/t/permissioin-with-deb/7135)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 3\
**Last updated:** [December 29, 2022, 2:27am UTC](https://discourse.cmake.org/t/permissioin-with-deb/7135 "2022-12-29T02:27:27Z")

</div>

I cpack a deb and install it with sudo dpkg -i xx.deb. The program will be install /opt/xxx But the /opt/xxx permission is root:root How can I solve it? I add some command on the postinst script. But the user is root…

---

## [install deb to show applications](https://discourse.cmake.org/t/install-deb-to-show-applications/7136)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 1\
**Last updated:** [December 28, 2022, 12:42pm UTC](https://discourse.cmake.org/t/install-deb-to-show-applications/7136 "2022-12-28T12:42:37Z")

</div>

How to let DEB program show the linux show applications and I click the icon to start it how can I implement it with cmake

---

## [CPack wix generator is for wix v3](https://discourse.cmake.org/t/cpack-wix-generator-is-for-wix-v3/7126)

<div class="topic-metadata">

**Author:** [@fry](https://discourse.cmake.org/u/fry)\
**Replies:** 1\
**Last updated:** [December 28, 2022, 12:38pm UTC](https://discourse.cmake.org/t/cpack-wix-generator-is-for-wix-v3/7126 "2022-12-28T12:38:31Z")

</div>

I tried to use the CPack wix generator. Not knowing much about wix, I went to the wix toolset website and followed the instructions to install it. CPack then fails with some message about “not finding candle”. It seems …

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

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