[CMake] Creating a Mac bundle for an app dependent on Qt and ParaView

Ben Medina ben.medina at gmail.com
Wed Apr 21 13:43:32 EDT 2010


Hello all,

I am trying to package an app on the Mac into an app bundle. This app
depends on Qt and ParaView, so I have code like this:

    # directories to look for dependencies: Qt, ParaView/VTK
    set(DIRS "${QT_LIBRARY_DIRS};${PARAVIEW_LIBRARY_DIRS}")

    install(CODE
        "
        include(BundleUtilities)
        fixup_bundle(\"${TP_MAC_BUNDLE_PATH}\" \"\" \"${DIRS}\")
        "
        COMPONENT Runtime
    )

However, I get errors about finding the ParaView libs during
packaging. For each ParaView lib:

warning: target
'@executable_path/../MacOS/libvtkPVServerManager.dylib' is not
absolute...
warning: target
'@executable_path/../MacOS/libvtkPVServerManager.dylib' does not
exist...
/usr/bin/otool: can't open file:
@executable_path/../MacOS/libvtkPVServerManager.dylib (No such file or
directory)

Followed by:

Error copying file
"@executable_path/../MacOS/libvtkPVServerManager.dylib" to
".../MyApp.app/Contents/MacOS/libvtkPVServerManager.dylib".

Obviously, it's not looking in the right place for the libs. I'm
expecting it to look in PARAVIEW_LIBRARY_DIRS, as I specified in the
last argument to fixup_bundle (and, indeed, PARAVIEW_LIBRARY_DIRS does
get set to a directory containing the specified libs). But it's
looking in the bundle itself. What am I doing wrong?

Thanks,
Ben


More information about the CMake mailing list