# $\<LOWER\_CASE:...\> doesn't work with VS generator?

**URL:** https://discourse.cmake.org/t/lower-case-doesnt-work-with-vs-generator/7917
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [April 16, 2023, 9:41am UTC](https://discourse.cmake.org/t/lower-case-doesnt-work-with-vs-generator/7917 "2023-04-16T09:41:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![studyingegret](https://discourse.cmake.org/user_avatar/discourse.cmake.org/studyingegret/32/3341_2.png) [@studyingegret](https://discourse.cmake.org/u/studyingegret)
#### Post date: [April 16, 2023, 9:41am UTC](https://discourse.cmake.org/t/lower-case-doesnt-work-with-vs-generator/7917/1 "2023-04-16T09:41:55Z")

</div>

Hello everyone,

I am following Step 1 of the [CMake tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/A%20Basic%20Starting%20Point.html), and I am trying to control the output directory of executables. As the Visual Studio build system creates subdirectories per configuration in the build directory by default, I am also trying to make these names lowercase.

I set [`CMAKE_RUNTIME_OUTPUT_DIRECTORY`](https://cmake.org/cmake/help/latest/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY.html) to a generator expression with [`$<LOWER_CASE:...>`](https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#genex:LOWER_CASE):

```cmake
cmake_minimum_required(VERSION 3.10)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY C:/_stash/_files/cmaketest/$<LOWER_CASE:$<CONFIG>>)
project(Tutorial
        DESCRIPTION "A tutorial CMake project.")
add_executable(Tutorial tutorial.cxx)

```

However, when the config is `Debug` or `Release`, the result subdirectory name is always capitalized, even when `--config` is specified:

| Command | Output location |
| --- | --- |
| `cmake --build ../build/Step1` | C:\_stash\_files\cmaketest\Debug\Tutorial.exe |
| `cmake --build ../build/Step1 --config debug` | C:\_stash\_files\cmaketest\Debug\Tutorial.exe |
| `cmake --build ../build/Step1 --config release` | C:\_stash\_files\cmaketest\Release\Tutorial.exe |
| `cmake --build ../build/Step1 --config releaSE` | C:\_stash\_files\cmaketest\Release\Tutorial.exe |

The other two, `MinSizeRel` and `RelWithDebInfo`, which I found in the generated .vcxproj, build as expected and output respectively to C:\_stash\_files\cmaketest\minsizerel\Tutorial.exe and C:\_stash\_files\cmaketest\relwithdebinfo\Tutorial.exe.

I tried moving the `set()` command after `project()` but nothing changed. I think this is a CMake bug… any ideas?

(CMake version: 3.25.1-msvc1)

---

<div class="post-metadata">

### Author: ![studyingegret](https://discourse.cmake.org/user_avatar/discourse.cmake.org/studyingegret/32/3341_2.png) [@studyingegret](https://discourse.cmake.org/u/studyingegret)
#### Post date: [April 16, 2023, 9:59am UTC](https://discourse.cmake.org/t/lower-case-doesnt-work-with-vs-generator/7917/2 "2023-04-16T09:59:44Z")

</div>

Update: Tried again after posting this and it worked… I made it work by deleting C:\_stash\_files\cmaketest\Debug and C:\_stash\_files\cmaketest\Release and trying again.

It turned out it was because I previously built with `set(CMAKE_RUNTIME_OUTPUT_DIRECTORY C:/_stash/_files/cmaketest/$<CONFIG>)`, causing C:\_stash\_files\cmaketest\Debug to be created; when building again with `set(CMAKE_RUNTIME_OUTPUT_DIRECTORY C:/_stash/_files/cmaketest/$<LOWER_CASE:$<CONFIG>>)`, as C:\_stash\_files\cmaketest\Debug exists and Windows is case-insensitive, C:\_stash\_files\cmaketest\debug is equivalent to C:\_stash\_files\cmaketest\Debug, causing that directory to be reused.
