# set MSVC "Output Files -\> Object File Name"

**URL:** <https://discourse.cmake.org/t/set-msvc-output-files-object-file-name/2220>\
**Category:** Code\
**Created:** [November 23, 2020, 2:14pm UTC](https://discourse.cmake.org/t/set-msvc-output-files-object-file-name/2220 "2020-11-23T14:14:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProTurm2](https://discourse.cmake.org/user_avatar/discourse.cmake.org/proturm2/32/1061_2.png) [@ProTurm2](https://discourse.cmake.org/u/ProTurm2)\
**Post date:** [November 23, 2020, 2:14pm UTC](https://discourse.cmake.org/t/set-msvc-output-files-object-file-name/2220/1 "2020-11-23T14:14:27Z")

</div>

What is the property name for setting MSVC `Output Files -> Object File Name` ? I would like to handle the case where two files of different folders have the same file name. Does cmake offer something of this kind?

Where do I find a list of all available MSVC properties?

---

<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:** [November 25, 2020, 5:23pm UTC](https://discourse.cmake.org/t/set-msvc-output-files-object-file-name/2220/2 "2020-11-25T17:23:08Z")

</div>

I don’t know if CMake has a property for that itself. The list of properties that CMake provides is [here](https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html). `VS_GLOBAL_<variable>` may be of interest, but you’d need to know what Visual Studio calls the property you’re interested in.

Cc: @brad.king

---

<div class="post-metadata">

**Author:** ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)\
**Post date:** [November 25, 2020, 5:31pm UTC](https://discourse.cmake.org/t/set-msvc-output-files-object-file-name/2220/3 "2020-11-25T17:31:00Z")

</div>

CMake’s Visual Studio generator has no way to control the object file location. However, it has logic to automatically choose object file locations that do not conflict. See code [here](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.19.1/Source/cmLocalVisualStudioGenerator.cxx#L33).

---

<div class="post-metadata">

**Author:** ![loopless](https://discourse.cmake.org/user_avatar/discourse.cmake.org/loopless/32/2163_2.png) [@loopless](https://discourse.cmake.org/u/loopless)\
**Post date:** [February 3, 2022, 9:36pm UTC](https://discourse.cmake.org/t/set-msvc-output-files-object-file-name/2220/4 "2022-02-03T21:36:55Z")

</div>

This CMake feature ( create non-conflicting OBJ locations) is creating some problems for us. It turns out that if .OBJ files are not being sent to the default $(IntDir) location , then the /MP switch ( parallel builds) gets disabled. At least with VS 2019/2017. Although technically the builds could process in parallel, the build process takes the conservative approach and compiles one file at a time. This is discussed here

> **[Visual Studio Feedback](https://developercommunity.visualstudio.com/t/vs2017-cc-multi-processor-compilation-does-not-wor/586584)**
>
> Visual Studio Feedback

CMake is also a bit too conservative, $(IntDir) is unique for each Configuration type( Debug/Release etc), yet CMake will create unique .OBJ outputs for files with the same name, even if only one file is not marked as “exclude from build” for the active configuration.

---

<div class="post-metadata">

**Author:** ![hootfat](https://discourse.cmake.org/user_avatar/discourse.cmake.org/hootfat/32/2694_2.png) [@hootfat](https://discourse.cmake.org/u/hootfat)\
**Post date:** [August 19, 2022, 7:10pm UTC](https://discourse.cmake.org/t/set-msvc-output-files-object-file-name/2220/5 "2022-08-19T19:10:52Z")

</div>

Why the hell woudn’t you allow me to set ANYTHING I want in MY project? just expose everything, I simply can’t configure my project using tool for CONFIGURING. What did I do to deserve this?
