(Copied from mail list where it is currently unanswered)
I am rather confused about how to specify the output directory. I am working on Windows with the Ninja generator and Microsoft toolset. My default build type is Debug. I am building a library and an executable:
The resulting directory structure, after a build, is:
Kernel <== source files
|--Kernel <== library goes here
|--debug <== exe goes here
I want the Kernel library to go into the ‘debug’ folder (where the exe is correctly being put).
$CMAKE_RUNTIME_OUTPUT_DIRECTORY and $RUNTIME_OUTPUT_DIRECTORY are undefined.
How would I achieve this?
Which variable holds the exe output path: build_msvc/debug?
I tried to reproduce your setup by creating the following files and folders:
Then I opened “x64 Native Tools Command Prompt for VS 2017”, changed my working directory to
topic-202/CMake/build_msvc/, and ran:
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=debug
cmake --build .
I now have
I don’t have any
debug folder, so I can’t help you with “Which variable holds the exe output path: build_msvc/debug?”
Please let me know what I should change in my setup to be able to reproduce properly.
Thanks for testing my code. This morning I reran mine and no debug folder was generated - just as you said.
My code previously had:
but I have commented that out. I wonder if it was cached in some way. Anyway you have answered my question. Thanks.