# Development

**URL:** https://discourse.cmake.org/c/development/9.md?page=16

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

**Page:** 17

---

## [gcc on mac can't build cmake](https://discourse.cmake.org/t/gcc-on-mac-cant-build-cmake/4755)

<div class="topic-metadata">

**Author:** [@iwata](https://discourse.cmake.org/u/iwata)\
**Replies:** 5\
**Last updated:** [January 2, 2022, 10:17am UTC](https://discourse.cmake.org/t/gcc-on-mac-cant-build-cmake/4755 "2022-01-02T10:17:51Z")

</div>

I hope #include \<memory\> is added to cmMachO.h. ‘string’ of libc++ includes ‘memory’. But ‘string’ of libstdc++ does not. As a result, though clang can compile cmMachO.cxx, gcc can not. Consider please.

---

## [Error while adding add\_subdirectory command..How to fix this??](https://discourse.cmake.org/t/error-while-adding-add-subdirectory-command-how-to-fix-this/4738)

<div class="topic-metadata">

**Author:** [@vasantharaj](https://discourse.cmake.org/u/vasantharaj)\
**Replies:** 1\
**Last updated:** [December 27, 2021, 8:29pm UTC](https://discourse.cmake.org/t/error-while-adding-add-subdirectory-command-how-to-fix-this/4738 "2021-12-27T20:29:51Z")

</div>

This are the commands given##### add\_subdirectory (../target\_common/BSW/AUTOSAR ./temp/autosar) add\_subdirectory (../target\_common/BSW/CANTRCV\_HS\_GB/CanTrcv\_VALEO\_AR402 ./temp/CANTRCV\_HS\_GB) add\_subdirectory (../tar…

---

## [Tracked down difficult bug: caused by try\_compile() using -D${\_var}](https://discourse.cmake.org/t/tracked-down-difficult-bug-caused-by-try-compile-using-d-var/4736)

<div class="topic-metadata">

**Author:** [@walki](https://discourse.cmake.org/u/walki)\
**Replies:** 1\
**Last updated:** [December 26, 2021, 8:58am UTC](https://discourse.cmake.org/t/tracked-down-difficult-bug-caused-by-try-compile-using-d-var/4736 "2021-12-26T08:58:11Z")

</div>

Hi, In my primecount project I added the following test to check if \_\_int128\_t is supported by the C++ compiler and the C++ standard library: check\_cxx\_source\_compiles(" #include \<limits\> #include \<type\_traits\> …

---

## [naming conventions for CMake functions](https://discourse.cmake.org/t/naming-conventions-for-cmake-functions/4615)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 2\
**Last updated:** [December 7, 2021, 5:37pm UTC](https://discourse.cmake.org/t/naming-conventions-for-cmake-functions/4615 "2021-12-07T17:37:40Z")

</div>

In general, CMake functions use the following naming convention: command names are all lowercase with words separated by underscores For example: ExternalData\_add\_test(...) ExternalData\_add\_target(...) ExternalData\_ex…

---

## [Bugg in CPack Generator for FreeBSD?](https://discourse.cmake.org/t/bugg-in-cpack-generator-for-freebsd/4672)

<div class="topic-metadata">

**Author:** [@P.O\_Jonsson](https://discourse.cmake.org/u/P.O_Jonsson)\
**Replies:** 0\
**Last updated:** [December 15, 2021, 2:09pm UTC](https://discourse.cmake.org/t/bugg-in-cpack-generator-for-freebsd/4672 "2021-12-15T14:09:01Z")

</div>

To whom it may concern I am having problem with CPack creating pkg packages for FreeBSD 13. In CPack that can be installed from repository there is no FREEBSD CPack generator. I followed this suggestion: https://stacko…

---

## [Feature Request: setting find\_package versions via env/cmake variables](https://discourse.cmake.org/t/feature-request-setting-find-package-versions-via-env-cmake-variables/4661)

<div class="topic-metadata">

**Author:** [@milianw](https://discourse.cmake.org/u/milianw)\
**Replies:** 9\
**Last updated:** [December 15, 2021, 8:30am UTC](https://discourse.cmake.org/t/feature-request-setting-find-package-versions-via-env-cmake-variables/4661 "2021-12-15T08:30:12Z")

</div>

Hey there, ArchLinux just rolled out Python 3.10 leading to all sorts of incompatibilities. In one of our project that aggregates multiple other third parties, this leads to lots of havoc. What’s worse, I think I have n…

---

## [Feature Request: add\_custom\_comand CONFIGURATIONS option](https://discourse.cmake.org/t/feature-request-add-custom-comand-configurations-option/4664)

<div class="topic-metadata">

**Author:** [@scottaronbloom](https://discourse.cmake.org/u/scottaronbloom)\
**Replies:** 1\
**Last updated:** [December 14, 2021, 7:08pm UTC](https://discourse.cmake.org/t/feature-request-add-custom-comand-configurations-option/4664 "2021-12-14T19:08:55Z")

</div>

Please see add\_custom\_command with generator config commands - #7 by scottaronbloom It would be great, and a natural extension of the add\_custom\_command functionality if it supported the CONFIGURATIONS parameter in the …

---

## [Planning change that might break LANG\_INCLUDE\_WHAT\_YOU\_USE](https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598)

<div class="topic-metadata">

**Author:** [@kimgr](https://discourse.cmake.org/u/kimgr)\
**Replies:** 3\
**Last updated:** [December 6, 2021, 6:00pm UTC](https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598 "2021-12-06T18:00:16Z")

</div>

Hello, I maintain the include-what-you-use project and was surprised and happy to see native CMake support for IWYU in version 3.3 – thanks! We’re planning a change to abandon include-what-you-use's unusual exit code p…

---

## [SetupForDevelopment.sh | SSL certificate problem](https://discourse.cmake.org/t/setupfordevelopment-sh-ssl-certificate-problem/4520)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 10\
**Last updated:** [December 4, 2021, 4:34pm UTC](https://discourse.cmake.org/t/setupfordevelopment-sh-ssl-certificate-problem/4520 "2021-12-04T16:34:30Z")

</div>

Unable to run SetupForDevelopment.sh script on Windows. I get the following error and I’m unable to install the git hooks. Setting up git hooks... fatal: unable to access 'https://gitlab.kitware.com/utils/gitsetup.git/'…

---

## [Android NDK r23 with CMake 3.21 or later](https://discourse.cmake.org/t/android-ndk-r23-with-cmake-3-21-or-later/4577)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 5\
**Last updated:** [December 4, 2021, 10:33am UTC](https://discourse.cmake.org/t/android-ndk-r23-with-cmake-3-21-or-later/4577 "2021-12-04T10:33:22Z")

</div>

I’m working through building for Android, specifically with NDK r23. From that NDK release, we should be back to a fully supported arrangement again if we are using CMake 3.21 or later. I want to record here things I fin…

---

## [CMake Error "could not find any instance of Visual Studio"](https://discourse.cmake.org/t/cmake-error-could-not-find-any-instance-of-visual-studio/3164)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 4\
**Last updated:** [December 4, 2021, 4:12am UTC](https://discourse.cmake.org/t/cmake-error-could-not-find-any-instance-of-visual-studio/3164 "2021-12-04T04:12:01Z")

</div>

Had this issue at work. When of my colleagues (let’s call him Bob) messaged me with the following error: cmake -S . -B build/ -G "Visual Studio 16 2019" CMake Error at CMakeLists.txt:11 (project): Generator Vi…

---

## [Why was globbing added to CMake?](https://discourse.cmake.org/t/why-was-globbing-added-to-cmake/4579)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 2\
**Last updated:** [December 1, 2021, 11:03pm UTC](https://discourse.cmake.org/t/why-was-globbing-added-to-cmake/4579 "2021-12-01T23:03:33Z")

</div>

It’s bad practice to use globbing for adding source files. Even so I still decided to learn the hard way. Even other build systems seem to agree when I read their docs. So why was it added?

---

## [Issues for newbies like me to solve](https://discourse.cmake.org/t/issues-for-newbies-like-me-to-solve/4566)

<div class="topic-metadata">

**Author:** [@FallenValkyrie](https://discourse.cmake.org/u/FallenValkyrie)\
**Replies:** 2\
**Last updated:** [November 29, 2021, 1:18pm UTC](https://discourse.cmake.org/t/issues-for-newbies-like-me-to-solve/4566 "2021-11-29T13:18:13Z")

</div>

Hi, I’m new to this community, so are there any issues that newbies like me can solve?

---

## [Thank you: Dynamic libraries](https://discourse.cmake.org/t/thank-you-dynamic-libraries/4569)

<div class="topic-metadata">

**Author:** [@kfsone](https://discourse.cmake.org/u/kfsone)\
**Replies:** 0\
**Last updated:** [November 28, 2021, 11:20pm UTC](https://discourse.cmake.org/t/thank-you-dynamic-libraries/4569 "2021-11-28T23:20:20Z")

</div>

I’ve worked at a few well-known organizations where the decision not to use CMake could ultimately be anchored on what it took to ask CMake to do a most trivial of build-system things: build “myexe” in ${build\_dir} and c…

---

## [if(something) strikes again](https://discourse.cmake.org/t/if-something-strikes-again/4330)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 6\
**Last updated:** [November 28, 2021, 10:02am UTC](https://discourse.cmake.org/t/if-something-strikes-again/4330 "2021-11-28T10:02:22Z")

</div>

The behavior of if(something) continues to be a source of ongoing gotchas, even with CMP0054 set to NEW. Consider this code sample (run it with cmake -P \<filename\>): cmake\_minimum\_required(VERSION 3.21) # Show this jus…

---

## [Generator : writing a new generator for AtmelStudio 7 IDE](https://discourse.cmake.org/t/generator-writing-a-new-generator-for-atmelstudio-7-ide/1818)

<div class="topic-metadata">

**Author:** [@bebenlebricolo](https://discourse.cmake.org/u/bebenlebricolo)\
**Replies:** 16\
**Last updated:** [November 25, 2021, 4:22pm UTC](https://discourse.cmake.org/t/generator-writing-a-new-generator-for-atmelstudio-7-ide/1818 "2021-11-25T16:22:24Z")

</div>

Hi there, I would like to implement an extra generator for the AtmelStudio7 IDE (based on top of VisualStudio 14, with which it shares the Solution files structure). As AS7 shares the VisualStudio base file structure, …

---

## [Support for \`dotnet\` CLI and ninja generator for C#](https://discourse.cmake.org/t/support-for-dotnet-cli-and-ninja-generator-for-c/4304)

<div class="topic-metadata">

**Author:** [@bhardwajs](https://discourse.cmake.org/u/bhardwajs)\
**Replies:** 21\
**Last updated:** [November 24, 2021, 1:57pm UTC](https://discourse.cmake.org/t/support-for-dotnet-cli-and-ninja-generator-for-c/4304 "2021-11-24T13:57:31Z")

</div>

CMake supports C# using VS generator with the project files in line with .Net Framework projects. .Net also has .Net Project SDKs which enables building and running the projects on multiple platforms using .Net CLI. Cur…

---

## [Add GLOBBING support to target\_sources?](https://discourse.cmake.org/t/add-globbing-support-to-target-sources/3749)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 10\
**Last updated:** [November 18, 2021, 5:13pm UTC](https://discourse.cmake.org/t/add-globbing-support-to-target-sources/3749 "2021-11-18T17:13:27Z")

</div>

Currently here are 2 common patterns in our CMake codebase. Since we really like the safe globbing functionality added in 3.13. What is already possible # SAFE GLOBBING! :D file(GLOB\_RECURSE sources CONFIGURE\_DEPENDS \*.…

---

## [Variables available to code in install(SCRIPT) and install(CODE)](https://discourse.cmake.org/t/variables-available-to-code-in-install-script-and-install-code/4484)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 4\
**Last updated:** [November 15, 2021, 2:11pm UTC](https://discourse.cmake.org/t/variables-available-to-code-in-install-script-and-install-code/4484 "2021-11-15T14:11:50Z")

</div>

I was looking into what variables we document as being available to install(SCRIPT) and install(CODE). I was surprised that we don’t seem to document any. I expect that at the very least, we would guarantee that CMAKE\_IN…

---

## [Fortran\_MODULE\_DIRECTORY](https://discourse.cmake.org/t/fortran-module-directory/4462)

<div class="topic-metadata">

**Author:** [@lguez](https://discourse.cmake.org/u/lguez)\
**Replies:** 2\
**Last updated:** [November 11, 2021, 10:26am UTC](https://discourse.cmake.org/t/fortran-module-directory/4462 "2021-11-11T10:26:11Z")

</div>

Hello. The default location for Fortran compiler-generated .mod files is ${CMAKE\_CURRENT\_BINARY\_DIR}. I think this is really a problem. Suppose a given source file belongs to several targets, in the same source directo…

---

## [Force ignore \`add\_subdirectory\` for project](https://discourse.cmake.org/t/force-ignore-add-subdirectory-for-project/4432)

<div class="topic-metadata">

**Author:** [@zaufi](https://discourse.cmake.org/u/zaufi)\
**Replies:** 3\
**Last updated:** [November 9, 2021, 11:07am UTC](https://discourse.cmake.org/t/force-ignore-add-subdirectory-for-project/4432 "2021-11-09T11:07:45Z")

</div>

I quite frequently build third-party CMake-based packages, and many of them do not provide options to skip building some parts that are (in fact) optional or not required at all for my purposes (like tests, sometimes bui…

---

## [Does DEPENDS in add\_custom\_target() support generator expressions?](https://discourse.cmake.org/t/does-depends-in-add-custom-target-support-generator-expressions/4047)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 3\
**Last updated:** [November 7, 2021, 8:42pm UTC](https://discourse.cmake.org/t/does-depends-in-add-custom-target-support-generator-expressions/4047 "2021-11-07T20:42:32Z")

</div>

According to the docs, the DEPENDS arguments for add\_custom\_command() support generator expressions. I was surprised to see that the similar DEPENDS argument for add\_custom\_target() is not documented as supporting them. …

---

## [GHS choosing target architecture and platform is clumsy](https://discourse.cmake.org/t/ghs-choosing-target-architecture-and-platform-is-clumsy/4423)

<div class="topic-metadata">

**Author:** [@fdk17](https://discourse.cmake.org/u/fdk17)\
**Replies:** 2\
**Last updated:** [November 6, 2021, 2:45am UTC](https://discourse.cmake.org/t/ghs-choosing-target-architecture-and-platform-is-clumsy/4423 "2021-11-06T02:45:49Z")

</div>

After using the Green Hills MULTI generator for a while I find setting up the build a bit clumsy and inconsistent. In the build files themselves there is a field called primaryTarget which tells the build system what co…

---

## [CMake-Gui | Merge the configure/generate button](https://discourse.cmake.org/t/cmake-gui-merge-the-configure-generate-button/4422)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 2\
**Last updated:** [November 4, 2021, 3:13pm UTC](https://discourse.cmake.org/t/cmake-gui-merge-the-configure-generate-button/4422 "2021-11-04T15:13:47Z")

</div>

For a long time I would press the configure button then the generate button. Later I realized you just have to press the generate button. In order to avoid confusion there should only be 1 button. I realize configur…

---

## [Response files for RC files](https://discourse.cmake.org/t/response-files-for-rc-files/4395)

<div class="topic-metadata">

**Author:** [@ocroquette](https://discourse.cmake.org/u/ocroquette)\
**Replies:** 2\
**Last updated:** [November 3, 2021, 4:00pm UTC](https://discourse.cmake.org/t/response-files-for-rc-files/4395 "2021-11-03T16:00:40Z")

</div>

Hello, we have hit once again the great wall of too long paths on Windows. This time, it is due to resource files. We use ninja as a generator. The command line to compile RC files looks like: C:\\Path\\mingw64\\bin\\windr…

---

## [Qt IFW test suite](https://discourse.cmake.org/t/qt-ifw-test-suite/4409)

<div class="topic-metadata">

**Author:** [@erlendaasland](https://discourse.cmake.org/u/erlendaasland)\
**Replies:** 0\
**Last updated:** [November 3, 2021, 11:18am UTC](https://discourse.cmake.org/t/qt-ifw-test-suite/4409 "2021-11-03T11:18:25Z")

</div>

Hi, y’all I’ll be trying to put together a test suite for the CPackIFW (Qt Installer Framework) module / cpack generator, however I by no means have a complete understanding of the Qt IFW, so any help will be appreciate…

---

## [FindMPI: Choosing an MPI release outside the PATH](https://discourse.cmake.org/t/findmpi-choosing-an-mpi-release-outside-the-path/4394)

<div class="topic-metadata">

**Author:** [@alex-m](https://discourse.cmake.org/u/alex-m)\
**Replies:** 2\
**Last updated:** [November 1, 2021, 5:43pm UTC](https://discourse.cmake.org/t/findmpi-choosing-an-mpi-release-outside-the-path/4394 "2021-11-01T17:43:12Z")

</div>

MPI is a standard with multiple implementations, some academic and others commercial. MPI implementations typically wrap the compiler, so to use it you would normally build your code with mpicc (which adds MPI’s include …

---

## [cmake-mode: forward-symbol with](https://discourse.cmake.org/t/cmake-mode-forward-symbol-with/4339)

<div class="topic-metadata">

**Author:** [@yashi](https://discourse.cmake.org/u/yashi)\
**Replies:** 0\
**Last updated:** [October 25, 2021, 2:23pm UTC](https://discourse.cmake.org/t/cmake-mode-forward-symbol-with/4339 "2021-10-25T14:23:06Z")

</div>

Hi there, $\<TARGET\_PROPERTY:compiler,|security\_fortify\> When I my cursor is at |, I expect it to move to between fortify and \> after M-x forward-symbol. but it ends up end-of-line (after \>). Is this a bug in \`cmake-…

---

## [Convention over Configuration for dependency management](https://discourse.cmake.org/t/convention-over-configuration-for-dependency-management/2020)

<div class="topic-metadata">

**Author:** [@friendlyanon](https://discourse.cmake.org/u/friendlyanon)\
**Replies:** 3\
**Last updated:** [October 24, 2021, 6:50am UTC](https://discourse.cmake.org/t/convention-over-configuration-for-dependency-management/2020 "2021-10-24T06:50:05Z")

</div>

CMake should have a mechanism to load a file before the top lists file is loaded, that could overwrite find\_package() with a function that does dependency fetching based on a small config file. Something like PreLoad.cm…

---

## [Feature-Idea: \`FetchContent\` allow configurable '{target}-src' folder i.e. Allow single source clone across build configurations](https://discourse.cmake.org/t/feature-idea-fetchcontent-allow-configurable-target-src-folder-i-e-allow-single-source-clone-across-build-configurations/4213)

<div class="topic-metadata">

**Author:** [@CraigEmteq](https://discourse.cmake.org/u/CraigEmteq)\
**Replies:** 5\
**Last updated:** [October 20, 2021, 8:19am UTC](https://discourse.cmake.org/t/feature-idea-fetchcontent-allow-configurable-target-src-folder-i-e-allow-single-source-clone-across-build-configurations/4213 "2021-10-20T08:19:06Z")

</div>

Perceived issue with FetchContent In a multi configuration build e.g. Windows+Android+Linux any fetched repository is Clone separately into every build folder. Duplicate bandwidth for download/update of each configurat…

[Previous page](https://discourse.cmake.org/c/development/9.md?page=15)

[Next page](https://discourse.cmake.org/c/development/9.md?page=17)
