From d00c742403d74da3ca532e335ca03c189644db8e Mon Sep 17 00:00:00 2001 From: Guido Draheim Date: Tue, 19 Jan 2021 05:00:03 +0100 Subject: [PATCH] #111 adding ln_svf detection to zzipwrap/cmake as well --- zzipwrap/CMakeLists.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/zzipwrap/CMakeLists.txt b/zzipwrap/CMakeLists.txt index ea7ea93..f6b85a2 100644 --- a/zzipwrap/CMakeLists.txt +++ b/zzipwrap/CMakeLists.txt @@ -87,6 +87,22 @@ install(TARGETS libzzipwrap LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(ZZIP_LIBTOOL) + if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) + execute_process(COMMAND bash -c "ln --help" + OUTPUT_VARIABLE ln_verbose_help + ERROR_QUIET + ) + string(FIND "${ln_verbose_help}" "verbose" ln_verbose_found) + if(${ln_verbose_found} STREQUAL "-1") + set(ln_svf "ln -sf") + else() + set(ln_svf "ln -svf") + endif() + message(STATUS "Can symlink libraries with: ${ln_svf}") + endif() +endif() + if(ZZIP_LIBTOOL) if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) set(lib ${CMAKE_SHARED_LIBRARY_PREFIX}) @@ -99,7 +115,7 @@ if(ZZIP_LIBTOOL) cd $DESTDIR/${libdir} [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0 echo -n .. Installing: `pwd` - ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll} + ${ln_svf} ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll} \")") endif() endif() -- 2.40.0