[CMake] CMAKE_BUILD_DIR variable

Alan W. Irwin irwin at beluga.phys.uvic.ca
Thu Mar 29 23:42:43 EST 2007


On 2007-03-30 04:23+0100 Min Cu wrote:

> Hi,
>
> I need to use CMAKE_BUILD_DIR variable in my script to create additional 
> files in that directory, however the variable is emty. Is there something 
> extra I need to set it? I do not know the build directory beforehand, also it 
> will vary for different developers. Also, when running make from the build 
> directory (different from the directory of the source files) the 
> CMAKE_SOURCE_DIR variable contains the address of the build direcory: how do 
> I see the address of the direcory of the source files?

The variable you want instead of CMAKE_BUILD_DIR is called CMAKE_BINARY_DIR,
see http://www.cmake.org/Wiki/CMake_Useful_Variables.

I cannot figure out how it would be possible to get CMAKE_SOURCE_DIR to
point to the build tree.  Are you setting it by accident?

Anyhow, your problems may be considerably simplified and perhaps even solved
if you try again with a fresh source tree and invoke cmake from an initially
empty build tree.  What I mean by a "fresh" source tree is one where cmake
has never been run.  You can arrange that by freshly unpacking a tarball or
doing a fresh (svn or cvs) checkout into a previously non-existing directory.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list