install and export alias target
I've got a project with a static library (target foo_lib_static
), a shared library using the static library (target foo_lib_c
) and an app (cli) also using the static library (target foo_app
). I install the app and the shared library and also create a foo-config.cmake
using install(TARGETS)
and install(EXPORT)
I use set_target_properties(foo_lib_c PROPERTIES OUTPUT_NAME foo)
to get a well named libfoo.so
or foo.dll
In another project I want to use find_package(foo)
and target_link_libraries(bar PRIVATE foo::foo)
to find and link my library. But I don't want to reduce the explicitness of my target names by renaming foo_lib_c
I tried to create an alias foo
and install it instead of foo_lib_c
, but alias cannot be installed.
Is there a way to accomplish this?