# Development

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

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

**Page:** 18

---

## [Why not to add \`dict()\` to CMake?](https://discourse.cmake.org/t/why-not-to-add-dict-to-cmake/896)

<div class="topic-metadata">

**Author:** [@zaufi](https://discourse.cmake.org/u/zaufi)\
**Replies:** 19\
**Last updated:** [October 18, 2021, 7:33am UTC](https://discourse.cmake.org/t/why-not-to-add-dict-to-cmake/896 "2021-10-18T07:33:59Z")

</div>

Hi, It really pains to store and manipulate key-value pairs nowadays in CMake. Why not add dict() command for that? dict(INSERT \<dict\_var\> \<key\> \<value\>) dict(REMOVE \<dict\_var\> \<key\>) dict(GET \<dict\_var\> \<key\> \<output…

---

## [Support for CUDA & ClangCL on Windows](https://discourse.cmake.org/t/support-for-cuda-clangcl-on-windows/1437)

<div class="topic-metadata">

**Author:** [@mojca](https://discourse.cmake.org/u/mojca)\
**Replies:** 2\
**Last updated:** [June 25, 2020, 7:42am UTC](https://discourse.cmake.org/t/support-for-cuda-clangcl-on-windows/1437 "2020-06-25T07:42:50Z")

</div>

When trying to build a simple CUDA project on Windows and optimistically specifying -T ClangCL, CMake complains about unknown CUDA compiler Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041. The CX…

---

## [Why are CPACK\_\* variables documented in two different places?](https://discourse.cmake.org/t/why-are-cpack-variables-documented-in-two-different-places/1525)

<div class="topic-metadata">

**Author:** [@jwuttke](https://discourse.cmake.org/u/jwuttke)\
**Replies:** 6\
**Last updated:** [October 14, 2021, 1:48pm UTC](https://discourse.cmake.org/t/why-are-cpack-variables-documented-in-two-different-places/1525 "2021-10-14T13:48:56Z")

</div>

Variables starting with “CPACK\_” control the behavior of CPack, right? Most of these variables are documented in the CPack help page. Some, however, are documented in the top-level variables list (https://cmake.org/cmake…

---

## [CMAKE\_FIND\_LIBRARY\_PREFIXES on Windows](https://discourse.cmake.org/t/cmake-find-library-prefixes-on-windows/4250)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 7\
**Last updated:** [October 12, 2021, 2:56pm UTC](https://discourse.cmake.org/t/cmake-find-library-prefixes-on-windows/4250 "2021-10-12T14:56:19Z")

</div>

This post was inspired by discussions in the Qt issue tracker here (it was a side-issue that emerged in the comments): https://bugreports.qt.io/browse/QTBUG-96401 On most platforms, libraries typically have a prefix of…

---

## [Feature request for PER\_FILE\_C\_OPT / PER\_FILE\_CXX\_OPT](https://discourse.cmake.org/t/feature-request-for-per-file-c-opt-per-file-cxx-opt/4228)

<div class="topic-metadata">

**Author:** [@cycheng](https://discourse.cmake.org/u/cycheng)\
**Replies:** 2\
**Last updated:** [October 8, 2021, 9:22am UTC](https://discourse.cmake.org/t/feature-request-for-per-file-c-opt-per-file-cxx-opt/4228 "2021-10-08T09:22:41Z")

</div>

Hi, When working on large codebase project, it would be very helpful if I can overwrite some files with different compiler option. For example, by default I was using Release to build the whole project, but when I want …

---

## [Sections in variables manual have unclear meanings](https://discourse.cmake.org/t/sections-in-variables-manual-have-unclear-meanings/4202)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 1\
**Last updated:** [October 4, 2021, 4:19pm UTC](https://discourse.cmake.org/t/sections-in-variables-manual-have-unclear-meanings/4202 "2021-10-04T16:19:50Z")

</div>

The cmake-variables manual contains the following sections: Variables that Provide Information Variables that Change Behavior Variables that Describe the System Variables that Control the Build Variables for Languages V…

---

## [bootstrap script seems to support building more than it needs to](https://discourse.cmake.org/t/bootstrap-script-seems-to-support-building-more-than-it-needs-to/4195)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 2\
**Last updated:** [October 4, 2021, 4:10pm UTC](https://discourse.cmake.org/t/bootstrap-script-seems-to-support-building-more-than-it-needs-to/4195 "2021-10-04T16:10:27Z")

</div>

Does anyone know why the bootstrap script has options for enabling building the Qt GUI and running Sphinx? Neither of those seem like things that the bootstrap script should be doing. I would have expected the bootstrap …

---

## [Looking to contribute via bug fixing](https://discourse.cmake.org/t/looking-to-contribute-via-bug-fixing/4006)

<div class="topic-metadata">

**Author:** [@mwilbur](https://discourse.cmake.org/u/mwilbur)\
**Replies:** 6\
**Last updated:** [October 3, 2021, 8:19pm UTC](https://discourse.cmake.org/t/looking-to-contribute-via-bug-fixing/4006 "2021-10-03T20:19:32Z")

</div>

Hello everyone I use CMake everyday and would like to learn it better by fixing some bugs. However, after an (albeit brief) look around I didn’t see any guidelines on how to start doing this. I can peruse the bug list…

---

## [Possible regression with c564a3e3 in CMake 3.21](https://discourse.cmake.org/t/possible-regression-with-c564a3e3-in-cmake-3-21/4167)

<div class="topic-metadata">

**Author:** [@akleber](https://discourse.cmake.org/u/akleber)\
**Replies:** 2\
**Last updated:** [September 30, 2021, 6:18am UTC](https://discourse.cmake.org/t/possible-regression-with-c564a3e3-in-cmake-3-21/4167 "2021-09-30T06:18:56Z")

</div>

My use case is building a Fortran project with CMake, Ninja, Intel Fortran Compiler through Conan on Windows. Commit c564a3e3 “Ninja: Always compile sources using absolute paths” included in CMake 3.21 had the followin…

---

## [CMAKE\_NUM\_BITS | Minor quality of life](https://discourse.cmake.org/t/cmake-num-bits-minor-quality-of-life/4159)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 4:35pm UTC](https://discourse.cmake.org/t/cmake-num-bits-minor-quality-of-life/4159 "2021-09-28T16:35:57Z")

</div>

Here is a common pattern in our code base: if (CMAKE\_SIZEOF\_VOID\_P EQUAL 8) set\_target\_properties(foobar PROPERTIES OUTPUT\_NAME foobar64) elseif (CMAKE\_SIZEOF\_VOID\_P EQUAL 4) set\_target\_properties(foobar PROPERT…

---

## [CMake init / template projects](https://discourse.cmake.org/t/cmake-init-template-projects/3904)

<div class="topic-metadata">

**Author:** [@anders-wind](https://discourse.cmake.org/u/anders-wind)\
**Replies:** 4\
**Last updated:** [September 23, 2021, 8:11am UTC](https://discourse.cmake.org/t/cmake-init-template-projects/3904 "2021-09-23T08:11:04Z")

</div>

I know that CMake has a certain scope on what you want to do and what you don’t want to do - Have you considered shipping functionality like cmake-init (GitHub - friendlyanon/cmake-init: The missing CMake project initial…

---

## [Presets with Ninja Multi-Config](https://discourse.cmake.org/t/presets-with-ninja-multi-config/3793)

<div class="topic-metadata">

**Author:** [@rurabori](https://discourse.cmake.org/u/rurabori)\
**Replies:** 6\
**Last updated:** [September 19, 2021, 2:45am UTC](https://discourse.cmake.org/t/presets-with-ninja-multi-config/3793 "2021-09-19T02:45:48Z")

</div>

Hi, I’ve been experimenting with Presets a bit in conjunction with Ninja Multi-Config generator. I encountered this issue,(simplified for the sake of this not being too long): { "version": 3, "configurePresets": \[ {…

---

## [Not generating my .moc files](https://discourse.cmake.org/t/not-generating-my-moc-files/4103)

<div class="topic-metadata">

**Author:** [@tedgress](https://discourse.cmake.org/u/tedgress)\
**Replies:** 1\
**Last updated:** [September 18, 2021, 3:08pm UTC](https://discourse.cmake.org/t/not-generating-my-moc-files/4103 "2021-09-18T15:08:40Z")

</div>

So I have .moc files that need to be generated. I have AUTOMOC set to in my CMakeLists.txt and reference QObject in my headers.

---

## [Documentation organization/granularity](https://discourse.cmake.org/t/documentation-organization-granularity/4090)

<div class="topic-metadata">

**Author:** [@ferdnyc](https://discourse.cmake.org/u/ferdnyc)\
**Replies:** 3\
**Last updated:** [September 15, 2021, 8:39pm UTC](https://discourse.cmake.org/t/documentation-organization-granularity/4090 "2021-09-15T20:39:04Z")

</div>

Lately I’ve been thinking about the HTML documentation and how it’s organized. Comparing a page like cmake-generator-expressions(7) to the property or variable documentation pages, or comparing those to the output of ma…

---

## [CMake 3.21 rc-1 | HIP support breaks custom MSVC toolchain](https://discourse.cmake.org/t/cmake-3-21-rc-1-hip-support-breaks-custom-msvc-toolchain/3629)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 39\
**Last updated:** [September 15, 2021, 4:06pm UTC](https://discourse.cmake.org/t/cmake-3-21-rc-1-hip-support-breaks-custom-msvc-toolchain/3629 "2021-09-15T16:06:03Z")

</div>

Since I’ve upgraded to CMake 3.21 our internal MSVC toolchains have broken. It’s not longer able to identify the compiler. It’s no longer able to detect the CXX compiler ABI info. As a result it seems to be unable to pr…

---

## [Unexpected behavior of the GENERATED source file property and CMP0118](https://discourse.cmake.org/t/unexpected-behavior-of-the-generated-source-file-property-and-cmp0118/3821)

<div class="topic-metadata">

**Author:** [@petwu](https://discourse.cmake.org/u/petwu)\
**Replies:** 4\
**Last updated:** [September 7, 2021, 1:19am UTC](https://discourse.cmake.org/t/unexpected-behavior-of-the-generated-source-file-property-and-cmp0118/3821 "2021-09-07T01:19:24Z")

</div>

The policy CMP0118 states that the GENERATED source file property is now visible in all directory scopes, not just the one it was set in. Now consider the following minimal example: # CMP0118/CMakeLists.txt cmake\_minimu…

---

## [Interesting issue trying to compile windows RC files using Ninja & MSVC](https://discourse.cmake.org/t/interesting-issue-trying-to-compile-windows-rc-files-using-ninja-msvc/4034)

<div class="topic-metadata">

**Author:** [@Yaram](https://discourse.cmake.org/u/Yaram)\
**Replies:** 4\
**Last updated:** [September 5, 2021, 1:42am UTC](https://discourse.cmake.org/t/interesting-issue-trying-to-compile-windows-rc-files-using-ninja-msvc/4034 "2021-09-05T01:42:57Z")

</div>

Recently while trying to build QT6 with CMake, Ninja and MSVC, I encountered an issue around MSVC RC files. The specific error message is as such: \[1/3\] Building RC object CMakeFiles\\main.dir\\Test.rc.res FAILED: CMakeF…

---

## [Why is CMake's minimum required so low?](https://discourse.cmake.org/t/why-is-cmakes-minimum-required-so-low/4030)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 1\
**Last updated:** [September 3, 2021, 3:29pm UTC](https://discourse.cmake.org/t/why-is-cmakes-minimum-required-so-low/4030 "2021-09-03T15:29:34Z")

</div>

cmake\_minimum\_required(VERSION 3.1...3.20 FATAL\_ERROR) I’m looking at the project to start contributing. Why is the min so low?

---

## [GHS\_CUSTOMIZATION as a list of filenames](https://discourse.cmake.org/t/ghs-customization-as-a-list-of-filenames/4021)

<div class="topic-metadata">

**Author:** [@fdk17](https://discourse.cmake.org/u/fdk17)\
**Replies:** 2\
**Last updated:** [September 2, 2021, 11:56pm UTC](https://discourse.cmake.org/t/ghs-customization-as-a-list-of-filenames/4021 "2021-09-02T23:56:23Z")

</div>

@craig.scott I’m trying to fix an issue that I have with the GHS generator. Currently GHS\_CUSTOMIZATION handles only a single filename. But a user could have multiple customization files for their project. I need to a…

---

## [Add CMAKE\_CTEST\_WORKING\_DIRECTORY variable](https://discourse.cmake.org/t/add-cmake-ctest-working-directory-variable/3999)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 2:30pm UTC](https://discourse.cmake.org/t/add-cmake-ctest-working-directory-variable/3999 "2021-08-31T14:30:58Z")

</div>

There is the test property WORKING\_DIRECTORY. But unlike most other properties, you cannot change the default. The default is always the directory, where add\_test() was called. I would like to change the default to CM…

---

## [Building CMake with MinGW-W64 8.1.0 compiler error](https://discourse.cmake.org/t/building-cmake-with-mingw-w64-8-1-0-compiler-error/3451)

<div class="topic-metadata">

**Author:** [@fdk17](https://discourse.cmake.org/u/fdk17)\
**Replies:** 6\
**Last updated:** [August 27, 2021, 7:50am UTC](https://discourse.cmake.org/t/building-cmake-with-mingw-w64-8-1-0-compiler-error/3451 "2021-08-27T07:50:56Z")

</div>

I was trying to build CMake 3.20.3 on Windows 10 using MinGW-W64 8.1.0 and Ninja. It seems to me that the KWSys 2021-05-07 update causes compilation errors with this setup. I can post the errors if this is useful. Is …

---

## [Some built-in helpers to convert OFF/ON in variable into the 0/1](https://discourse.cmake.org/t/some-built-in-helpers-to-convert-off-on-in-variable-into-the-0-1/3958)

<div class="topic-metadata">

**Author:** [@leha-bot](https://discourse.cmake.org/u/leha-bot)\
**Replies:** 1\
**Last updated:** [August 19, 2021, 7:27pm UTC](https://discourse.cmake.org/t/some-built-in-helpers-to-convert-off-on-in-variable-into-the-0-1/3958 "2021-08-19T19:27:11Z")

</div>

Some function like to\_01( \[SRC=\]) like #cmakedefine01. It could be useful in some contexts , e.g. consider some header-only library with its option() for enabling diagnostics which would set some internal #define with a…

---

## [TIFF::CXX is assumed to be built into libtiff when MSVC is used](https://discourse.cmake.org/t/tiff-cxx-is-assumed-to-be-built-into-libtiff-when-msvc-is-used/3946)

<div class="topic-metadata">

**Author:** [@AbdulAbCellera](https://discourse.cmake.org/u/AbdulAbCellera)\
**Replies:** 1\
**Last updated:** [August 18, 2021, 7:18pm UTC](https://discourse.cmake.org/t/tiff-cxx-is-assumed-to-be-built-into-libtiff-when-msvc-is-used/3946 "2021-08-18T19:18:54Z")

</div>

In FindTIFF.cmake, TIFF::CXX, under MSVC, is assumed to be built into the main tiff library, libtiff, but in reality, it is not built there. We made the module work by removing that logic. Can anyone else confirm the bu…

---

## [Surrounding Paths with Spaces in Quotes: Where Does the Magic Happen?](https://discourse.cmake.org/t/surrounding-paths-with-spaces-in-quotes-where-does-the-magic-happen/3940)

<div class="topic-metadata">

**Author:** [@marco1475](https://discourse.cmake.org/u/marco1475)\
**Replies:** 9\
**Last updated:** [August 18, 2021, 6:14pm UTC](https://discourse.cmake.org/t/surrounding-paths-with-spaces-in-quotes-where-does-the-magic-happen/3940 "2021-08-18T18:14:11Z")

</div>

On Windows, the following CMake code correctly wraps the path containing spaces in quotes: set( cmdargs "-options" "${CMAKE\_CURRENT\_BINARY\_DIR}/path with spaces" ) add\_custom\_command( OUTPUT MyGeneratedHeader.h COM…

---

## [Contribution: cross-compile support for Open Watcom](https://discourse.cmake.org/t/contribution-cross-compile-support-for-open-watcom/1015)

<div class="topic-metadata">

**Author:** [@Jiri\_Malak](https://discourse.cmake.org/u/Jiri_Malak)\
**Replies:** 6\
**Last updated:** [August 10, 2021, 8:56pm UTC](https://discourse.cmake.org/t/contribution-cross-compile-support-for-open-watcom/1015 "2021-08-10T20:56:20Z")

</div>

Hi, I would like to discuse a cross-compile support for Open Watcom and Linux host support for cross-compilation to DOS, OS/2 and Windows. It includes also cross-compilation for DOS, OS/2 and Linux from Windows host. I …

---

## [Contribution: cross-compilation support for XMOS processors.](https://discourse.cmake.org/t/contribution-cross-compilation-support-for-xmos-processors/3867)

<div class="topic-metadata">

**Author:** [@DaveAtkinsonXMOS](https://discourse.cmake.org/u/DaveAtkinsonXMOS)\
**Replies:** 10\
**Last updated:** [August 10, 2021, 1:47pm UTC](https://discourse.cmake.org/t/contribution-cross-compilation-support-for-xmos-processors/3867 "2021-08-10T13:47:55Z")

</div>

Hi there, I would like to discuss the possibility of providing cross-compilation support for XMOS processors on Linux, MacOS and Windows. I would welcome any advice for achieving this. The XMOS ‘xcc’ compiler supports C…

---

## [ISPC Language support](https://discourse.cmake.org/t/ispc-language-support/673)

<div class="topic-metadata">

**Author:** [@Lectem](https://discourse.cmake.org/u/Lectem)\
**Replies:** 26\
**Last updated:** [August 10, 2021, 12:29pm UTC](https://discourse.cmake.org/t/ispc-language-support/673 "2021-08-10T12:29:10Z")

</div>

Hi, I’m trying to add support for the ISPC language (and compiler) to cmake. I based my first iteration from what I could gather from the ASM, Fortran and CUDA languages modules, but sadly it seems I am missing somethi…

---

## [Multicore configure phase?](https://discourse.cmake.org/t/multicore-configure-phase/3890)

<div class="topic-metadata">

**Author:** [@tgq](https://discourse.cmake.org/u/tgq)\
**Replies:** 4\
**Last updated:** [August 9, 2021, 3:59am UTC](https://discourse.cmake.org/t/multicore-configure-phase/3890 "2021-08-09T03:59:08Z")

</div>

Hello. Is there any way to make the feature check phase run on multiple cores? What I mean is all the checks like: -- Looking for dlopen -- Looking for dlopen - not found -- Looking for sys/epoll.h -- Looking for sys/ep…

---

## [Compression level when creating archives](https://discourse.cmake.org/t/compression-level-when-creating-archives/3851)

<div class="topic-metadata">

**Author:** [@petwu](https://discourse.cmake.org/u/petwu)\
**Replies:** 3\
**Last updated:** [July 30, 2021, 6:25am UTC](https://discourse.cmake.org/t/compression-level-when-creating-archives/3851 "2021-07-30T06:25:04Z")

</div>

Hi, CMake 3.19 added a COMPRESSION\_LEVEL option to the file(ARCHIVE\_CREATE) command. Would it be possible to add a flag for setting the compression level to the built-in tar command (cmake -E tar ...) as well? I suppose…

---

## [list(FIND) vs. (theoretical) list(CONTAINS)](https://discourse.cmake.org/t/list-find-vs-theoretical-list-contains/3814)

<div class="topic-metadata">

**Author:** [@ferdnyc](https://discourse.cmake.org/u/ferdnyc)\
**Replies:** 3\
**Last updated:** [July 22, 2021, 1:23pm UTC](https://discourse.cmake.org/t/list-find-vs-theoretical-list-contains/3814 "2021-07-22T13:23:05Z")

</div>

It’s a bit of a bummer that, because list(FIND...) returns 0-based index values, and if() interprets 0 and only 0 as a FALSE value, the results of a list(FIND...) have to be compared to -1 in order to be used as truth va…

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

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