Skip to content

Instantly share code, notes, and snippets.

@gsdefender
Forked from RichVRed/install.sh
Last active November 4, 2018 21:31
Show Gist options
  • Save gsdefender/980a359912628dee5723c86287719c59 to your computer and use it in GitHub Desktop.
Save gsdefender/980a359912628dee5723c86287719c59 to your computer and use it in GitHub Desktop.
Install QCacheGrind on Ubuntu
#!/bin/bash
# Build against Qt 4
sudo apt-get install qt4-default
# Build against Qt 5
#sudo apt-get install qt5-default
wget http://kcachegrind.sourceforge.net/kcachegrind-0.7.4.tar.gz
tar xvf kcachegrind-0.7.4.tar.gz
cd kcachegrind-0.7.4
# If building against Qt 5, uncomment lines 12-16:
# ************************************************
#if [ ! -f costitem-qt5.h ]; then
#cat costitem.h | sed -e 's:<QString>:<QString>\n#include <QObject>\n:g' >costitem-qt5.h
#mv costitem.h costitem-qt4.h
#ln -s costitem-qt5.h costitem.h
#fi
## If switching back to Qt 4, you only need to do
## rm costitem.h
## ln -s costitem-qt4.h costitem.h
qmake && make
sudo mkdir -p /usr/local/share/icons/hicolor/32x32/apps /usr/local/share/icons/hicolor/48x48/apps
sudo install -m 755 qcachegrind/qcachegrind /usr/local/bin
sudo install -m 644 qcachegrind/qcachegrind.desktop /usr/local/share/applications/
sudo install -m 644 kcachegrind/hi32-app-kcachegrind.png /usr/local/share/icons/hicolor/32x32/apps/kcachegrind.png
sudo install -m 644 kcachegrind/hi48-app-kcachegrind.png /usr/local/share/icons/hicolor/48x48/apps/kcachegrind.png
sudo echo "Icon=/usr/local/share/icons/hicolor/48x48/apps/kcachegrind.png" >>/usr/local/share/applications/qcachegrind.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment