How to specify build output directory path?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to specify build output directory path?

David Aldrich-2

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:

add_subdirectory(../Kernel Kernel)
add_executable(MyExe ../Kernel/main.cpp)

The resulting directory structure, after a build, is:

Kernel       <== source files
    |-- build_msvc
            |--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).


How would I achieve this?

Which variable holds the exe output path: build_msvc/debug?

Best regards


Powered by

Kitware offers various services to support the CMake community. For more information on each offering, please visit

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe:

This mailing list is deprecated in favor of