[CMake] 2.6.1 RC12 add_subdirectory(xxx EXCLUDE_FROM_ALL) problems

Ross, Thomas Thomas.Ross at rheinmetall.com
Thu Aug 7 11:31:45 EDT 2008


> -----Original Message-----
> From: Bill Hoffman [mailto:bill.hoffman at kitware.com] 
> Sent: Friday, July 25, 2008 8:20 PM
> To: Ross, Thomas
> Cc: cmake at cmake.org
> Subject: Re: [CMake] 2.6.1 RC12 add_subdirectory(xxx 
> EXCLUDE_FROM_ALL) problems
> 
> Ross, Thomas wrote:
> > Hello List!
> > 
> > I was planning to switch a project from CMake 2.4.8 to 
> CMake 2.6.1 when
> > it hits final and was trying out the newest RC12 to see if 
> it works for
> > me so far.
> > 
> > So what am I doing...
> > 
> > I have an "add_subdirectory(3rdParty EXCLUDE_FROM_ALL)" in my main
> > CMakeLists.txt that generates a standalone Solution (using VS2005
> > Generator) in the 3rdParty subdirectory that needs to be 
> compiled and
> > installed bevor the actual "Main Solution" can be build.
> > 
> > With CMake 2.4.8 everything was fine. The projects from 
> 3rdParty didn't
> > show up in the main solution as expected.
> > 
> > Now with CMake 2.6.1 RC12 I get a few (_not_ all) projects 
> from 3rdParty
> > in the main solution.
> > 
> > As it turns out the offending projects that show up in the 
> main solution
> > are all libraries that are linked from projects inside the main
> > solution.
> > 
> > Is there anything I have to do different in the new CMake 
> version or is
> > this a bug?
> > 
> > Thanks in advance
> > Thomas
> > 
> That is a new feature of 2.6.X, any library that is linked into 
> something is included, even if it is excluded from all.  The 
> sub-projects are also now complete.  The reasoning is that 
> you could get 
> incomplete builds if we don't do this.
> 
> -Bill

Hi Bill,

first of all thanks for clarifying this.

Bringing this topic up again since the last mail got no reply. This time
without the corporate spam (hopefully :).

What I find misleading is that EXCLUDE_FROM_ALL doesn't really do what
the name suggest after this change. And I couldn't find any information
on the changed behaviour in the online documentation either.

Since you didn't mentioned any workaround for it, I guess that I either
have to live with the change for now or remove the add_subdirectory all
together and setup the 3rdParty stuff in that directory with an extra
CMake run (probably someone is gonna kill me for the needed 3 extra
clicks). Or maybe i'm just too adapt to this problem that I don't see
any better way to do it?!

If there is no way around this situation would it be possible to have
the old behaviour back with a policy maybe?

Thomas



More information about the CMake mailing list