On 11-May-16 16:58, Steve Lorimer wrote:
I've recently changed over from using boost-build (http://www.boost.org/build/) to cmake.

Boost build builds in-source.

I've become quite used to building and searching etc from the source root

    ~/src $ b2 module
    ~/src $ git grep foo


This work flow has been broken because I'm not using out of source builds

    ~/src/build $ make module
    ~/src/build $ git grep... dang it! <ctrl-c>
    ~/src/build $ cd ..
    ~/src $ git grep foo
    ~/src $ make modu... dang it! <ctrl-c>
    ~/src $ cd build
    ~/src/build $ make module

I can't be the only one who wants to have the benefit of out of source builds and be able to build from in-source.
Will `-C` help?

~/src $ make -C build module

or in cross-platform fashion:

~/src $ cmake --build build
~/src $ cmake --build build --target foo --config Debug

Ruslo

I imagine it would be relatively simple to create a makefile which navigates to a known build directory (eg: build or debug or...), executes make there, and then changes directory back to where it was called from.

Before I do just this, I thought it better to try leverage the open source community - hence asking the question.

Does anyone have a script or makefile which does just this?

TIA
Steve



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to