KDAB / GammaRay

GammaRay is a tool to poke around in a Qt-application and also to manipulate the application to some extent.
https://www.kdab.com/gammaray
Other
1.61k stars 283 forks source link

android: QT += GammaRayProbe doesn't work #368

Closed fmeerkoetter closed 7 years ago

fmeerkoetter commented 7 years ago

I want to use Gammaray with an Android device. I've followed the instructions outlined here: https://github.com/KDAB/GammaRay/blob/master/Install.txt

Build on Android: $ mkdir android-build $ cd android-build $ export ANDROID_NDK=~/path/to/android-ndk $ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-android.cmake \ -DGAMMARAY_PROBE_ONLY_BUILD=true \ -DCMAKE_PREFIX_PATH=/android/qt5/install/path \ -DCMAKE_INSTALL_PREFIX=/android/qt5/install/path .. $ make [-j CPU_NUMBER+2] $ make install

The make install step completes successfully (2.7 branch).

...
[ 92%] Built target gammaray_widgetinspector_plugin
[ 95%] Built target gammaray_qmlsupport
[100%] Built target gammaray_styleinspector_plugin
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libgammaray_kitemmodels-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libgammaray_common-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libgammaray_core-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libgammaray_probe-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/styles/gammaray_injector_style-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_codecbrowser_plugin-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_fontbrowser_plugin-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_modelinspector-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_quickinspector-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_signalmonitor-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_statemachineviewer_plugin-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_mimetypes-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_network-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_translatorinspector-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_guisupport-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_textdocumentinspector-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_actioninspector_plugin-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_widgetinspector_plugin-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libgammaray_widget_export_actions-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_sceneinspector_plugin-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_styleinspector_plugin-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_qmlsupport-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_quickwidgetsupport-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_bluetooth-qt5_8-arm.so
-- Installing: /usr/local/Qt/5.8/android_armv7/lib/libplugins_gammaray_gammaray_positioning-qt5_8-arm.so
...

Next I've created a simple qmake test project and added "android: QT += GammaRayProbe" to it as outlined in the documentation.

When I now run qmake I always get: Project ERROR: Unknown module(s) in QT: GammaRayProbe

From poking around in the mkspec files of my Qt5.8 install I wonder how this is supposed to work. The make install step doesn't install a .pri file that would allow QT += GammaRayProbe to work.

What am I doing wrong?

vkrause commented 7 years ago

The problem is in probe/CMakeLists.txt, with GAMMARAY_PROBE_ONLY_BUILD set it doesn't install the pri file. Still need to track down why, I'd guess to avoid some install conflicts in multi-probe setups. Not setting GAMMARAY_PROBE_ONLY_BUILD (and if needed rather setting GAMMARAY_BUILD_UI=OFF) might be a viable workaround.

fmeerkoetter commented 7 years ago

I can confirm this workaround. Thank you very much!

vkrause commented 7 years ago

Fixed the build instructions.