# \#os:windows

**URL:** https://discourse.cmake.org/tag/os-windows/2.md

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

---

## [CPack error copying files](https://discourse.cmake.org/t/cpack-error-copying-files/15848)

<div class="topic-metadata">

**Author:** [@Wallby](https://discourse.cmake.org/u/Wallby)\
**Replies:** 1\
**Last updated:** [September 28, 2026, 9:45am UTC](https://discourse.cmake.org/t/cpack-error-copying-files/15848 "2026-09-28T09:45:46Z")

</div>

I have set up a .cmake file I intend to use as a template/framework. It is included at the beginning of the top level CMakeLists.txt. The actual project contains more than this (and targets not named example), but this i…

---

## [A method of writing that can handle file name changes.](https://discourse.cmake.org/t/a-method-of-writing-that-can-handle-file-name-changes/15825)

<div class="topic-metadata">

**Author:** [@amagi](https://discourse.cmake.org/u/amagi)\
**Replies:** 5\
**Last updated:** [September 12, 2026, 2:54am UTC](https://discourse.cmake.org/t/a-method-of-writing-that-can-handle-file-name-changes/15825 "2026-09-12T02:54:38Z")

</div>

The following code requires a cmake --build build command to build if the filename is changed. However, emptying and regenerating the build directory is cumbersome, so I’ve assigned a single command to a shortcut key for…

---

## [Recommended way to enable PDB for Release configuration](https://discourse.cmake.org/t/recommended-way-to-enable-pdb-for-release-configuration/15808)

<div class="topic-metadata">

**Author:** [@dgrabiec](https://discourse.cmake.org/u/dgrabiec)\
**Replies:** 7\
**Last updated:** [August 28, 2026, 1:13pm UTC](https://discourse.cmake.org/t/recommended-way-to-enable-pdb-for-release-configuration/15808 "2026-08-28T13:13:51Z")

</div>

I’m wondering what the canonical way to enable generation of PDB files for a Release build is? Naively I’ve just added this to my toolchain file for the MSVC generators: add\_compile\_options("$\<$\`\<\`CONFIG:Release\`\>\`:/Zi\>…

---

## [Target requires "CXX26" but CMake does not know the flags to enable it](https://discourse.cmake.org/t/target-requires-cxx26-but-cmake-does-not-know-the-flags-to-enable-it/15762)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 5\
**Last updated:** [August 13, 2026, 2:02pm UTC](https://discourse.cmake.org/t/target-requires-cxx26-but-cmake-does-not-know-the-flags-to-enable-it/15762 "2026-08-13T14:02:44Z")

</div>

I want to test c++26 with import std; too if(FMT\_MODULE) add\_library(fmt-module) add\_library(fmt::fmt-module ALIAS fmt-module) target\_compile\_options( fmt-module PUBLIC $\<$\<AND:$\<COMPILE\_LANG…

---

## [Bug: FindPython arch detection is bad with Windows on Arm](https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769)

<div class="topic-metadata">

**Author:** [@NAP64](https://discourse.cmake.org/u/NAP64)\
**Replies:** 3\
**Last updated:** [August 1, 2026, 2:26pm UTC](https://discourse.cmake.org/t/bug-findpython-arch-detection-is-bad-with-windows-on-arm/15769 "2026-08-01T14:26:39Z")

</div>

Python architecture ID is aarch64, which does not contain ARM, thus fails the match. CMake\\share\\cmake-4.4\\Modules\\FindPython\\Support.cmake:1206 My current patch is changing the line to if ((\\\_${\\\_PYTHON\_PREFIX}\*ARCHI…

---

## [Comment line for custom target has added leading 1\>](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764)

<div class="topic-metadata">

**Author:** [@Wallby](https://discourse.cmake.org/u/Wallby)\
**Replies:** 3\
**Last updated:** [July 31, 2026, 11:25am UTC](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764 "2026-07-31T11:25:49Z")

</div>

For example: set(name example) add\_executable(${name} ${...}) set(customName customTarget) add\_custom\_target(${customName} COMMENT "#${customName}" COMMAND ${CMAKE\_COMMAND} -E echo $\<TARGET\_FILE…

---

## [Cannot start CMake GUI on Windows 8.1](https://discourse.cmake.org/t/cannot-start-cmake-gui-on-windows-8-1/15763)

<div class="topic-metadata">

**Author:** [@NEOWISE](https://discourse.cmake.org/u/NEOWISE)\
**Replies:** 1\
**Last updated:** [July 29, 2026, 10:18pm UTC](https://discourse.cmake.org/t/cannot-start-cmake-gui-on-windows-8-1/15763 "2026-07-29T22:18:20Z")

</div>

Cannot start CMake GUI on Windows 8.1. It says cannot find d3d12.dll.

---

## [FindwxWidgets.cmake on Windows on ARM support is broken](https://discourse.cmake.org/t/findwxwidgets-cmake-on-windows-on-arm-support-is-broken/15760)

<div class="topic-metadata">

**Author:** [@Noisyfox](https://discourse.cmake.org/u/Noisyfox)\
**Replies:** 2\
**Last updated:** [July 27, 2026, 2:13pm UTC](https://discourse.cmake.org/t/findwxwidgets-cmake-on-windows-on-arm-support-is-broken/15760 "2026-07-27T14:13:16Z")

</div>

wxWidgets installs the librarys with arm64 suffix when build for WoA. This was done in Building wxWidgets using CMAKE for ARM64 MSW, it generates the wrong lib folder name · Issue #23347 · wxWidgets/wxWidgets · GitHub H…

---

## [Custom command/target results in MSB8065 warnings in Visual Studio 2022 & 2026](https://discourse.cmake.org/t/custom-command-target-results-in-msb8065-warnings-in-visual-studio-2022-2026/15757)

<div class="topic-metadata">

**Author:** [@MarkCallow](https://discourse.cmake.org/u/MarkCallow)\
**Replies:** 2\
**Last updated:** [July 23, 2026, 2:27pm UTC](https://discourse.cmake.org/t/custom-command-target-results-in-msb8065-warnings-in-visual-studio-2022-2026/15757 "2026-07-23T14:27:29Z")

</div>

I am aware of Custom command results in MSB8065 warnings in Visual Studio 2019. That is a different issue. In that case the custom command OUTPUT is not a real file. In this case it is a real file, actually a directory. …

---

## [\_MBCS in 4.2, and policy CMP0204](https://discourse.cmake.org/t/mbcs-in-4-2-and-policy-cmp0204/15738)

<div class="topic-metadata">

**Author:** [@johan556](https://discourse.cmake.org/u/johan556)\
**Replies:** 2\
**Last updated:** [July 22, 2026, 6:29pm UTC](https://discourse.cmake.org/t/mbcs-in-4-2-and-policy-cmp0204/15738 "2026-07-22T18:29:47Z")

</div>

I recently updated one of my projects to use cmake\_minimum\_required(VERSION 4.2). My project sets the defines UNICODE and \_UNICODE globally, so I assumed that the new policy CMP0204 should work without problem for me. I…

---

## [Cpack ingnore or overwite install options from external dependencies](https://discourse.cmake.org/t/cpack-ingnore-or-overwite-install-options-from-external-dependencies/15754)

<div class="topic-metadata">

**Author:** [@nickvdbroeck](https://discourse.cmake.org/u/nickvdbroeck)\
**Replies:** 3\
**Last updated:** [July 22, 2026, 7:32am UTC](https://discourse.cmake.org/t/cpack-ingnore-or-overwite-install-options-from-external-dependencies/15754 "2026-07-22T07:32:55Z")

</div>

I have the following issue: I am building an SDK. It includes an external project (specifically: GitHub - ouster-lidar/ouster-sdk: Cross-platform C++ and Python SDK for Ouster LiDAR sensors. Includes tools for visualiza…

---

## [let cmake use clang-cl when use ninja, not clang++ ,so people can migrate from visual studio nmake to ninja](https://discourse.cmake.org/t/let-cmake-use-clang-cl-when-use-ninja-not-clang-so-people-can-migrate-from-visual-studio-nmake-to-ninja/15755)

<div class="topic-metadata">

**Author:** [@photonest3](https://discourse.cmake.org/u/photonest3)\
**Replies:** 1\
**Last updated:** [July 22, 2026, 2:35am UTC](https://discourse.cmake.org/t/let-cmake-use-clang-cl-when-use-ninja-not-clang-so-people-can-migrate-from-visual-studio-nmake-to-ninja/15755 "2026-07-22T02:35:47Z")

</div>

let cmake use clang-cl when use ninja, not clang++ ,so people can migrate from visual studio nmake to ninja. OpenClaw (codebuddy.ai) output translate: Here’s a natural, technically-accurate English translation (good fo…

---

## [How to be able to choose Debug or Release build in CMake](https://discourse.cmake.org/t/how-to-be-able-to-choose-debug-or-release-build-in-cmake/15727)

<div class="topic-metadata">

**Author:** [@Maaz\_Madha](https://discourse.cmake.org/u/Maaz_Madha)\
**Replies:** 1\
**Last updated:** [June 25, 2026, 3:17pm UTC](https://discourse.cmake.org/t/how-to-be-able-to-choose-debug-or-release-build-in-cmake/15727 "2026-06-25T15:17:46Z")

</div>

Hi all How do I configure build or debug releases for a multi directory project, cross compiling project with CMakeLists.txt for each of the directories. Do I do this in CMakePresets.json or pass it as a command, and i…

---

## [Difference between target\_link\_libraries and adding headers via target\_sources](https://discourse.cmake.org/t/difference-between-target-link-libraries-and-adding-headers-via-target-sources/15730)

<div class="topic-metadata">

**Author:** [@Maaz\_Madha](https://discourse.cmake.org/u/Maaz_Madha)\
**Replies:** 0\
**Last updated:** [June 24, 2026, 2:37pm UTC](https://discourse.cmake.org/t/difference-between-target-link-libraries-and-adding-headers-via-target-sources/15730 "2026-06-24T14:37:13Z")

</div>

Hi all Is target link libraries needed when wanted to add the .c files in a library, and then do target\_sources file sets to specify which header files to use from that(or what the file needs)? Also, if I strictly just …

---

## [For posterity: another of these CMake "hacks" — No CMAKE\_C\_COMPILER could be found.](https://discourse.cmake.org/t/for-posterity-another-of-these-cmake-hacks-no-cmake-c-compiler-could-be-found/15721)

<div class="topic-metadata">

**Author:** [@exoosh](https://discourse.cmake.org/u/exoosh)\
**Replies:** 9\
**Last updated:** [June 23, 2026, 3:15pm UTC](https://discourse.cmake.org/t/for-posterity-another-of-these-cmake-hacks-no-cmake-c-compiler-could-be-found/15721 "2026-06-23T15:15:57Z")

</div>

So, CMake seems incapable of passing through /pdbaltpath:%\_PDB% when given in a CMakeLists.txt (first learning). It somehow ends up as %%%%\_PDB%%%% which then will evaluate — assuming a foobar.exe — to %%%foobar.pdb%%% i…

---

## [Running postbuild tasks with ninja](https://discourse.cmake.org/t/running-postbuild-tasks-with-ninja/13623)

<div class="topic-metadata">

**Author:** [@noahdav](https://discourse.cmake.org/u/noahdav)\
**Replies:** 4\
**Last updated:** [June 4, 2026, 7:06pm UTC](https://discourse.cmake.org/t/running-postbuild-tasks-with-ninja/13623 "2026-06-04T19:06:03Z")

</div>

Hi, We have been using the visual studio generators and it seems to work for the most part but there are a few issues that we are trying to solve that are not supported with the visual studio generators. We have been l…

---

## [presets: Omitting \`generator\` does not default to regular generator discovery procedure](https://discourse.cmake.org/t/presets-omitting-generator-does-not-default-to-regular-generator-discovery-procedure/7910)

<div class="topic-metadata">

**Author:** [@dabe](https://discourse.cmake.org/u/dabe)\
**Replies:** 2\
**Last updated:** [June 1, 2026, 12:38am UTC](https://discourse.cmake.org/t/presets-omitting-generator-does-not-default-to-regular-generator-discovery-procedure/7910 "2026-06-01T00:38:44Z")

</div>

I have a project that I’d like to use different generators for depending on the OS that is compiling it (specifically, Unix Makefiles for Linux and Visual Studio/Ninja for Windows). I’d like to just let the automatic ge…

---

## [CMake 4.2.3 picks wrong MSVC?](https://discourse.cmake.org/t/cmake-4-2-3-picks-wrong-msvc/15572)

<div class="topic-metadata">

**Author:** [@exoosh](https://discourse.cmake.org/u/exoosh)\
**Replies:** 7\
**Last updated:** [May 20, 2026, 1:48pm UTC](https://discourse.cmake.org/t/cmake-4-2-3-picks-wrong-msvc/15572 "2026-05-20T13:48:17Z")

</div>

Hi, so today I tried to build a project where we used to rely on the fact that CMake uses the ambient environment to figure out the compiler to use. Alas, despite being started in the VS2022 Developer Powershell, it en…

---

## [Feature Request: install(TARGETS RUNTIME\_DEPENDENCIES) should add $\<TARGET\_RUNTIME\_DLL\_DIRS:...\>](https://discourse.cmake.org/t/feature-request-install-targets-runtime-dependencies-should-add-target-runtime-dll-dirs/15650)

<div class="topic-metadata">

**Author:** [@dbs4261](https://discourse.cmake.org/u/dbs4261)\
**Replies:** 0\
**Last updated:** [May 11, 2026, 6:56pm UTC](https://discourse.cmake.org/t/feature-request-install-targets-runtime-dependencies-should-add-target-runtime-dll-dirs/15650 "2026-05-11T18:56:44Z")

</div>

Simply put, CMake already knows if dependencies are stored in another directory because of the networks of target dependencies. So when installing runtime dependencies with install(TARGETS … RUNTIME\_DEPENDENCIES) I can u…

---

## [generate .o files from compiler instead of .obj files](https://discourse.cmake.org/t/generate-o-files-from-compiler-instead-of-obj-files/2690)

<div class="topic-metadata">

**Author:** [@deepan](https://discourse.cmake.org/u/deepan)\
**Replies:** 14\
**Last updated:** [May 6, 2026, 3:45am UTC](https://discourse.cmake.org/t/generate-o-files-from-compiler-instead-of-obj-files/2690 "2026-05-06T03:45:09Z")

</div>

I am working in an embedded project. target : ppc compiler : windriver Host environment : windows 10 build generator : cmake, MinGW makefiles during compilation i see .c.obj getting generated. I want .o instead of .…

---

## [/F MSVC stack size not working with CMake](https://discourse.cmake.org/t/f-msvc-stack-size-not-working-with-cmake/15641)

<div class="topic-metadata">

**Author:** [@AliADev](https://discourse.cmake.org/u/AliADev)\
**Replies:** 0\
**Last updated:** [May 5, 2026, 5:34pm UTC](https://discourse.cmake.org/t/f-msvc-stack-size-not-working-with-cmake/15641 "2026-05-05T17:34:23Z")

</div>

This program stack overflows by default on windows, because it allocates more than 1MB on the stack on debug builds. So I pass /F to MSVC and it works. However, when I do it in CMake, it does not seem to work and keep ge…

---

## [NSIS CPack generator forcibly overwrites $INSTDIR to $DOCUMENTS for per-user JustMe installs](https://discourse.cmake.org/t/nsis-cpack-generator-forcibly-overwrites-instdir-to-documents-for-per-user-justme-installs/15632)

<div class="topic-metadata">

**Author:** [@Nyoma\_Diamond](https://discourse.cmake.org/u/Nyoma_Diamond)\
**Replies:** 0\
**Last updated:** [April 27, 2026, 2:17pm UTC](https://discourse.cmake.org/t/nsis-cpack-generator-forcibly-overwrites-instdir-to-documents-for-per-user-justme-installs/15632 "2026-04-27T14:17:10Z")

</div>

Hiya I’ve run into an issue with using the NSIS generator for CPack where it’s not possible to change the default install location for per-user JustMe installs. Specifically, if you wanted to change the default per-user…

---

## [FASTBuild+clang-cl combo emits warnings which Ninja+clang-cl combo doesn't emit with same everything](https://discourse.cmake.org/t/fastbuild-clang-cl-combo-emits-warnings-which-ninja-clang-cl-combo-doesnt-emit-with-same-everything/15601)

<div class="topic-metadata">

**Author:** [@SenPie](https://discourse.cmake.org/u/SenPie)\
**Replies:** 6\
**Last updated:** [April 25, 2026, 11:51pm UTC](https://discourse.cmake.org/t/fastbuild-clang-cl-combo-emits-warnings-which-ninja-clang-cl-combo-doesnt-emit-with-same-everything/15601 "2026-04-25T23:51:51Z")

</div>

With the long awaited addition of FASTBuild to the list of supported generators we wanted to transition our game engine from Ninja+clang-cl setup to FASTBuild+clang-cl setup to leverage that sweet distributed compilation…

---

## [Incorrect link library flags in mixed C++/ASM project using MSVC with Clang](https://discourse.cmake.org/t/incorrect-link-library-flags-in-mixed-c-asm-project-using-msvc-with-clang/15600)

<div class="topic-metadata">

**Author:** [@MEhrn00](https://discourse.cmake.org/u/MEhrn00)\
**Replies:** 2\
**Last updated:** [April 14, 2026, 5:32pm UTC](https://discourse.cmake.org/t/incorrect-link-library-flags-in-mixed-c-asm-project-using-msvc-with-clang/15600 "2026-04-14T17:32:53Z")

</div>

I am experiencing an issue in a mixed C++/ASM project on Windows using MSVC as the C++ compiler and Clang for the assembler. When configuring a project for Ninja passing -DCMAKE\_ASM\_COMPILER=clang, bare link library nam…

---

## [\_deps folder requires administrator priviledges to delete](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155)

<div class="topic-metadata">

**Author:** [@LouChiSoft](https://discourse.cmake.org/u/LouChiSoft)\
**Replies:** 6\
**Last updated:** [April 4, 2026, 9:50pm UTC](https://discourse.cmake.org/t/deps-folder-requires-administrator-priviledges-to-delete/13155 "2026-04-04T21:50:13Z")

</div>

I have recently started using FetchContent to manage some dependencies in my CMake project and for some reason the \_deps folder needs administrator priviledges to delete despite not needing them to make the folder in the…

---

## [Find\_package - MSVC - Standard Architecture not defined.](https://discourse.cmake.org/t/find-package-msvc-standard-architecture-not-defined/15581)

<div class="topic-metadata">

**Author:** [@Kphillisjr](https://discourse.cmake.org/u/Kphillisjr)\
**Replies:** 1\
**Last updated:** [March 30, 2026, 8:09pm UTC](https://discourse.cmake.org/t/find-package-msvc-standard-architecture-not-defined/15581 "2026-03-30T20:09:39Z")

</div>

I am working with a few packages and noticed that the CMAKE find\_package is fundamentally broken with MSVC. From what I can tell the following variables are not defined: CMAKE\_LIBRARY\_ARCHITECTURE CMAKE\_C\_LIBRARY\_ARCHI…

---

## [CMake expert seeking for paid consultancy work](https://discourse.cmake.org/t/cmake-expert-seeking-for-paid-consultancy-work/15582)

<div class="topic-metadata">

**Author:** [@flinco](https://discourse.cmake.org/u/flinco)\
**Replies:** 0\
**Last updated:** [March 30, 2026, 9:54am UTC](https://discourse.cmake.org/t/cmake-expert-seeking-for-paid-consultancy-work/15582 "2026-03-30T09:54:50Z")

</div>

I am a professional C developer and, in my spare time, I have developed a C++ Qt application for timing running races. The application is open-source (GPL 3) and uses CMake for compilation and to build the installer. Th…

---

## [\*.tlh files always dirty with Ninja Multi-config](https://discourse.cmake.org/t/tlh-files-always-dirty-with-ninja-multi-config/15580)

<div class="topic-metadata">

**Author:** [@RobinD42](https://discourse.cmake.org/u/RobinD42)\
**Replies:** 0\
**Last updated:** [March 28, 2026, 3:09am UTC](https://discourse.cmake.org/t/tlh-files-always-dirty-with-ninja-multi-config/15580 "2026-03-28T03:09:25Z")

</div>

We have a project with some C++ files using #import with \*.tlb files. I’ve noticed that with the Ninja Multi-Config generator the tlh and tli files end up in the base of the build folder. However with the single-config N…

---

## [Is there a guide on how to configure CMake with MinGW/MSYS and git on Windows?](https://discourse.cmake.org/t/is-there-a-guide-on-how-to-configure-cmake-with-mingw-msys-and-git-on-windows/15563)

<div class="topic-metadata">

**Author:** [@Lars](https://discourse.cmake.org/u/Lars)\
**Replies:** 10\
**Last updated:** [March 21, 2026, 7:38pm UTC](https://discourse.cmake.org/t/is-there-a-guide-on-how-to-configure-cmake-with-mingw-msys-and-git-on-windows/15563 "2026-03-21T19:38:53Z")

</div>

Hi all, I am a maintainer of a library (OpenXLSX) and have recently augmented the CMake configuration to auto-pull dependencies via find\_package or FetchContent from their source repositories, instead of including a cop…

---

## [Unable to build Eigen & OpenXLSX on windows](https://discourse.cmake.org/t/unable-to-build-eigen-openxlsx-on-windows/10868)

<div class="topic-metadata">

**Author:** [@Shepard](https://discourse.cmake.org/u/Shepard)\
**Replies:** 2\
**Last updated:** [March 19, 2026, 11:27am UTC](https://discourse.cmake.org/t/unable-to-build-eigen-openxlsx-on-windows/10868 "2026-03-19T11:27:22Z")

</div>

Well, I’m working on a C++ project where I am using linear algebra from Eigen. This is how I fetch the Eigen library from my root CmakeLists.txt: message(\[STATUS\] "Fetching eigen.") block(SCOPE\_FOR VARIABLES) set(E…

[Next page](https://discourse.cmake.org/tag/os-windows/2.md?match_all_tags=true&page=1&tags%5B%5D=os%3Awindows)
