I've just tried this again, and it's still not working quite as I want/expect. Hopefully I'm just missing some step or environment variable.

On 2014.03.31 05:32, Christian Dávid wrote:
As this comes up quite often I retried my approach from scratch. You "just" need all build dependencies installed. I did it with Linux, but it should be the same on windows except one command (and you have to replace cd). If you test it and it works as well, I can publish it on techbase. With windows specific stuff it would even be better.
I don't think I ever clarified that I'm only working on Linux (Gentoo). Once I do get it working here, I might think about trying on Windows, but that's not my primary goal.

# Get sources
git clone git://anongit.kde.org/kmymoney
cd kmymoney/

# Create directory for out of source build
mkdir build
cd build/

# Run cmake and set an install prefix
# "make install" will copy all files there
cmake -DCMAKE_INSTALL_PREFIX=../install/ ../
As I said before, I use "cmake ." and have now set the install dir to /home/jack/install, using the full path because when I tried ../../install (to keep it out of the source tree) it somehow had the ../../ part twice in the install path, and so put everything one level higher than I intended.

# Build and install
make
make install
cd ../install/

# Give KDE's trader the chance to find the new services (= our plugins)
# I guess on Windows (and maybe OS X) this command is different.
# You need  to set an environment variable to your current folder
export KDEDIRS=`pwd`
or in my case /home/jack/install, right?

# Refresh cache of the trader
# after the next run of make install you do not need this again
kbuildsycoca4

# Here you can test if it worked
# It does not show the library path but X-KDE-PluginInfo-Version contains the
# version. At the end is the git commit.
ktraderclient --servicetype "KMyMoneyPlugin"

# run your own build
bin/kmymoney
While this clearly runs the newly built version, I don't believe everything else is also coming from the new install directory. For example, I'm currently testing the Print check plugin, and it's configuration dialog is still defaulting to /usr/share/apps/... instead of /home/jack/install/share/apps, as I would expect or desire - is there some other environment variable to set? I've started reading the docs on techbase, but I haven't yet seen anything that tells me where I've gone wrong.

This allows you to install multiple versions of KMyMoney at the same time. You
just have to set and unset KDEDIRS and run kbuildsycoca4.
Am I correct that unsetting is not important, as long as I run ksyscoca4 with the vars set correctly before I run any particular version?

If you also want to run them at the same time you can use your IDE. This is the
way you should do it anyway as it is quicker for every day use.
I suppose it might save me some grief, but I don't use an IDE. It's just emacs and typing commands. With editing the docs, I don't always do a full compile, just run meinproc and khelpcenter to see the updated manual.

KDevelop and QtCreator allow you to set a "run environment". Just tell them to set KDEDIRS to the appropriate folder there. Your IDE must install KMyMoney every time and execute "kbuildsycoca4" before you run KMyMoney (KDevelop has no direct option for this, you need a script — I think).

One problem left: If you run another instance of KMyMoney now, you have to rebuild the cache (kbuildsycoca4) as SyCoCa tracks the files in it's cache but not the environment variable. So it doesn't notice that a service is no longer available if you just change KDEDIRS (but it notices if you remove or update a .so/.desktop file).

More tutorials on traders and the system configuration cache (SyCoCa) are available on http://techbase.kde.org/Development/Tutorials#Services:_Applications_and_Plugins












_______________________________________________
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel

Reply via email to