[CMake] Output directory

Robert Dailey rcdailey at gmail.com
Fri Dec 5 11:54:37 EST 2008


On Mon, Nov 24, 2008 at 10:34 AM, Ioan Calin Borcoman <iborco at gmail.com>wrote:

> I dump all my apps in the CMAKE_BUILD_DIR with:
>
> set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})


Thanks for your response.

I'm having a hard time understanding how this works. My project structure
looks like this:

myroot/
  component1/
  component2/
  component3/

Each "component" under the "myroot" directory is a separate project. Each
component's project should output executable and library files to
component1/build/${project_name}, and place intermediate files into
component1/build/obj. How can I do this? When in my script do I actually set
CMAKE_EXECUTABLE_OUTPUT_PATH? Do I set it after the project() call? Do I set
it after the add_executable() call? Do I have to set the variable
differently for each project since the output directory will be different
for each project? Here's what I'm currently doing:

set( CMAKE_EXECUTABLE_OUTPUT_PATH "build/${project_name}" )
project( component1 )
add_executable( component1 ${source_files} )

Thanks in advance for the help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081205/b031cb21/attachment.html>


More information about the CMake mailing list