MantisBT - CMake
View Issue Details
0008365CMakeCMakepublic2009-01-12 13:142016-06-10 14:30
joelnn 
Kitware Robot 
normalminorhave not tried
closedmoved 
 
 
0008365: dupe of 4209: Xcode generator ignores EXCLUDE_FROM_ALL targets
Sorry to open this dupe but I couldn't find a way to reopen 4209. I've pasted the summary of that ticket:

The Xcode generator completely ignores all targets that are not part of the all target,
notably targets defined in sub directories
that have the EXCLUDE_FROM_ALL flag set.
I don't see why 4209 was closed, it seems easily seen that targets which exist in the CMakeLists.txt in the subdirectory specified by ADD_SUBDIRECTORY(foo EXCLUDE_FROM_ALL) not only aren't built as part of the "all" target, they do not exist whatsoever in the Xcode project.

Something David Cole said sums up what I am trying to do:

Please read "cmake --help-command ADD_SUBDIRECTORY" carefully with respect to the EXCLUDE_FROM_ALL flag. If there are dependencies on any of the libs in the sub-dir, they will be pulled in anyhow because they are required, overriding your EXCLUDE_FROM_ALL request.

I am trying to pull in just the required dependencies and exclude everything else.
No tags attached.
gz testxc.tar.gz (47,884) 2009-02-24 13:20
https://public.kitware.com/Bug/file/2075/testxc.tar.gz
Issue History
2009-01-12 13:14joelnnNew Issue
2009-01-12 13:17joelnnNote Added: 0014535
2009-02-03 11:32Bill HoffmanStatusnew => assigned
2009-02-03 11:32Bill HoffmanAssigned To => David Cole
2009-02-19 11:04David ColeNote Added: 0015218
2009-02-24 13:20joelnnFile Added: testxc.tar.gz
2009-02-24 13:24joelnnNote Added: 0015334
2009-08-03 12:47joelnnNote Added: 0017049
2012-08-13 15:06David ColeStatusassigned => new
2012-08-13 15:06David ColeNote Added: 0030592
2012-08-13 15:07David ColeStatusnew => backlog
2012-08-13 15:23David ColeAssigned ToDavid Cole =>
2016-01-10 06:20Craig ScottNote Added: 0040171
2016-06-10 14:27Kitware RobotNote Added: 0041492
2016-06-10 14:27Kitware RobotStatusbacklog => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:27Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0014535)
joelnn   
2009-01-12 13:17   
Note this works fine with the Makefile generator, I just have the issue when using the Xcode generator. The build in Xcode fails because it attempts to link to a library which was never built, because it wasn't brought in by the dependency (doesn't override the EXCLUDE_FROM_ALL).
(0015218)
David Cole   
2009-02-19 11:04   
joelnn,

Could you provide a sample project that demonstrates the problem?
(And what versions of CMake and Xcode are you using?)

Thanks,
David
(0015334)
joelnn   
2009-02-24 13:24   
I've modified the testxc sample which was included in 0004209 so that m2 is a static library, it's in the attached testxc.tar.gz.

mm links to m2, and you'll see that in build_make I used the Makefile generator, and the build runs with no issue. In build_xcode I used the Xcode generator, and Xcode fails to build when it tries to link against m2 which was not built.

My understanding is that although m2 should be excluded from the "ALL" target, it should be built as a dependency of mm, maybe I am mistaken.

CMake:
cmake version 2.6-patch 2

Xcode:
Component versions
Xcode IDE: 1099.0
Xcode Core: 1100.0
ToolSupport: 1086.0
(0017049)
joelnn   
2009-08-03 12:47   
David, please let me know if that sample is not sufficient.
(0030592)
David Cole   
2012-08-13 15:06   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0040171)
Craig Scott   
2016-01-10 06:20   
Any chance of this one getting resurrected? There is a simple test case attached to the bug and it is a clear contradiction to the documented behaviour (which I had been relying on until someone pointed out my project didn't build with the Xcode generator).
(0041492)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.