[CMake] How to configure build output directory

Philip Lowman philip at yhbt.com
Wed Jan 28 21:14:58 EST 2009


On Tue, Jan 27, 2009 at 10:34 PM, Tron Thomas <tron.thomas at verizon.net>wrote:

> I want to use CMake to configure a project that will build several
> applications.  I would like things such that each built program ends up in a
> directory path like:
> .../BuildDirectory/Debug/ApplicationName/AppliationName(.exe)
>
>
> What is needed to cause CMake to configure this kind of build output?


I'm not sure if you'll be able to easily get the "Debug" prior to the
"ApplicationName" because usually Visual Studio adds that.  If you can live
with "ApplicationName/Debug/ApplicationName.exe" the following might work
for you:

add_execuable(ApplicationName foo.cc)
set_target_properties(ApplicationName PROPERTIES RUNTIME_OUTPUT_DIRECTORY
ApplicationName)

I would only consider this if you are building all static executables or are
willing to live with using the PATH environment variable to keep DLLs in
your path.  Otherwise you're very quickly going to run into a problem
running one or more of your executables and you'll have to copy DLLs to
every folder.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090128/9fa01fb7/attachment.htm>


More information about the CMake mailing list