The following issue has been SUBMITTED. ====================================================================== https://cmake.org/Bug/view.php?id=15783 ====================================================================== Reported By: Daniele E. Domenichelli Assigned To: ====================================================================== Project: CMake Issue ID: 15783 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2015-10-12 16:32 CEST Last Modified: 2015-10-12 16:32 CEST ====================================================================== Summary: ALIASED_TARGET property is always set Description: The ALIASED_TARGET property is always set even if no alias is associated to a target.
Steps to Reproduce: Using 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" ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-10-12 16:32 Daniele E. DomenichelliNew Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers