[CMake] CMAKE_BUILD_DIR variable

Min Cu min.cu at hotmail.com
Fri Mar 30 02:47:12 EST 2007


It is not an accident. I have a cmake script which is run by cmake -P during 
make. Make is called from the build directory which causes both variables to 
point to it. I cannot see the original source directory anywhere. (btw I 
cannot see the cache either). As a work around I store all the variables in 
a text file on the build directory (created during the first run of the 
cmake) and then include it in the cmake script (run during make). I would 
like to know if there is a way of avoiding creating additional files?

Thanks,
Min


>From: "Alan W. Irwin" <irwin at beluga.phys.uvic.ca>
>To: Min Cu <min.cu at hotmail.com>
>CC: cmake at cmake.org
>Subject: Re: [CMake] CMAKE_BUILD_DIR variable
>Date: Thu, 29 Mar 2007 21:42:43 -0700 (PDT)
>
>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
>__________________________
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake

_________________________________________________________________
Txt a lot? Get Messenger FREE on your mobile.  
https://livemessenger.mobile.uk.msn.com/



More information about the CMake mailing list