MantisBT - CMake
View Issue Details
0015832CMake(No Category)public2015-11-05 03:082016-05-02 08:30
Nils Gladitz 
Stephen Kelly 
normalmajoralways
closedfixed 
CMake 3.5 
CMake 3.5CMake 3.5 
0015832: ALIAS target scope regression
The commit
    c389f8bb07e900d805ca3163f47b06e3dbe4303b cmLocalGenerator: Port Find method away from GetGeneratorTarget

seems to have broken the following reduced test case:
  cmake_minimum_required(VERSION 3.3)

  project(Foo CXX)

  file(WRITE sub/CMakeLists.txt [[
      file(WRITE foo.cpp "")

      add_library(foo STATIC foo.cpp)
      add_library(Foo::foo ALIAS foo)
  ]])

  add_subdirectory(sub)

  add_custom_target(bar ALL ${CMAKE_COMMAND} -E echo $<TARGET_FILE:Foo::foo>)

At generation time this now produces the diagnostic:

  CMake Error at CMakeLists.txt:14 (add_custom_target):
    Error evaluating generator expression:

      $<TARGET_FILE:Foo::foo>

    No target "Foo::foo"
No tags attached.
Issue History
2015-11-05 03:08Nils GladitzNew Issue
2015-11-06 08:31Brad KingAssigned To => Stephen Kelly
2015-11-06 08:31Brad KingStatusnew => assigned
2015-11-06 08:31Brad KingTarget Version => CMake 3.5
2015-11-09 09:53Brad KingNote Added: 0039850
2015-11-09 09:54Brad KingStatusassigned => resolved
2015-11-09 09:54Brad KingResolutionopen => fixed
2015-11-09 09:54Brad KingFixed in Version => CMake 3.5
2016-05-02 08:30Robert MaynardNote Added: 0040956
2016-05-02 08:30Robert MaynardStatusresolved => closed

Notes
(0039850)
Brad King   
2015-11-09 09:53   
Fixed here:

 Alias: Fix access at generate-time
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ce9742a [^]
(0040956)
Robert Maynard   
2016-05-02 08:30   
Closing resolved issues that have not been updated in more than 4 months.