How to build it:

1- Install prerequisits:
	* xsltproc
	* libgrantlee5-dev (>=5.0.0)
	* libsqlite3-dev (>=3.7.0)
	* libofx-dev 
	* libboost-dev 
	* libqjson-dev (>=0.8.0)
	* qtscript5-dev 
	* qttools5-dev 
	* libqt5webkit5-dev  (If you want to build with WebKit. You must not activate the option SKG_WEBENGINE) (Preferred) 
	* libqt5webengine5-dev (If you want to build with WebEngine. You must activate the option SKG_WEBENGINE)
	* libqt5svg5-dev 
	* libkf5coreaddons-dev 
	* libkf5archive-dev 
	* libkf5xmlgui-dev 
	* libkf5wallet-dev 
	* libkf5parts-dev 
	* libkf5newstuff-dev 
	* libkf5iconthemes-dev 
	* libkf5kdelibs4support-dev 
	* libkf5notifyconfig-dev 
	* libkf5runner-dev 
	* plasma-framework-dev 
	* kdoctools-dev 
	* kgendesignerplugin 
	* libqca-qt5-2-dev
	* libkf5activities-dev
	* kross-dev
	* sqlite3
        * qtdeclarative5-controls-plugin
        * libsqlcipher-dev
        * sqlcipher
	
	Examples:
	On ubuntu:
                sudo apt-get install pkg-config build-essential cmake devscripts cdbs extra-cmake-modules kross-dev sqlite3 sqlcipher libsqlcipher-dev libgrantlee5-dev libsqlite3-dev libofx-dev libboost-dev xsltproc libqjson-dev qtscript5-dev qttools5-dev libqt5webkit5-dev libqt5webengine5-dev libqt5svg5-dev libkf5coreaddons-dev libkf5archive-dev libkf5xmlgui-dev libkf5activities-dev libkf5wallet-dev libkf5parts-dev libkf5newstuff-dev libkf5iconthemes-dev libkf5kdelibs4support-dev libkf5notifyconfig-dev libkf5runner-dev plasma-framework-dev kdoctools-dev kgendesignerplugin libqca-qt5-2-dev qtbase5-private-dev qtdeclarative5-controls-plugin

2- Extract the archive, and enter the "skrooge" directory. Then run :
	mkdir build && cd build
        cmake .. -DCMAKE_INSTALL_PREFIX=[path to your KDE installation]
	make

	Examples:
	On ubuntu:
		mkdir build && cd build
                cmake .. -DCMAKE_INSTALL_PREFIX=`kf5-config --prefix` -DQT_PLUGIN_INSTALL_DIR=`kf5-config --qt-plugins` -DCMAKE_BUILD_TYPE=release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DSKG_WEBENGINE=ON -DSKG_BUILD_TEST=OFF -DSKG_DESIGNER=OFF 
		make

3- Prepare to run
        Skrooge uses plugins. By default, plugins are loaded from your system. It means that, if you have a local build of Skrooge and an other version of Skrooge installed on your system. The system version of plugins will be loaded.
        The easiest solution is to install your local build like this:
                make install (as root)
                
                Examples:
                On ubuntu:
                        sudo make install 
        
        If you don't want to install Skrooge on your system, you will have to set many Qt and Kde environment variables before running skrooge.
        This is not easy to do.
4- Run the test
        ctest

5- Run skrooge
        /usr/bin/skrooge
    
############################################################################################################################################################
# For Static code analysis (scan-build)
CXX=clang++ CC=clang scan-build -k cmake .. -DCMAKE_INSTALL_PREFIX=`kf5-config --prefix` -DCMAKE_BUILD_TYPE=profile
make clean
scan-build -k -o results make

# With sanitizer (-fno-omit-frame-pointer )
cmake .. -DCMAKE_INSTALL_PREFIX=`kf5-config --prefix` -DQT_PLUGIN_INSTALL_DIR=`kf5-config --qt-plugins` -DCMAKE_BUILD_TYPE=profile -DECM_ENABLE_SANITIZERS='undefined,address'
export ASAN_OPTIONS=detect_leaks=1

# With clazy
export CXX="clazy"
export CLAZY_CHECKS="level0,level1,level2,level3"
export CLAZY_FIXIT="fix-fromCharPtrAllocations"
cmake .. -DCMAKE_CXX_COMPILER=clazy -DCMAKE_INSTALL_PREFIX=`kf5-config --prefix` -DQT_PLUGIN_INSTALL_DIR=`kf5-config --qt-plugins` -DCMAKE_BUILD_TYPE=

make clean
make -i > t.txt 2>&1
cat t.txt | grep "warning:" | grep -v "ui_" | grep -v "moc_" | grep -v "_settings" |grep -v "/usr/include" | grep -v "FixIt failed" | sort -u > warning.txt 

# With clazy-standalone
cmake .. -DCMAKE_INSTALL_PREFIX=`kf5-config --prefix` -DQT_PLUGIN_INSTALL_DIR=`kf5-config --qt-plugins` -DCMAKE_BUILD_TYPE=release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 
make
find . -name "*cpp" | xargs clazy-standalone -checks=level2 -p compile_commands.json > t.txt 2>&1
cat t.txt | grep "warning:" | grep -v "ui_" | grep -v "moc_" | grep -v "_settings" |grep -v "/usr/include" | grep -v "FixIt failed" | sort -u > warning.txt 

# With coverity
export PATH=~/Telechargements/cov-analysis-linux64-8.7.0/bin/:$PATH
make clean
cov-build --dir cov-int make -j 4
tar caf skrooge.bz2 cov-int

# iwyu
iwyu_tool.py -p .

