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?
You should be able to do this using the NAMELINK_SKIP parameter of the install(TARGETS) command.
NAMELINK_SKIPSimilar 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_ONLYorNAMELINK_SKIPare given, both portions are installed. On platforms where versioned shared libraries do not have symlinks or when a library is not versioned,NAMELINK_SKIPinstalls the library. It is an error to use this parameter outside of aLIBRARYblock.If
NAMELINK_SKIPis specified,NAMELINK_COMPONENThas no effect. It is not recommended to useNAMELINK_SKIPin conjunction withNAMELINK_COMPONENT.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With