[Cmake] out of source builds

Amitha Perera perera at cs.rpi.edu
Wed, 7 Jan 2004 11:08:46 -0500


On Wed 07 Jan 2004, Doug Henry wrote:
> The main problem seems to be that when I am
> building in my b32 directory, current_dir/gentypes points to the source
> tree even though it built gentypes in the correct location under b32.
>

Previously, Karr, David had written:
> It seems this is doing what it is told to do.
> CMAKE_CURRENT_SOURCE_DIR is a directory in your source
> tree ... the *source* tree where the original source
> files all are, *not* the tree where you perform your
> out-of-source build.
>
> To denote the corresponding directory in your 
> out-of-source build tree, I believe you should write
> CMAKE_CURRENT_BINARY_DIR, that is, it's "SOURCE" when it 
> is the unique directory tree where all the source files 
> live, and "BINARY" when it is wherever you are building 
> the binaries.

Doug, I think David answered your question. ${CMAKE_CURRENT_SOURCE_DIR}
will always point to "main", and ${CMAKE_CURRENT_BINARY_DIR} will
point either to "b32" or "b64".

Amitha.