Web lists-archives.com

Re: kdesrc-build / build-dir

Thanks for explanations. See inline.

On 15.05.2018 02:50, Michael Pyne wrote:
On Sun, May 13, 2018 at 10:32:29AM +0200, gregor.mi.sw wrote:
Regarding the difficulty finding CMake packages, kdesrc-build sets
CMAKE_PREFIX_PATH already, based on your chosen install location (set by
'prefix' or the compatibility 'kdedir' option).

I looked that up in
https://docs.kde.org/trunk5/en/extragear-utils/kdesrc-build/conf-options-table.html. I have
questions to that:

- If you say "compatibility option" do you also mean kdedir is deprecated? At least the
documentation does not say so.

I say "deprecated" in the sense that this variable used to do more (e.g.
set the KDEDIR and KDEDIRS environment variable as they were used back
with KDE 3). As kdesrc-build started to support non-KDE modules I saw
that we needed to support a more generic option to specify where to
install modules.

That option, "prefix", also works for KDE-based modules if "kdedir" is
not set so you can use it alone if you want.

I don't intend on removing "kdedir" however, so it's not deprecated in
the sense that the option will stop working (as others have been removed
from time to time).

- So, the prefix option sets CMAKE_PREFIX_PATH. Does this imply I don't have to export
CMAKE_PREFIX_PATH on the bash prior to running kdesrc-build? What if I do anyway... will this result
in different builds?

You shouldn't have to, at least in most situations.  kdesrc-build will
set CMAKE_PREFIX_PATH to the configured prefix for each module.

If you have separate prefixes that you use (e.g. a separate prefix for
KDE "support" modules, Qt, KF5, Plasma, etc.) then you may have to
manually set CMAKE_PREFIX_PATH.

It should not hurt to set CMAKE_PREFIX_PATH, as long as it is alright if
the path that kdesrc-build adds is found first by CMake when CMake runs
during the build.

This is my current .kdesrc-buildrc file:

      branch-group kf5-qt5
      qtdir /usr
      kdedir ~/kde/usr      # should this be replaced by prefix?
It's more generic to use prefix but you don't /have/ to.  I set both of
the options myself because I don't like having to refer back to the
source code to figure out how the defaults work each time.

Ok, I also try to set both variables.

      source-dir ~/kde/src
      build-dir build       # would ../build also be ok?
../build should work but I'd recommend ~/kde/build for clarity.

Ah, that's much better. I was misleaded by this comment by thinking only relative paths are possible:

    # Directory to build KDE into before installing
    # relative to source-dir by default