# Latest

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

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

**Page:** 180

---

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

---

## [Professional CMake: A Practical Guide 8th Edition](https://discourse.cmake.org/t/professional-cmake-a-practical-guide-8th-edition/2465)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 0\
**Last updated:** [January 4, 2021, 8:25am UTC](https://discourse.cmake.org/t/professional-cmake-a-practical-guide-8th-edition/2465 "2021-01-04T08:25:20Z")

</div>

The 8th Edition of the book Professional CMake: A Practical Guide is now available. It has been updated for the CMake 3.19 release, including some fixes added up to 3.19.2. The main highlights for this edition include: …

---

## [How to turn off warning flags for project added by FetchContent\_Declare?](https://discourse.cmake.org/t/how-to-turn-off-warning-flags-for-project-added-by-fetchcontent-declare/2461)

<div class="topic-metadata">

**Author:** [@Adam\_Badura](https://discourse.cmake.org/u/Adam_Badura)\
**Replies:** 1\
**Last updated:** [January 3, 2021, 11:49am UTC](https://discourse.cmake.org/t/how-to-turn-off-warning-flags-for-project-added-by-fetchcontent-declare/2461 "2021-01-03T11:49:47Z")

</div>

In our project, we have a global done at the root directory add\_compile\_options( -Wundef # (...) ) However, a problem appeared with FetchContent for Google Test. The build this creates “inherits” the -Wundef. H…

---

## [cmake imported library and precompiled headers](https://discourse.cmake.org/t/cmake-imported-library-and-precompiled-headers/2459)

<div class="topic-metadata">

**Author:** [@elpie89](https://discourse.cmake.org/u/elpie89)\
**Replies:** 5\
**Last updated:** [January 2, 2021, 7:23pm UTC](https://discourse.cmake.org/t/cmake-imported-library-and-precompiled-headers/2459 "2021-01-02T19:23:16Z")

</div>

I have a simple CMake project organized like this: ExternalDependencies -\>glm CMakeLists.txt MasterFolder CMakeLists.txt (A) -\>src CMakeLists.txt (B) -\>include precompiled\_header.h (A) looks like this: projec…

---

## [FetchContent with loose .cmake files](https://discourse.cmake.org/t/fetchcontent-with-loose-cmake-files/2451)

<div class="topic-metadata">

**Author:** [@tomhh](https://discourse.cmake.org/u/tomhh)\
**Replies:** 4\
**Last updated:** [January 2, 2021, 9:54am UTC](https://discourse.cmake.org/t/fetchcontent-with-loose-cmake-files/2451 "2021-01-02T09:54:59Z")

</div>

Calling @craig.scott :slight\_smile: I’ve been reading your excellent Professional CMake book and have got to the section about other uses for FetchContent (27.2.2). It talks about being able to pull down individual .cma…

---

## [How to get listing file when cross compile](https://discourse.cmake.org/t/how-to-get-listing-file-when-cross-compile/2297)

<div class="topic-metadata">

**Author:** [@Massimiliano\_Cialdi](https://discourse.cmake.org/u/Massimiliano_Cialdi)\
**Replies:** 15\
**Last updated:** [January 1, 2021, 8:52pm UTC](https://discourse.cmake.org/t/how-to-get-listing-file-when-cross-compile/2297 "2021-01-01T20:52:36Z")

</div>

I’m using cmake 3.16.3 on xubuntu 20.04 to cross-compile a bare metal project that will run on ARM cortex-m7 microcontroller. The project is structured in subdirectories, and for this I use the add\_subdirectory() comman…

---

## [Would like to disable cmake dev warning](https://discourse.cmake.org/t/would-like-to-disable-cmake-dev-warning/2450)

<div class="topic-metadata">

**Author:** [@boxerab](https://discourse.cmake.org/u/boxerab)\
**Replies:** 5\
**Last updated:** [January 1, 2021, 8:23pm UTC](https://discourse.cmake.org/t/would-like-to-disable-cmake-dev-warning/2450 "2021-01-01T20:23:09Z")

</div>

My cmake script searches for Perl libs, but I get the following warning message: CMake Warning (dev) at cmake-install/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message): The package name passed…

---

## [Specify \<lib\>-prefix folder destination](https://discourse.cmake.org/t/specify-lib-prefix-folder-destination/2449)

<div class="topic-metadata">

**Author:** [@kerim](https://discourse.cmake.org/u/kerim)\
**Replies:** 2\
**Last updated:** [January 1, 2021, 1:14pm UTC](https://discourse.cmake.org/t/specify-lib-prefix-folder-destination/2449 "2021-01-01T13:14:18Z")

</div>

Happy New Year! Work less earn much :smiley: When I build external project using ExternalProject\_Add usually I can see three folders: \<lib\> (source folder) \<lib\>-build (build folder) \<lib\>-install (install …

---

## [Profiling build performance?](https://discourse.cmake.org/t/profiling-build-performance/2443)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 2\
**Last updated:** [December 31, 2020, 6:17pm UTC](https://discourse.cmake.org/t/profiling-build-performance/2443 "2020-12-31T18:17:52Z")

</div>

I’d like to profile the performance of my cmake ninja build. To see how I can improve my build/linker speed. Ideally I’d like to be able to distinguish compile vs linker time. Because my project is being bottlenecked at…

---

## [Referencing file in CMake function shipped via \*Config.cmake](https://discourse.cmake.org/t/referencing-file-in-cmake-function-shipped-via-config-cmake/2447)

<div class="topic-metadata">

**Author:** [@Nicholas\_Yue](https://discourse.cmake.org/u/Nicholas_Yue)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 8:36pm UTC](https://discourse.cmake.org/t/referencing-file-in-cmake-function-shipped-via-config-cmake/2447 "2020-12-30T20:36:04Z")

</div>

Hi I am planning to ship a convenience CMake function for developers as part of the \*Config.cmake file. That function depends on a python script. function(myfunction) ... set(\_command Python::Interpreter "WHAT TO …

---

## [Please put CMakeCache.txt into invalid state when compiler not found](https://discourse.cmake.org/t/please-put-cmakecache-txt-into-invalid-state-when-compiler-not-found/1564)

<div class="topic-metadata">

**Author:** [@Juan\_Sanchez](https://discourse.cmake.org/u/Juan_Sanchez)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 8:05pm UTC](https://discourse.cmake.org/t/please-put-cmakecache-txt-into-invalid-state-when-compiler-not-found/1564 "2020-12-30T20:05:10Z")

</div>

Using the CMake generator with Makefiles on macOS and Linux: If the compiler is not available and the generator fails, a CMakeCache.txt is written with empty compiler flags. When I run cmake a second time, with the com…

---

## [Help with component packaging](https://discourse.cmake.org/t/help-with-component-packaging/1510)

<div class="topic-metadata">

**Author:** [@lfcarreon1](https://discourse.cmake.org/u/lfcarreon1)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 8:04pm UTC](https://discourse.cmake.org/t/help-with-component-packaging/1510 "2020-12-30T20:04:17Z")

</div>

Hi, I’m a beginner with CMake mainly learning by reading Craig Scott’s “Professional CMake: A Practical Guide”. I have successfully created a simple project and am now ready to move on to more complicated stuff. I have…

---

## [override discovered assember](https://discourse.cmake.org/t/override-discovered-assember/1448)

<div class="topic-metadata">

**Author:** [@melcher](https://discourse.cmake.org/u/melcher)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 7:59pm UTC](https://discourse.cmake.org/t/override-discovered-assember/1448 "2020-12-30T19:59:30Z")

</div>

\_find\_compiler\_path() does not consider CMAKE\_PREFIX\_PATH. ok, so be it. However, it also ignores PATH in the environment. argh. I’m using the gnu toolchain (gcc+binutils) and gcc happily finds a different assembler if…

---

## [How to force CMake 3.17 to search for a new generator on Windows 10 when both Visual Studio 15 AND Visual Studio 17 are installed ?](https://discourse.cmake.org/t/how-to-force-cmake-3-17-to-search-for-a-new-generator-on-windows-10-when-both-visual-studio-15-and-visual-studio-17-are-installed/1397)

<div class="topic-metadata">

**Author:** [@Bruce\_McIntyre](https://discourse.cmake.org/u/Bruce_McIntyre)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 7:59pm UTC](https://discourse.cmake.org/t/how-to-force-cmake-3-17-to-search-for-a-new-generator-on-windows-10-when-both-visual-studio-15-and-visual-studio-17-are-installed/1397 "2020-12-30T19:59:05Z")

</div>

I am trying to upgrade a large Visual Studio library project created using Visual Studio 15 to Visual Studio 17 and can’t get prebuilt CMake 3.17 binaries to search for a new generator. The problem is that the MSBuild d…

---

## [Can't force find\_library to find .dll suffix](https://discourse.cmake.org/t/cant-force-find-library-to-find-dll-suffix/1387)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 4\
**Last updated:** [December 30, 2020, 7:55pm UTC](https://discourse.cmake.org/t/cant-force-find-library-to-find-dll-suffix/1387 "2020-12-30T19:55:33Z")

</div>

When executing find\_library in find\_library(PostgreSQL\_LIBRARIES NAMES libpq.dll pq PATHS “${PQ\_ROOT}/src/interfaces/libpq” NO\_DEFAULT\_PATH NO\_SYSTEM\_ENVIRONMENT\_PATH NO\_CMAKE\_FIND\_ROOT\_PATH ) it debug report indi…

---

## [MACOSX\_BUNDLE and dynlibs](https://discourse.cmake.org/t/macosx-bundle-and-dynlibs/1294)

<div class="topic-metadata">

**Author:** [@Gonzalo\_Garramuno](https://discourse.cmake.org/u/Gonzalo_Garramuno)\
**Replies:** 2\
**Last updated:** [December 30, 2020, 7:54pm UTC](https://discourse.cmake.org/t/macosx-bundle-and-dynlibs/1294 "2020-12-30T19:54:14Z")

</div>

Hi. I am new to MacOSX and I am pulling my hair. I am creating an application on MacOSX that relies on multiple dynlibs and frameworks that get pulled from FindXXX.cmake or from direct linking them. I am looking for…

---

## [Post-compilation step](https://discourse.cmake.org/t/post-compilation-step/1265)

<div class="topic-metadata">

**Author:** [@cola](https://discourse.cmake.org/u/cola)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 7:50pm UTC](https://discourse.cmake.org/t/post-compilation-step/1265 "2020-12-30T19:50:30Z")

</div>

Hi! I have a project with several custom toolchains. When using one of the toolchains and building Release I have to do som post-compile processing of the object-files before linking, so currently I have a PRE\_LINK cust…

---

## [Universal way of checking if Python3 is set regardless of module used to do so](https://discourse.cmake.org/t/universal-way-of-checking-if-python3-is-set-regardless-of-module-used-to-do-so/2444)

<div class="topic-metadata">

**Author:** [@eriols](https://discourse.cmake.org/u/eriols)\
**Replies:** 2\
**Last updated:** [December 30, 2020, 5:38pm UTC](https://discourse.cmake.org/t/universal-way-of-checking-if-python3-is-set-regardless-of-module-used-to-do-so/2444 "2020-12-30T17:38:13Z")

</div>

In the usecase where my repo is a subrepo of someone else they might have set Python3 upstream using FindPythonInterp, FindPython or FindPython3 (maybe there are more ways even?). In such cases I want to point that execu…

---

## [Path Quoting Issues on MSYS2 MinGW64 When Building OBS](https://discourse.cmake.org/t/path-quoting-issues-on-msys2-mingw64-when-building-obs/2445)

<div class="topic-metadata">

**Author:** [@R030t1](https://discourse.cmake.org/u/R030t1)\
**Replies:** 1\
**Last updated:** [December 30, 2020, 9:14am UTC](https://discourse.cmake.org/t/path-quoting-issues-on-msys2-mingw64-when-building-obs/2445 "2020-12-30T09:14:52Z")

</div>

CMake tries to run “C:msys64mingw64bincc.exe”. I’ve tried to set the compiler explicitly but no dice. Is that the solution and what is the proper way, or is there something else? $ /mingw64/bin/cmake .. -GNinja -DQTDIR=…

---

## [CMake Deprecation Warning](https://discourse.cmake.org/t/cmake-deprecation-warning/2406)

<div class="topic-metadata">

**Author:** [@Junior27](https://discourse.cmake.org/u/Junior27)\
**Replies:** 3\
**Last updated:** [December 30, 2020, 1:58am UTC](https://discourse.cmake.org/t/cmake-deprecation-warning/2406 "2020-12-30T01:58:23Z")

</div>

Hello Sorry for my poor English and if question has been already solve. I have never used cmake, I only want to turn a radiosonde to an amateur radio direction finding contests. For this I want to use this tutorial on …

---

## [Needs endforeach() a lable with older cmake version?](https://discourse.cmake.org/t/needs-endforeach-a-lable-with-older-cmake-version/2442)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 1\
**Last updated:** [December 29, 2020, 4:05pm UTC](https://discourse.cmake.org/t/needs-endforeach-a-lable-with-older-cmake-version/2442 "2020-12-29T16:05:07Z")

</div>

Removing the arguments from endforeach() and endfunction() will not work with older versions of CMake, they were only made optional in CMake 3.14. Is that true?

---

## [ExternalProject\_Add project that depends on other external project](https://discourse.cmake.org/t/externalproject-add-project-that-depends-on-other-external-project/2437)

<div class="topic-metadata">

**Author:** [@kerim](https://discourse.cmake.org/u/kerim)\
**Replies:** 2\
**Last updated:** [December 29, 2020, 7:33am UTC](https://discourse.cmake.org/t/externalproject-add-project-that-depends-on-other-external-project/2437 "2020-12-29T07:33:05Z")

</div>

Hi, I can’t figure out the following situation: Let’ suppose that I have two external projects A and B that I build with ExternalProject\_Add so that B depends on A. In External\_B.cmake I write something like: Externa…

---

## [install works only for RUNTIME](https://discourse.cmake.org/t/install-works-only-for-runtime/2438)

<div class="topic-metadata">

**Author:** [@aopaw](https://discourse.cmake.org/u/aopaw)\
**Replies:** 6\
**Last updated:** [December 29, 2020, 6:41am UTC](https://discourse.cmake.org/t/install-works-only-for-runtime/2438 "2020-12-29T06:41:13Z")

</div>

Hello, I try to solve generating 3rd-party .dll files to the executable folder or install folder with install(TARGETS). The install works only for RUNTIME but not for LIBRARY others. Here is my code: INSTALL(TARGETS ${…

---

## [Including functions/macros with target export ?](https://discourse.cmake.org/t/including-functions-macros-with-target-export/2440)

<div class="topic-metadata">

**Author:** [@Nicholas\_Yue](https://discourse.cmake.org/u/Nicholas_Yue)\
**Replies:** 2\
**Last updated:** [December 29, 2020, 5:29am UTC](https://discourse.cmake.org/t/including-functions-macros-with-target-export/2440 "2020-12-29T05:29:37Z")

</div>

Hi, I am able to get export(TARGET …) working and have generated working \*Config.cmake file There are some cmake macros and functions that I would like to include for the convenience of the developers using the package…

---

## [How to blacklist Qt AUTO\* files](https://discourse.cmake.org/t/how-to-blacklist-qt-auto-files/2433)

<div class="topic-metadata">

**Author:** [@Dakon](https://discourse.cmake.org/u/Dakon)\
**Replies:** 1\
**Last updated:** [December 28, 2020, 8:31pm UTC](https://discourse.cmake.org/t/how-to-blacklist-qt-auto-files/2433 "2020-12-28T20:31:56Z")

</div>

I use CMAKE\_AUTO\* for several of my Qt projects. However, the files generated by this cause some unneeded noise that I would like to avoid. -the files show up in coverage reports, where I don’t want them -if I set CLA…

---

## [Detect old/new GCC ABI](https://discourse.cmake.org/t/detect-old-new-gcc-abi/2431)

<div class="topic-metadata">

**Author:** [@mmoelle1](https://discourse.cmake.org/u/mmoelle1)\
**Replies:** 1\
**Last updated:** [December 28, 2020, 4:15pm UTC](https://discourse.cmake.org/t/detect-old-new-gcc-abi/2431 "2020-12-28T16:15:02Z")

</div>

Dear all, Is there an approved way to detect if the compiler uses the pre-cxx11 ABI or the cxx11 ABI? In one of my projects I let CMake download libtorch and link my c++ code to it. To the best of my knowledge checking …

---

## [Can't find docstring display in QT cmake-gui](https://discourse.cmake.org/t/cant-find-docstring-display-in-qt-cmake-gui/2410)

<div class="topic-metadata">

**Author:** [@sse](https://discourse.cmake.org/u/sse)\
**Replies:** 2\
**Last updated:** [December 27, 2020, 9:39pm UTC](https://discourse.cmake.org/t/cant-find-docstring-display-in-qt-cmake-gui/2410 "2020-12-27T21:39:41Z")

</div>

In curses ccmake it’s there in a kind of status bar at the bottom, but in the QT GUI I don’t see it. I also did not find a configuration option to enable it. Is it really missing, or didn’t I look at the right place? V…

---

## [Looking for someone willing verify a minimal Xcode project on Apple Silicon](https://discourse.cmake.org/t/looking-for-someone-willing-verify-a-minimal-xcode-project-on-apple-silicon/2415)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 9\
**Last updated:** [December 24, 2020, 4:02pm UTC](https://discourse.cmake.org/t/looking-for-someone-willing-verify-a-minimal-xcode-project-on-apple-silicon/2415 "2020-12-24T16:02:47Z")

</div>

I’m trying to verify a minimal combination of settings that will allow an Xcode project to produce a universal binary on macOS. I don’t have access to an Apple Silicon machine, so I can only verify that it works on Intel…

---

## [VS generator add switch before /link switch](https://discourse.cmake.org/t/vs-generator-add-switch-before-link-switch/2425)

<div class="topic-metadata">

**Author:** [@amontse](https://discourse.cmake.org/u/amontse)\
**Replies:** 1\
**Last updated:** [December 24, 2020, 9:24am UTC](https://discourse.cmake.org/t/vs-generator-add-switch-before-link-switch/2425 "2020-12-24T09:24:19Z")

</div>

Hello, The following mimic command to be run during the Link stage is generated by CMake with VS generator: cl.exe /Fe"out.exe" main.obj /Zi /WX- /MDd /nologo /link /machine:x64 kernel32.lib user32.lib gdi32.lib winspo…

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

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