[CMake] Runtime directory / staging question

Brian Davis bitminer at gmail.com
Fri Dec 4 10:04:45 EST 2009


I was wondering if there is now a cleaner implementation of the following
issue (see prior attached email below from Philip) where the PREFIX HACK
must be used to remove Debug and Release from the ouput path.

What I would like to see is:


PathToWherever/Debug/bin
PathToWherever/Debug/lib
PathToWherever/Debug/cfg
...

PathToWherever/Release/bin
PathToWherever/Release/lib
PathToWherever/Release/cfg
...


PathToWherever/Profile/bin
PathToWherever/Profile/lib
PathToWherever/Profile/cfg
...

Is there a clean way to implement this.  I cannot figure out a way to use
the PREFIX hack to get the above result as the ../ needs to be at then end
of the path and would merge debug, release, and profile builds into same
dir.



Thanks,

Brian

-snip-

Philip Lowman wrote:
On Mon, May 26, 2008 at 2:20 AM, Andreas Fredriksson <
deplinenoise-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org <mailto:
deplinenoise-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>> wrote:

   Hi list, first post here.

   I'm converting a software project to use CMake and while doing so I
   realized it the old visual studio projects wrote their output with a
   suffix to a common directory, so executables for different
   configurations would live side by side (foo_d.exe, foo_r.exe).

   I know how to do the suffix thing (<CONFIG>_SUFFIX in the target
   properties), but I can't seem to get all build variants to end up in
   the same directory. If I set the runtime_output_directory option
   globally, everything is placed in configuration-names subdirectories
   such as <intended-dir>/<CONFIG>. Is there any way to lose that
   configuration-named directory?


You need what has come to be called the PREFIX hack.  Simply set the PREFIX
target property to "../" and your target will no longer be generated in the
build solution directory (Debug, Release, etc.) but rather one directory
higher.

-- 
Philip Lowman

-snip-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091204/12c84a15/attachment.htm>


More information about the CMake mailing list