Tom,

That situation has changed since the early days of BRL-CAD's CMake build -
in-src-dir building should now work.  In fact, one of our distcheck-full
builds now tests an in-src-dir build, not just for compilation and
functionality but a working distclean target as well.

Because of the introspection capabilities that we've added to our build in
order to properly support discheck in the first place, we got an accidental
side effect - it was possible to create a distclean rule that functions
inside the source directory.  For builds that have the DISTCLEAN_OUTFILES
filled in in the CMakeLists.txt (currently I believe that's the Make and
Ninja build tools) there should now be a working distclean target to get
back to a bare source tree.

Unfortunately, the mechanisms we use to achieve this are rather invasive
and would be a lot of work to re-create/re-target for another build - it's
just not something CMake was designed to support out of the box.  For
enforcing out-of-source-dir builds you might look at this:

http://stackoverflow.com/questions/1208681/with-cmake-how-would-you-disable-in-source-builds

The main limitation of such things currently is that you still wind up with
a CMakeCache.txt file and CMakeFiles directory that you have to get rid of
- you might try looking into doing something clever like overriding the
MESSAGE command to check if there is an in-src-dir CMakeCache.txt present
and removing it before throwing the fatal error, but I'm not sure how
practical that is.

Cliff

On Mon, Jul 15, 2013 at 5:54 AM, Tom Browder <tom.brow...@gmail.com> wrote:

> Since getting on the CMake band wagon and successfully (albeit newbie
> crudely) converting a non-trivial project to CMake, I have been
> looking for a macro to enforce building out side a project's source
> directory.  I found a user-contributed one that seems to be a
> reasonable start and I am experimenting with it.
>
> My question is:  is there interest in enforcing a CMake build
> restriction in BRL-CAD?  Having borne the pain of an in-source build
> early on I vote yes.
>
> Best,
>
> -Tom
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to