[CMake] Avoiding error when using add_subdirectory twice on same path (CMake 2.6.4)

Tyler Roscoe tyler at cryptio.net
Wed Jun 17 12:52:21 EDT 2009


On Wed, Jun 17, 2009 at 11:39:00AM -0400, Brad King wrote:
> previous post we didn't think any real project could be using the
> behavior and thought this change was just a bug fix to help new
> projects avoid subtle problems.  That's why we didn't bother with
> a policy.

I guess I should have stuck my nose in when this topic was being
discussed in the previously-linked thread. I suppose I didn't understand
the ramifications of that conversation.

> Consider the missing policy a bug.  We can fix the bug by adding
> a policy in 2.6.5.  That doesn't mean you can just set it to OLD
> and never change your project though.  A future CMake (say 3.0)
> won't support it.

http://www.cmake.org/Bug/view.php?id=9173

I understand that we should not rely on this behavior forever. I think
that CMake's policies are a very clever design feature, and it seems a
shame not to use policies for this situation.

It is much easier for me to schedule time to change the design of my
scripts when I have several months to figure it out as opposed to
"either do this or be stuck forever in the morass of cmake-2.6.2" :).

Thanks,
tyler


More information about the CMake mailing list