Reputation: 27385
I'm building two packages in a distribution:
The problem is to include a correct symlink into any of them. Currently I use:
set_target_properties(mylib PROPERTIES
SOVERSION "${PROJECT_VERSION_MAJOR}"
VERSION "${PROJECT_VERSION}")
and when specifying the following CPack
configuration:
install (TARGETS mylib
LIBRARY
DESTINATION /usr/lib
COMPONENT runtime)
install (TARGETS mylib
LIBRARY
DESTINATION /usr/lib
COMPONENT dev)
install (DIRECTORY include/
DESTINATION /usr/include/mylib
COMPONENT dev)
the runtime shared library package then contains the following symlink chain:
/usr/lib/libmylib.so -> libmylib.so.0
/usr/lib/libmylib.so.0 -> libmylib.so.0.0.1
/usr/lib/libmylib.so.0.0.1
The problem is /usr/lib/libmylib.so -> libmylib.so.0
is redundant in the runtime shared library package since it is only necessary when building a binary that uses this libmylib
.
Question: Is there a way to excelude that /usr/lib/libmylib.so -> libmylib.so.0
symlink from runtime shared library package?
Upvotes: 3
Views: 436
Reputation: 50554
You should be able to do this using the NAMELINK_SKIP
parameter of the install(TARGETS)
command.
NAMELINK_SKIP
Similar to
NAMELINK_ONLY
, but it has the opposite effect: it causes the installation of library files other than the namelink when a library target is installed. When neitherNAMELINK_ONLY
orNAMELINK_SKIP
are given, both portions are installed. On platforms where versioned shared libraries do not have symlinks or when a library is not versioned,NAMELINK_SKIP
installs the library. It is an error to use this parameter outside of aLIBRARY
block.If
NAMELINK_SKIP
is specified,NAMELINK_COMPONENT
has no effect. It is not recommended to useNAMELINK_SKIP
in conjunction withNAMELINK_COMPONENT
.
Upvotes: 1