Skip to content

cmake: set_target_properties on alias target #20419

@malytomas

Description

@malytomas

I did this

Followup to #20313

running cmake with custom provided zlib fails:

CMake Error at externals/curl/curl/CMakeLists.txt:1820 (get_target_property):
  The LOCATION property may not be read from target "zlib-ng".  Use the
  target name directly with add_custom_command, or use the generator
  expression $<TARGET_FILE>, as appropriate.

CMake Error at externals/curl/curl/CMakeLists.txt:1821 (set_target_properties):
  set_target_properties can not be used on an ALIAS target.

in code:

get_target_property(_libname "${_lib}" LOCATION)

I expected the following

No response

curl/libcurl version

commit: 6437bd7

operating system

ubuntu 24, gcc, cmake 3.31

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions