I am following Step 1 of the CMake tutorial, 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.
CMAKE_RUNTIME_OUTPUT_DIRECTORY to a generator expression with
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
Release, the result subdirectory name is always capitalized, even when
--config is specified:
The other two,
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)