On MacOS, get source code at: https://launchpad.net/stellarium/0.12/0.12.0/+download/stellarium-0.12.0.tar.gz
Uncompress it: tar -xvf stellarium-0.12.0.tar.gz
Compile with dynamic plugins:
mkdir build
cd build
cmake -DBUILD_DYNAMIC_PLUGINS:BOOL=ON -DBUILD_STATIC_PLUGINS:BOOL=OFF ../stellarium-0.12.0
make
make install
Install the build/plugins/AngleMeasure/src/libAngleMeasure.dylib in the proper directory (modules/AngleMeasure).
What happens:
1/ The AngleMeasure plugin loads into stellarium but crashes with the following message:
Loaded plugin "AngleMeasure" .
QObject::setParent: Cannot set parent, new parent is in a different thread
AngleMeasure plugin - press control-A to toggle angle measure mode
As it turns out, the Qt libraries referenced by stellarium and the plugin are not the same:
otool -L stellarium
stellarium:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 17.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.5)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/x86_64/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
@executable_path/../Frameworks/x86_64/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
otool -L libAngleMeasure.dylib
libAngleMeasure.dylib:
QtOpenGL.framework/Versions/4/QtOpenGL (compatibility version 4.8.0, current version 4.8.5)
QtScript.framework/Versions/4/QtScript (compatibility version 4.8.0, current version 4.8.5)
QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.5)
QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.5)
QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.5)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
/opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
2/ Fixing the libraries in the plugin with install_name_tool, the plugin now doesn't crash but fails to load with message:
Couldn't load the dynamic library: "/Users/Ricardo/Library/Application Support/Stellarium/modules/AngleMeasure/libAngleMeasure.dylib" : "The file '/Users/Ricardo/Library/Application Support/Stellarium/modules/AngleMeasure/libAngleMeasure.dylib' is not a valid Qt plugin."
otool -L libAngleMeasure.dylib:
@executable_path/../Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.5)
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.5)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/x86_64/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
@executable_path/../Frameworks/x86_64/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
Yes, when you make an app bundle, the Qt libraries are copied over into the .app. The correct way to resolve this issue would be to updated the library path on the libraries. IF you've tried that, and are still having issues, it's likely the command you used wasn't correct.
You can also just delete the libraries from the .app; as then both the libraries and the main binary will use the system frameworks.
Your issue isn't Stellarium; it's understanding Qt plugins and Mac library paths. So I'm closing this.