I guess there are cases when you can't do this. For example, on Windows you can't simply call "cd -" or you may have other kind of script than sh one (for example ant).
Also both source dir and binary dir may be relative to current directory, therefore you don't know neither absolute nor relative to bindir source path. And determining it may be quite cumbersome (again, in ant this can be done using property and property names are global and they're evaluated only once per script, so you can't easily wrap cmake call into macro). On Mon, Jun 6, 2011 at 6:41 PM, Kishore <kitts.mailingli...@gmail.com>wrote: > On Monday 06 Jun 2011 12:38:33 PM Campbell Barton wrote: > > Hi, A handful of times I would have found it useful to run cmake > > without having to be in the build dir, mostly there is some way to > > change the CWD or write a shell wrapper, nevertheless it could still > > be useful when launching builds from scripts or more limited > > environments. > > > > Is there some way to do this?: > > cmake /some/source/dir /some/build/dir > > ... I guess not. Instead just invoke it as > > "cd /some/build/dir && cmake /some/source/dir ; cd -" > > which should bring you back to the current dir. > > > ... rather than > > cd /some/source/dir ; cmake /some/build/dir > > Reversed paths! :P > -- > Cheers! > Kishore > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake >
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake