From: Dmitry Kalinkin Date: Mon, 22 Jun 2020 00:30:12 +0000 (-0400) Subject: zzip/CMakeLists.txt: fix for macOS X-Git-Tag: v0.13.72~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da39e2ee3c98c8b415397196e62fd3617c600cd6;p=zziplib zzip/CMakeLists.txt: fix for macOS Fix for APPLE where dylib goes in the end This is hardcoded here: https://gitlab.kitware.com/cmake/cmake/-/blob/742ff97f809410055b22405a6b5728e72c458683/Source/cmGeneratorTarget.cxx#L5890-5903 Also a related thread: https://cmake.org/pipermail/cmake/2013-February/053605.html --- diff --git a/zzip/CMakeLists.txt b/zzip/CMakeLists.txt index 8ba8dab..987ec73 100644 --- a/zzip/CMakeLists.txt +++ b/zzip/CMakeLists.txt @@ -269,6 +269,10 @@ if(ZZIPCOMPAT) get_target_property(libversion libzzip VERSION) install(CODE "execute_process(COMMAND bash -c \"set -e cd $DESTDIR/${libdir} + if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then + # Fix for APPLE where dylib goes in the end + ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion} + fi [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0 echo -n .. Installing: `pwd` ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${librelease}${dll}.10 @@ -290,6 +294,10 @@ if(ZZIPLIBTOOL) get_target_property(libversion libzzip VERSION) install(CODE "execute_process(COMMAND bash -c \"set -e cd $DESTDIR/${libdir} + if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then + # Fix for APPLE where dylib goes in the end + ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion} + fi [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0 echo -n .. Installing: `pwd` ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll} @@ -299,6 +307,10 @@ if(ZZIPLIBTOOL) get_target_property(libversion libzzipfseeko VERSION) install(CODE "execute_process(COMMAND bash -c \"set -e cd $DESTDIR/${libdir} + if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then + # Fix for APPLE where dylib goes in the end + ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion} + fi [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0 echo -n .. Installing: `pwd` ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll} @@ -308,6 +320,10 @@ if(ZZIPLIBTOOL) get_target_property(libversion libzzipmmapped VERSION) install(CODE "execute_process(COMMAND bash -c \"set -e cd $DESTDIR/${libdir} + if [ -f ${lib}${libname}${librelease}.${libversion}${dll} ]; then + # Fix for APPLE where dylib goes in the end + ln -s ${lib}${libname}${librelease}.${libversion}${dll} ${lib}${libname}${librelease}${dll}.${libversion} + fi [ -f ${lib}${libname}${librelease}${dll}.${libversion} ] || exit 0 echo -n .. Installing: `pwd` ln -svf ${lib}${libname}${librelease}${dll}.${libversion} ${lib}${libname}${dll}