I think on contrary, the value passed from command line wasn't saved into cache. You should do it manually in your CMakeLists.txt, like<div>set(Mylib_DIRĀ "${Mylib_DIR}" CACHE PATH "Path to something")</div>
<div><br></div><div>But variables with _DIR suffix are usually set by find_package command, I'm not sure about expected behavior in this case.<br><br><div class="gmail_quote">On Mon, Sep 10, 2012 at 2:40 PM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">blow away cmakecache.txt and try again.<br>
That is probably cached if it's an option you can set in ccmake or cmake-gui<br>
<div><div class="h5"><br>
On Mon, Sep 10, 2012 at 3:08 AM, Witold E Wolski <<a href="mailto:wewolski@gmail.com">wewolski@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> When calling ccmake I can configure a variable Mylib_DIR (library location)/<br>
><br>
> However, I would like to run the configuration and build process in bash<br>
> script (its an out of source build). Therefore I am trying to configure<br>
> everything on the command line using the -D switch:<br>
><br>
> cmake -G "Eclipse CDT4 - Unix Makefiles"<br>
> -DMylib_DIR=/home/witold/prog/OpenMS/gitsvn ../mapdiv<br>
><br>
> However, when starting ccmake the Mylib_DIR is still set to some default<br>
> other default variable.<br>
><br>
> cheers<br>
> Wolski<br>
><br>
><br>
</div></div>> --<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<br>
> <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:<br>
> <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>
--<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>