You can't set any of those variables. They are all determined by CMake.<div><br></div><div>The CMAKE_BINARY_DIR is the current working directory when you run cmake or ccmake for the very first time. Or, if you are running cmake-gui, you can set it to a value before the first configure. After that, it is set in stone for that build tree and cannot be set like other cmake variables.<br>
<br></div><div>Same for all _BINARY_DIR and _SOURCE_DIR variables. They are calculated and should never be set.</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">
On Tue, Nov 24, 2009 at 12:24 PM, Voisard, Shane S CIV NSWCDD, K54 <span dir="ltr"><<a href="mailto:christopher.voisard@navy.mil">christopher.voisard@navy.mil</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
command line cmake (2.6.4) is always putting the generated build files under<br>
the current working directory from which cmake is executed, regardless of<br>
the value of CMAKE_BINARY_DIR.<br>
<br>
I have this directory tree; the names are symbolic, not absolute:<br>
parent (current working dir)<br>
|<br>
|<br>
top-level-cmake (project root contains top-level CMakeLists.txt)<br>
<br>
I execute this command from within parent:<br>
cmake.exe -G "Visual Studio 8 2005" \<br>
-C "top-level-cmake\init_cache.txt" top-level-cmake<br>
<br>
The file "init_cache.txt" contains the command:<br>
set (CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/top-level-cmake" CACHE STRING "" FORCE)<br>
<br>
The value of CMAKE_BINARY_DIR before the set command is 'parent'<br>
The value of CMAKE_BINARY_DIR after the set command is 'parent/top-level-cmake'<br>
<br>
cmake executes and finishes with the output:<br>
-- Build files have been written to: parent<br>
<br>
<br>
I have also tried setting the values for CMAKE_SOURCE_DIR, PROJECT_SOURCE_DIR,<br>
PROJECT_BINARY_DIR in various combinations, but with no effect.<br>
<br>
I have read the 2.6 manpage, the cmake wiki and several mailing list postings,<br>
but I have not found a solution to this problem.<br>
<br>
This is important to us because we want to evolve our workflow so that<br>
cmake is executed from within another build script.<br>
<br>
Thanks,<br>
Shane Voisard<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>