cmake CMP0028 & missing targets - what does one do about it?

Alex Merry alex.merry at kde.org
Wed Apr 1 20:39:45 UTC 2015


On Wednesday 01 April 2015 08:59:30 Harald Sitter wrote:
> On Tue, Mar 31, 2015 at 9:29 PM, Alex Merry <alex.merry at kde.org> wrote:
> > On Thursday 19 March 2015 14:16:35 Harald Sitter wrote:
> >> Problem tldr: target A links library B, A doesn't get the includes of
> >> link libraries of B by default. e.g. A links B, B links karchive, A
> >> doesn't have access to the karchive headers. also if karchive wasn't
> >> found in a super-scope of A and B, A will not know about karchive.
> > 
> > Sorry for the delayed response. As I understand it, targets have global
> > scope, so this shouldn't happen.
> > 
> >> [3] kde:scratch/sitter/CMP0028
> > 
> > Indeed, this configures just fine for me (CMake 3.2.1), although it
> > doesn't
> > build because karchiveentry.h doesn't include all the headers it needs.
> > 
> > What version of CMake are you using?
> 
> 3.0.2
> 
> this is what I get:
> http://paste.ubuntu.com/10716804/

This appears to be a regression with the 3.0 branch of CMake. 2.8.12 doesn't 
have an issue, and neither does 3.1.3.

I can't think of a better approach than to work around it by moving 
find_package calls up to the common ancestor CMakeLists.txt - most projects 
don't notice this issue, because they do the majority of their find_package 
calls in the root CMakeLists.txt.

Alex


More information about the Kde-frameworks-devel mailing list