View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015783CMakeCMakepublic2015-10-12 10:322016-06-10 14:31
ReporterDaniele E. Domenichelli 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 3.4 
Target VersionFixed in Version 
Summary0015783: ALIASED_TARGET property is always set
DescriptionThe ALIASED_TARGET property is always set even if no alias is associated to a target.
Steps To ReproduceUsing this CMakeLists.txt

---
cmake_minimum_required(VERSION 3.2)
project(test C)

file(WRITE ${CMAKE_BINARY_DIR}/test.c "int main(int argc, char *argv[]) { return 0; }\n")
add_executable(test_exe ${CMAKE_BINARY_DIR}/test.c)

get_property(_aliased_target_set TARGET test_exe PROPERTY ALIASED_TARGET SET)
if(_aliased_target_set)
  message(STATUS "ALIASED_TARGET is set for target test_exe")
  get_property(_aliased_target_value TARGET test_exe PROPERTY ALIASED_TARGET)
  message(STATUS " ALIASED_TARGET = \"${_aliased_target_value}\"")
else()
  message(STATUS "ALIASED_TARGET is NOT set for target test_exe")
endif()

include (CMakePrintHelpers)
cmake_print_properties(TARGETS test_exe PROPERTIES ALIASED_TARGET)


add_executable(Test::test_exe ALIAS test_exe)

get_property(_aliased_target_set TARGET Test::test_exe PROPERTY ALIASED_TARGET SET)
if(_aliased_target_set)
  message(STATUS "ALIASED_TARGET is set for target Test::test_exe")
  get_property(_aliased_target_value TARGET Test::test_exe PROPERTY ALIASED_TARGET)
  message(STATUS " ALIASED_TARGET = \"${_aliased_target_value}\"")
else()
  message(STATUS "ALIASED_TARGET is NOT set for target Test::test_exe")
endif()

include (CMakePrintHelpers)
cmake_print_properties(TARGETS Test::test_exe PROPERTIES ALIASED_TARGET CICCIO)
---




The actual output is

-- ALIASED_TARGET is set for target test_exe
-- ALIASED_TARGET = "_aliased_target_value-NOTFOUND"
--
 Properties for TARGET test_exe:
   test_exe.ALIASED_TARGET = "property-NOTFOUND"

-- ALIASED_TARGET is set for target Test::test_exe
-- ALIASED_TARGET = "test_exe"
--
 Properties for TARGET Test::test_exe:
   Test::test_exe.ALIASED_TARGET = "test_exe"



The expected output is

-- ALIASED_TARGET is NOT set for target test_exe
--
 Properties for TARGET test_exe:
   test_exe.ALIASED_TARGET = <NOTFOUND>

-- ALIASED_TARGET is set for target Test::test_exe
-- ALIASED_TARGET = "test_exe"
--
 Properties for TARGET Test::test_exe:
   Test::test_exe.ALIASED_TARGET = "test_exe"

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0039573)
Brad King (manager)
2015-10-12 10:36

Is this new to 3.4? Would you please bisect?
(0039577)
Daniele E. Domenichelli (developer)
2015-10-12 12:58

Bisected up to v2.8.12, apparently the problem has always been there, but before the commit cd3d0b613e887eb64a7e5cb043f047ba02bdc58a get_property(... ALIASED_TARGET ... SET) was failing printing "get_property unknown error". After that commit the property is always set, even when it should not be.
(0042854)
Kitware Robot (administrator)
2016-06-10 14:29

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.

 Issue History
Date Modified Username Field Change
2015-10-12 10:32 Daniele E. Domenichelli New Issue
2015-10-12 10:36 Brad King Note Added: 0039573
2015-10-12 12:58 Daniele E. Domenichelli Note Added: 0039577
2016-06-10 14:29 Kitware Robot Note Added: 0042854
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team