[CMake] binary directory?

David Cole david.cole at kitware.com
Tue Oct 28 10:37:03 EDT 2008


Just give ADD_SUBDIRECTORY a second argument that tells it where to put the
corresponding binary directory structure.
Something like:
ADD_SUBDIRECTORY(../blah "${CMAKE_CURRENT_BINARY_DIR}/blah")

(Assumes you do not also have an "ADD_SUBDIRECTORY(blah)" call and a
"./blah" directory in addition to the "../blah" directory...)

"cmake --help-command ADD_SUBDIRECTORY" for more details.


HTH,
David


On Tue, Oct 28, 2008 at 2:01 AM, Jack Andrews <effbiae at gmail.com> wrote:

> i'm getting this error:
>
> >cmake -G "Visual Studio 8 2005"
> CMake Error: Error in cmake code at
> C:/cygwin/home/jack/play/d/CMakeLists.txt:1:
> ADD_SUBDIRECTORY not given a binary directory but the given source
> directory "C:/cygwin/home
> /jack/play/bdwgc" is not a subdirectory of
> "C:/cygwin/home/jack/play/d".  When specifying an
>  out-of-tree source a binary directory must be explicitly specified.
> Current CMake stack:
> [1]     C:/cygwin/home/jack/play/d/CMakeLists.txt
> -- Configuring done
>
>
> the first line of my CMakeLists.txt is:
> ADD_SUBDIRECTORY(../bdwgc)
>
>
> is there a way to include the project defined in this sibling
> directory in the solution?
>
>
> ta, jack
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081028/36f73d07/attachment.htm>


More information about the CMake mailing list