# CMake Build Fails After Migration from 3.23.5 to 3.24.0-rc1

**URL:** <https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693>\
**Category:** Code\
**Tags:** os:windows\
**Created:** [August 8, 2023, 8:30am UTC](https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693 "2023-08-08T08:30:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alanpaterson78](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@alanpaterson78](https://discourse.cmake.org/u/alanpaterson78)\
**Post date:** [August 8, 2023, 8:30am UTC](https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693/1 "2023-08-08T08:30:10Z")

</div>

I have a cmake project which uses FetchContent to pull in google test from a github mirror. There are also some custom targets for optionally enabling and disabling bullseye coverage on the build. This all worked well up to 3.23.5, but as soon as I move to 3.24.0-rc1 and above, the build step results in a linker error:

Command line fatal error c1083: cannot open source file: ‘\<Build\_Path\_Removed\>/\_deps/googletest-src/googletest/include’: Permission denied  
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6006: “CL.exe” exited with code 1. [\<Path\_To\_VS\_Project\_Removed\>.vcxproj]

When I disable the bullseye coverage build, the build succeeds as expected. I presume this is something to do with what happens when bullseye is enabled, specifically the system PATH is updated so that it’s version of the CL.exe is discovered first and used to instrument the source files, which are then passed to the real compiler.

I’m presuming something has changed internally with CMake in terms of how it handles the path to the CL.exe, but I am at a loss to understand what…or how to fix this?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [August 8, 2023, 1:59pm UTC](https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693/2 "2023-08-08T13:59:27Z")

</div>

Could you try to bisect the problem in `git` to track it down more specifically? Or provide a project that shows the problem so that someone else could bisect.

Cc: @brad.king @craig.scott

---

<div class="post-metadata">

**Author:** ![alanpaterson78](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@alanpaterson78](https://discourse.cmake.org/u/alanpaterson78)\
**Post date:** [August 22, 2023, 10:31am UTC](https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693/3 "2023-08-22T10:31:29Z")

</div>

I’ve been able to reproduce the issue on a cut down project and isolate what I think is the problematic difference. The 3.23.5 visual studio project contains the following:

```auto
<AdditionalIncludeDirectories>D:\test_project\googletest\googletest\include;D:\test_project\googletest\googletest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <AdditionalOptions>%(AdditionalOptions) -J -utf-8</AdditionalOptions>

```

But 3.24.0-rc1 (and presumably later) contain the following:

```auto
<AdditionalOptions>%(AdditionalOptions) /external:I "D:/test_project/googletest/googletest/include" /external:I "D:/test_project/googletest/googletest" -J -utf-8</AdditionalOptions>

```

I presume therefore this is an issue with the Bullseye ‘compiler’ not understanding the /external:I syntax.

Is there any policy I can toggle to make the Visual Studio Generator create the old style project content.

---

<div class="post-metadata">

**Author:** ![alanpaterson78](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@alanpaterson78](https://discourse.cmake.org/u/alanpaterson78)\
**Post date:** [August 22, 2023, 10:39am UTC](https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693/4 "2023-08-22T10:39:26Z")

</div>

That has obviously stripped out the xml tags…  
In the 3.23.5 build the first line is in an AdditionalIncludeDirectories tag, with the second being in an AdditionalOptions tag. With the later build, all the options are in an AdditionalOptions tag only.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [August 22, 2023, 10:53am UTC](https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693/5 "2023-08-22T10:53:38Z")

</div>

You can unset `CMAKE_INCLUDE_SYSTEM_FLAG_${lang}` after the `project()` call to hide support from CMake generators for `/external:I`. I suggest reporting the unsupported flag to Bullseye.

---

<div class="post-metadata">

**Author:** ![alanpaterson78](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@alanpaterson78](https://discourse.cmake.org/u/alanpaterson78)\
**Post date:** [August 22, 2023, 11:48am UTC](https://discourse.cmake.org/t/cmake-build-fails-after-migration-from-3-23-5-to-3-24-0-rc1/8693/6 "2023-08-22T11:48:34Z")

</div>

> [@ben.boeckel](#):
>
> CMAKE\_INCLUDE\_SYSTEM\_FLAG\_${lang}

Thanks for your help Ben!
