# Latest

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

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

**Page:** 179

---

## [Different compilers/toolchains for different targets](https://discourse.cmake.org/t/different-compilers-toolchains-for-different-targets/2471)

<div class="topic-metadata">

**Author:** [@asmvolatile](https://discourse.cmake.org/u/asmvolatile)\
**Replies:** 3\
**Last updated:** [January 6, 2021, 8:45pm UTC](https://discourse.cmake.org/t/different-compilers-toolchains-for-different-targets/2471 "2021-01-06T20:45:03Z")

</div>

I have been using CMake as a build system generator to cross compile for ARM Cortex M microcontrollers for a while now, and to great success (well, honestly it was only successful after I bought @craig.scott 's book). N…

---

## [Xcode workspace VS project built product issue](https://discourse.cmake.org/t/xcode-workspace-vs-project-built-product-issue/2479)

<div class="topic-metadata">

**Author:** [@m\_g](https://discourse.cmake.org/u/m_g)\
**Replies:** 8\
**Last updated:** [January 6, 2021, 4:51pm UTC](https://discourse.cmake.org/t/xcode-workspace-vs-project-built-product-issue/2479 "2021-01-06T16:51:49Z")

</div>

Hi everyone! I currently moved my macOS/iOS app (mainly C++ / Objective-C++) to CMake. So far, so good! I can properly generate each Xcode project, one targeting the macOS platform, and the other one for iOS. Before m…

---

## [CMake build failure - Clang vs GCC?](https://discourse.cmake.org/t/cmake-build-failure-clang-vs-gcc/2473)

<div class="topic-metadata">

**Author:** [@Adam\_Haber](https://discourse.cmake.org/u/Adam_Haber)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 10:12pm UTC](https://discourse.cmake.org/t/cmake-build-failure-clang-vs-gcc/2473 "2021-01-05T22:12:50Z")

</div>

Hi, Not sure if this is the right place to ask this question, but I’ve already tried every SO solution I could find, and thought maybe someone from the CMake community might help. I’m learning Cpp using exercism, and t…

---

## [Signing key for apt.kitware.com updated](https://discourse.cmake.org/t/signing-key-for-apt-kitware-com-updated/2483)

<div class="topic-metadata">

**Author:** [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)\
**Replies:** 0\
**Last updated:** [January 5, 2021, 9:32pm UTC](https://discourse.cmake.org/t/signing-key-for-apt-kitware-com-updated/2483 "2021-01-05T21:32:55Z")

</div>

The 2021 signing key for apt.kitware.com, which was generated and posted several weeks ago, has now replaced the 2020 key as the primary signing key. Both the repository signature and the kitware-archive-latest.asc file …

---

## [CMake 3.19 / Xcode 12 fails when cross-compiling for iOS unless -T buildsystem=1 is specified](https://discourse.cmake.org/t/cmake-3-19-xcode-12-fails-when-cross-compiling-for-ios-unless-t-buildsystem-1-is-specified/2463)

<div class="topic-metadata">

**Author:** [@herzbube](https://discourse.cmake.org/u/herzbube)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 7:34pm UTC](https://discourse.cmake.org/t/cmake-3-19-xcode-12-fails-when-cross-compiling-for-ios-unless-t-buildsystem-1-is-specified/2463 "2021-01-05T19:34:15Z")

</div>

From the CMake 3.19 release notes: The Xcode generator now uses the Xcode “new build system” when generating for Xcode 12.0 or higher. See the CMAKE\_XCODE\_BUILD\_SYSTEM variable. One may use -T buildsystem=1 to switch t…

---

## [How to detect Linux distro type?](https://discourse.cmake.org/t/how-to-detect-linux-distro-type/2476)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 2:03pm UTC](https://discourse.cmake.org/t/how-to-detect-linux-distro-type/2476 "2021-01-05T14:03:16Z")

</div>

My CMake project targets Ubuntu and Centos distros and I need to link to separate libraries for each. How can I detect the distro type and conditionally call target\_link\_libraries accordingly? There are some suggestion…

---

## [ExternalProject\_Add when only build external libs and when build-install](https://discourse.cmake.org/t/externalproject-add-when-only-build-external-libs-and-when-build-install/2434)

<div class="topic-metadata">

**Author:** [@kerim](https://discourse.cmake.org/u/kerim)\
**Replies:** 3\
**Last updated:** [January 5, 2021, 1:43pm UTC](https://discourse.cmake.org/t/externalproject-add-when-only-build-external-libs-and-when-build-install/2434 "2021-01-05T13:43:55Z")

</div>

Hi, ExternalProject\_Add allows build and install libraries. I experiment with it and as an example I use Slicer 3D. I can see that Slicer builds some libs and other libs Slicer builds-install. What is the logic behind…

---

## [difference between Xxx\_VERSION\_Yy and Xxx\_VERSION\_MAJOR](https://discourse.cmake.org/t/difference-between-xxx-version-yy-and-xxx-version-major/2430)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 3\
**Last updated:** [January 5, 2021, 1:42pm UTC](https://discourse.cmake.org/t/difference-between-xxx-version-yy-and-xxx-version-major/2430 "2021-01-05T13:42:20Z")

</div>

the documentation about CMake modules lists both Xxx\_VERSION\_Yy and Xxx\_VERSION\_MAJOR et all as recommended variables: Xxx\_VERSION\_Yy: Expect Version Yy if true. Make sure at most one of these is ever true Xxx\_VERSION\_…

---

## [find\_package() link path on target for pre-built cross compiled libraries](https://discourse.cmake.org/t/find-package-link-path-on-target-for-pre-built-cross-compiled-libraries/2212)

<div class="topic-metadata">

**Author:** [@shannon](https://discourse.cmake.org/u/shannon)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 1:41pm UTC](https://discourse.cmake.org/t/find-package-link-path-on-target-for-pre-built-cross-compiled-libraries/2212 "2021-01-05T13:41:10Z")

</div>

Hi there, I am working on converting a embedded project which cross compiles for two different targets, and am trying to convert it to CMake (and also getting x86 host system builds working). I have got this (somewhat)…

---

## [Sending more than pass/fail data to CDash - what is the data format CDash expects?](https://discourse.cmake.org/t/sending-more-than-pass-fail-data-to-cdash-what-is-the-data-format-cdash-expects/2392)

<div class="topic-metadata">

**Author:** [@jverdicchio](https://discourse.cmake.org/u/jverdicchio)\
**Replies:** 7\
**Last updated:** [January 5, 2021, 11:37am UTC](https://discourse.cmake.org/t/sending-more-than-pass-fail-data-to-cdash-what-is-the-data-format-cdash-expects/2392 "2021-01-05T11:37:01Z")

</div>

At my previous employer, we used CDash to display statistics about the tests that were run. When the code was run in “test” mode, additional statistics were recorded about the code and saved to an XML file. These statist…

---

## [FetchContent / CMAKE\_MAKE\_PROGRAM error](https://discourse.cmake.org/t/fetchcontent-cmake-make-program-error/2468)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 9\
**Last updated:** [January 4, 2021, 10:02pm UTC](https://discourse.cmake.org/t/fetchcontent-cmake-make-program-error/2468 "2021-01-04T22:02:58Z")

</div>

I’m having an issue with Ninja and FetchContent. I’m trying to create a shared cmake code repository at my company. And I would like to use FetchContent to grab this shared cmake code. So I have the following FetchC…

---

## [CPack Dependencies Shared Library](https://discourse.cmake.org/t/cpack-dependencies-shared-library/1687)

<div class="topic-metadata">

**Author:** [@arturoar3nas](https://discourse.cmake.org/u/arturoar3nas)\
**Replies:** 4\
**Last updated:** [January 4, 2021, 9:36pm UTC](https://discourse.cmake.org/t/cpack-dependencies-shared-library/1687 "2021-01-04T21:36:53Z")

</div>

Hello, I’m trying to package my shared library with dependencies and I’m using the below code: # # CPack Properties # set(CPACK\_PACKAGE\_VERSION\_MAJOR "1") set(CPACK\_PACKAGE\_VERSION\_MINOR "1") set(CPACK\_PACKAGE\_VERSION\_…

---

## [arm64 / UWP / WinRT for HoloLens 2](https://discourse.cmake.org/t/arm64-uwp-winrt-for-hololens-2/1497)

<div class="topic-metadata">

**Author:** [@TWHall](https://discourse.cmake.org/u/TWHall)\
**Replies:** 5\
**Last updated:** [January 4, 2021, 8:53pm UTC](https://discourse.cmake.org/t/arm64-uwp-winrt-for-hololens-2/1497 "2021-01-04T20:53:16Z")

</div>

Visual Studio 2019 / CMAKE\_VERSION = 3.16.19112601-MSVC\_2 Trying to build an arm64 / UWP / WinRT package, ultimately for the HoloLens 2. I am successfully building an x64 / UWP / WinRT package for the desktop. I can …

---

## [cmake add\_custom\_command introduces false dependency unless add\_custom\_target also used](https://discourse.cmake.org/t/cmake-add-custom-command-introduces-false-dependency-unless-add-custom-target-also-used/2467)

<div class="topic-metadata">

**Author:** [@rhbroberg](https://discourse.cmake.org/u/rhbroberg)\
**Replies:** 3\
**Last updated:** [January 4, 2021, 8:38pm UTC](https://discourse.cmake.org/t/cmake-add-custom-command-introduces-false-dependency-unless-add-custom-target-also-used/2467 "2021-01-04T20:38:21Z")

</div>

I’m building some libraries, all of which generate some of their files. I’ve created the generated files using add\_custom\_command(), but I’ve discovered something which seems like a false dependency. If a downstream li…

---

## [What's the difference between this PROJ\_DATA\_SUBDIR and DATADIR when cmake is configuring the proj library?](https://discourse.cmake.org/t/whats-the-difference-between-this-proj-data-subdir-and-datadir-when-cmake-is-configuring-the-proj-library/2353)

<div class="topic-metadata">

**Author:** [@mirro187](https://discourse.cmake.org/u/mirro187)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 8:08pm UTC](https://discourse.cmake.org/t/whats-the-difference-between-this-proj-data-subdir-and-datadir-when-cmake-is-configuring-the-proj-library/2353 "2021-01-04T20:08:29Z")

</div>

---

## [generate or copy .dll of 3rd-party to executable folder](https://discourse.cmake.org/t/generate-or-copy-dll-of-3rd-party-to-executable-folder/2436)

<div class="topic-metadata">

**Author:** [@aopaw](https://discourse.cmake.org/u/aopaw)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 7:02pm UTC](https://discourse.cmake.org/t/generate-or-copy-dll-of-3rd-party-to-executable-folder/2436 "2021-01-04T19:02:12Z")

</div>

Hello, First time at here. I am using CMakeLists.txt to configure my project, a test project only. Suppose that the project depends on serveral 3rd-party libraries. Every of the libraries is in different directory and …

---

## [Include the bcm2835 library for the Raspberry Pi](https://discourse.cmake.org/t/include-the-bcm2835-library-for-the-raspberry-pi/2396)

<div class="topic-metadata">

**Author:** [@Krakert](https://discourse.cmake.org/u/Krakert)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 6:51pm UTC](https://discourse.cmake.org/t/include-the-bcm2835-library-for-the-raspberry-pi/2396 "2021-01-04T18:51:47Z")

</div>

Hello everyone, I\`m new to this forum and CMake. For a school project, we are working with c++. And we are using CMake to link and build the files. Now a few months in the project I’m working with the MLX90461 IR came…

---

## [How to control \_IMPORT\_PREFIX in exported Targets.cmake list file generated by cmake](https://discourse.cmake.org/t/how-to-control-import-prefix-in-exported-targets-cmake-list-file-generated-by-cmake/2291)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 6:47pm UTC](https://discourse.cmake.org/t/how-to-control-import-prefix-in-exported-targets-cmake-list-file-generated-by-cmake/2291 "2021-01-04T18:47:48Z")

</div>

The Target.cmake target list file generated by install(EXPORT…) has line that set \_IMPORT\_PREFIX to absolute path of the project that generates this file. Therefore the consuming project is not able to find files in imp…

---

## [Best practice for multi-config build options](https://discourse.cmake.org/t/best-practice-for-multi-config-build-options/2049)

<div class="topic-metadata">

**Author:** [@Dominik\_Charousset](https://discourse.cmake.org/u/Dominik_Charousset)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 6:41pm UTC](https://discourse.cmake.org/t/best-practice-for-multi-config-build-options/2049 "2021-01-04T18:41:17Z")

</div>

I’ve recently added flags to a project to enable sanitizers. To work nicely with multi-config generators, I’ve split the option into one for each configuration type. Much like CMAKE\_CXX\_FLAGS\_\<CONFIG\>. However, the solut…

---

## [Failure to install(EXPORT due to linked target already exported with another export set](https://discourse.cmake.org/t/failure-to-install-export-due-to-linked-target-already-exported-with-another-export-set/2040)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 6:33pm UTC](https://discourse.cmake.org/t/failure-to-install-export-due-to-linked-target-already-exported-with-another-export-set/2040 "2021-01-04T18:33:29Z")

</div>

I am getting error with cmake\_minimum\_required(VERSION 3.17). CMake Error: install(EXPORT "mypSubroj2Targets" ...) includes target "mypSubroj2shared" which requires target "mylogger" that is not in this export set, but …

---

## [link MKL libraries in Windows / Clion /Cmake](https://discourse.cmake.org/t/link-mkl-libraries-in-windows-clion-cmake/2046)

<div class="topic-metadata">

**Author:** [@ragnarokas](https://discourse.cmake.org/u/ragnarokas)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 6:32pm UTC](https://discourse.cmake.org/t/link-mkl-libraries-in-windows-clion-cmake/2046 "2021-01-04T18:32:36Z")

</div>

0 I am very new in CMake and I am trying to include MKL libraries in my project done in Clion. Compiler is MVS 2019 as required. Using MKL tool https://software.intel.com/content/www/us/en/develop/articles/intel-mkl-li…

---

## [Visual Studio Android support with recent NDK](https://discourse.cmake.org/t/visual-studio-android-support-with-recent-ndk/2441)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 6:09pm UTC](https://discourse.cmake.org/t/visual-studio-android-support-with-recent-ndk/2441 "2021-01-04T18:09:10Z")

</div>

Has anyone attempted to use the new Visual Studio NDK support with a NDK more recent than what comes with Visual Studio (which is ancient r16)? I’ve been trying to get this working for a while now and with the changes ma…

---

## [Specifying compile language for \<stdint.h\> as C, not C++. Editing a MCU Project (coded using Keil) in VS](https://discourse.cmake.org/t/specifying-compile-language-for-stdint-h-as-c-not-c-editing-a-mcu-project-coded-using-keil-in-vs/1884)

<div class="topic-metadata">

**Author:** [@CharlvdM](https://discourse.cmake.org/u/CharlvdM)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 3:34pm UTC](https://discourse.cmake.org/t/specifying-compile-language-for-stdint-h-as-c-not-c-editing-a-mcu-project-coded-using-keil-in-vs/1884 "2021-01-04T15:34:58Z")

</div>

I have a working project for a STM32F746 microcontroller (MCU) that was coded using the Keil IDE. The project makes use of many of STMicroelectronics’ HAL libraries. I would like to continue working on the project using …

---

## [wxWidgets 3.1 error finding two libraries with MinGW](https://discourse.cmake.org/t/wxwidgets-3-1-error-finding-two-libraries-with-mingw/1691)

<div class="topic-metadata">

**Author:** [@hobbes1069](https://discourse.cmake.org/u/hobbes1069)\
**Replies:** 4\
**Last updated:** [January 4, 2021, 3:33pm UTC](https://discourse.cmake.org/t/wxwidgets-3-1-error-finding-two-libraries-with-mingw/1691 "2021-01-04T15:33:15Z")

</div>

I’ve had this working before but… I’m building a cross platform project that uses wxWidgets. Currently I’m cross-compiling windows 64bit from Fedora linux. The project performs a bootstrap build of wxWidgets if required…

---

## [The findMPI in Cmake 3.18 can not find MSMPI for Fortran](https://discourse.cmake.org/t/the-findmpi-in-cmake-3-18-can-not-find-msmpi-for-fortran/1791)

<div class="topic-metadata">

**Author:** [@tmishima](https://discourse.cmake.org/u/tmishima)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 3:26pm UTC](https://discourse.cmake.org/t/the-findmpi-in-cmake-3-18-can-not-find-msmpi-for-fortran/1791 "2021-01-04T15:26:19Z")

</div>

Hi folks, The findMPI in Cmake 3.18 cannot find MSMPI for Fortran, which set MPI\_Fortran\_WORKS=False. On the other hand, the findMPI in Cmake 3.16.2 does find MSMPI successfully. A workaround so far is: if(WIN32 AND …

---

## [Linking to a prebuilt library](https://discourse.cmake.org/t/linking-to-a-prebuilt-library/1733)

<div class="topic-metadata">

**Author:** [@developer](https://discourse.cmake.org/u/developer)\
**Replies:** 3\
**Last updated:** [January 4, 2021, 3:20pm UTC](https://discourse.cmake.org/t/linking-to-a-prebuilt-library/1733 "2021-01-04T15:20:18Z")

</div>

I am trying to link to a specific QNX library for the architecture I’m cross compiling for. Let’s call that library foo. I have a QNX toolchain file very similar to the example in the toolchains.cmake documentation. I w…

---

## [Use include paths extracted from an external source](https://discourse.cmake.org/t/use-include-paths-extracted-from-an-external-source/1716)

<div class="topic-metadata">

**Author:** [@dushara](https://discourse.cmake.org/u/dushara)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 3:17pm UTC](https://discourse.cmake.org/t/use-include-paths-extracted-from-an-external-source/1716 "2021-01-04T15:17:06Z")

</div>

Hello all, I’m working on an embedded project built on top of IAR Embedded Workbench. One of the tasks I’m working on here is adding unit tests that will be running in a host environment (Windows for the devs and Linux…

---

## [How to add linker directories to cmake gtest\_discover\_tests](https://discourse.cmake.org/t/how-to-add-linker-directories-to-cmake-gtest-discover-tests/1704)

<div class="topic-metadata">

**Author:** [@gil.kalish](https://discourse.cmake.org/u/gil.kalish)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 3:15pm UTC](https://discourse.cmake.org/t/how-to-add-linker-directories-to-cmake-gtest-discover-tests/1704 "2021-01-04T15:15:27Z")

</div>

0 I’m using cmake and gtest for my project. My gtest executable is using the same name as the program executable. I know this is not ideal but I cannot change it. The compiler I’m using is installed in a different dire…

---

## [Export sets with targets in subdirectory](https://discourse.cmake.org/t/export-sets-with-targets-in-subdirectory/1694)

<div class="topic-metadata">

**Author:** [@tpb](https://discourse.cmake.org/u/tpb)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 3:13pm UTC](https://discourse.cmake.org/t/export-sets-with-targets-in-subdirectory/1694 "2021-01-04T15:13:30Z")

</div>

I am attempting to install my project foo which has a dependency bar which is included as a git submodule and consumed in my cmake project via add\_subdirectory(bar). bar is a library that is intended to be consumed via a…

---

## [The Zen of integrating 3rd party packages](https://discourse.cmake.org/t/the-zen-of-integrating-3rd-party-packages/1318)

<div class="topic-metadata">

**Author:** [@jwm](https://discourse.cmake.org/u/jwm)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 3:06pm UTC](https://discourse.cmake.org/t/the-zen-of-integrating-3rd-party-packages/1318 "2021-01-04T15:06:57Z")

</div>

I’m updating my build chain (new compilers, updated 3rd party versions and such) and I want to clean up some of the cruft of our original naive implementations. I have at least 3 different ways external packages are int…

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

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