[CMake] 2.6.4 add_subdirectory with same argument broken?

Brad King brad.king at kitware.com
Wed May 6 00:00:15 EDT 2009


Carsten Neumann wrote:
> It does so by performing multiple passes over the source tree 
[snip]
> This all works fine with cmake 2.6.x (x < 4), but the latest version 
> complains in the OSGSETUP pass on the first call to ADD_SUBDIRECTORY in 
> that pass (see attachment for more details):
[snip]
> Is this intended behavior, should I file a bug report, any ideas how to 
> make this or something similar work again?

Adding the same build directory multiple times even from the same
source tree is not allowed, but was not enforced until now.  When you
did this before CMake would generate the build files over and over
again.  It just happened that the last time wrote the files you want.

I suggest moving the meta-information into a separate file in each
subdirectory which you can load with a normal include() command.  Then
you only need to add each subdirectory once.

-Brad


More information about the CMake mailing list