[CMake] 2.6.1 RC12 add_subdirectory(xxx EXCLUDE_FROM_ALL) problems

temp thomas_ross at web.de
Mon Jul 28 16:27:10 EDT 2008


> 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

Thanks for clarification.

While I do understand the reason behind that change, the 'EXCLUDE_FROM_ALL'
is a bit misleading now since it doesn't do what it says it does (btw. the
online documentation doesn't reflect the changed behavior either).

Is there any chance to get the old behavior back? With a new policy maybe?

Regards,
Thomas


P.S.: Sorry for the corporate spam in my first mail. Using a temporary
account until I get that sorted.



More information about the CMake mailing list