Plugins on MacOS??



  • I have been trying for quite some time now to get my app working on MacOS with the plugins that I have created. I have tried everything that I could think of with the location of the plugins, the settings to be configured with the install_name_tool etc but no success...

    Who is willing to have a look at this? You can download the app from https://modeltech.org/download/dfm/dfm.macos.zip and the two plugins named libbasictools.dylib and libsdf3.dylib are in /Contents/PlugIns. You can check whether any plugins are loaded by checking the dfm -> About dfm menu.

    And yes, I have tried macdeployqt but that does not find my core library libdfmcore.1.dylib which I have to manually put in (in this case) /Contents/Libraries and to manually fix the settings using the install_name_tool to get it to work (without this library, nothing works).

    Your help is very much appreciated!



  • Hi.... i know this problem ...
    macdeployqt show only inside the QTDIR for lib... plugin

    I use a workground to make a symlink to QTDIR/lib so macdeployqt can take lib & relink inside bundle mac..

    if (UNIX OR APPLE)
       	if (EXISTS ${SIGNALAPPBUILD})
          message("2- RELINK SHARED LIB IF EXIST ${SIGNALAPPBUILD}  BUNDLE LIB PREPARE ")
       	if (APPLE)
       	FILE(GLOB inlibs RELATIVE "${DIR_LIBTARGET}" "${DIR_LIBTARGET}/libqt_*")
           elseif(UNIX)
       	FILE(GLOB inlibs RELATIVE "${DIR_LIBTARGET}" "${DIR_LIBTARGET}/libqt_*")
           endif()
    	
       	FOREACH(infileName ${inlibs})
       		set(LIBFULLEXIST ${DIR_LIBTARGET}/${infileName} )
       		set(LIBVIRTUALQT ${DIR_LIBQT5}/${infileName} )
       		if (EXISTS ${LIBVIRTUALQT})
       		file(REMOVE ${LIBVIRTUALQT})
       		endif()
    		message("FOR -> RELINK FILE ${LIBFULLEXIST} bundle ")
       		install_symlink( ${LIBFULLEXIST} ${LIBFULLEXIST} )
           ENDFOREACH(infileName)
           endif()
       endif()
    

    But now run..
    https://sourceforge.net/projects/oasidoc/

    0_1506794838730_dfm.png

    In bundle ./otool say... libdfmcore.1.dylib is loaded...

    otool -L dfm
    	dfm:
    		@executable_path/../Libraries/libdfmcore.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    		@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.9.0, current version 5.9.2)
    		@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.9.0, current version 5.9.2)
    		@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.9.0, current version 5.9.2)
    		/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    		/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    		@executable_path/../Frameworks/QtXml.framework/Versions/5/QtXml (compatibility version 5.9.0, current version 5.9.2)
    		/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    		/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    		/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
    		/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
    


  • Thanks for sharing. I will dive into your approach to get macdeployqt to work.

    For now, I did it all manually. The otool output you listed is not produced by macdeployqt but set manually by me - macdeployqt would probably use @rpath instead of @executable_path. Anyway, the problem remains in that the about box should look like what is shown below. The problem is that I do not get that to work when not running my app from QtCreator...

    About DFM on MacOS as it should be


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.