Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-14 Thread Michael Pyne
On Sat, May 12, 2018 at 02:23:47PM +0200, gregor.mi.sw wrote:
> On 10.05.2018 02:22, Michael Pyne wrote:
> > On Wed, May 09, 2018 at 01:12:10PM +0200, gregor.mi.sw wrote:
> >> Am 09.05.2018 08:19 schrieb Ben Cooksley:
> >>> On Wed, May 9, 2018 at 9:28 AM, gregor.mi.sw 
> >>> wrote:
>  On 08.05.2018 23:15, Milian Wolff wrote:
> > On Dienstag, 8. Mai 2018 22:40:39 CEST gregor.mi.sw wrote:
> >>
> >> Hello,
> >>
> >> I have a question regarding kdesrc-build and CMake.
> >>
> >> I setup the build environment variables and ran kdesrc-build and got
> >> a
> >> compiler error kinfocenter.
> >>
> >> Now it shows the correct (local) path for solid (but not the other
> >> ones).
> >> Is
> >> there an environment variable or something I have to set to tell
> >> Cmake to
> >> always look for local modules first?
> > 
> > This is all sort of odd.
> > 
> > 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).
> > 
> > If you're installing to /usr or /usr/local then maybe that is why CMake
> > is finding system libraries?  Roman Gilg actually recently submitted a
> > patch to fix this (https://phabricator.kde.org/D12739), if that's what
> > the problem is.
> > 
> > Try CMAKE_PREFIX_PATH. See e.g. this old blog post on the matter:
> >
> > https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it
> 
> 
>  Thanks for the hint. The variable was already set:
> 
>  CMAKE_PREFIX_PATH=/home/gregor/kde/usr:
> 
>  In the blog post, it is said, that CMAKE_PREFIX_PATH is searched
>  _first_. I
>  find it strange that I had to uninstall the system-wide devel package
>  in
>  order to have cmake pick up the library in /home/gregor/kde/usr. And
>  for the
>  other libraries it still uses /usr. Any idea how to investigate this
>  further?
> >>>
> >>> If you have previously run CMake without setting CMAKE_PREFIX_PATH you
> >>> will need to remove your build directory first, otherwise it will
> >>> reuse modules it has already found.
> >>
> >> Hello Ben, I already removed the build dir (forgot to mention that). I
> >> assume that it should be sufficient to delete the build dir of the
> >> application that should be configured
> >> (/home/gregor/kde/src/build/kde/workspace/kinfocenter/) and not also
> >> those of the imported libraries (KF5Service, KF5Solid, KF5Wayland etc.).
> >> I wonder if there is maybe an additional (global) cmake cache or a
> >> special behaviour of kdesrc-build.
> > 
> > There's no special behavior for kdesrc-build here (though there is a
> > cache, default .kdesrc-build-data in the same directory as your
> > kdesrc-buildrc).
> > 
> > However the CMake package to find when a CMake module config file is
> > loaded is based on the CMake paths when the module config file was
> > *installed*.  So all imported libraries would have be reinstalled to
> > fully fix the paths.
> 
> I assume "be reinstalled" also means "be rebuild" because otherwise wrong 
> precompiled files would be 
> installed again, right?

Yes, that's right.

> > I've had these problems over the years and I've almost always found it
> > easier just to remove the CMake module config files entirely before
> > reinstalling to force it to be regenerated.
> 
> Do you mean those files: /home/gregor/kde/usr/lib64/cmake/* or another 
> location? Why only the CMake 
> module config files if a complete rebuild is required (--refresh-build)?

If your path is like mine then yes.  In my case, they are files at 
~/kde-5/lib64/cmake/*.

For instance if I run ~/kde-5/lib64/cmake/KF5I18n/*Config*.cmake I get:

~/kde-5/lib64/cmake/KF5I18n/KF5I18nConfig.cmake
~/kde-5/lib64/cmake/KF5I18n/KF5I18nConfigVersion.cmake

and these files refer to other CMake metadata within the same directory.

Other CMake modules trying to find KF5::I18n will, if CMake finds these
*Config.cmake files in its search path first, end up using the metadata
embedded in these files to pull in KF5::I18n and its dependencies.

So if CMake finds a system set of *Config.cmake files it will end up
pulling in other dependencies from the system and potentially end up
linking against the wrong libraries.

> I still have some hope I can save this total re-compilation which takes at 
> least 1 hour for me to 
> reach applications like kinfocenter. Spordically, I want to code during the 
> week after work in the 
> evening and I find myself struggeling to get the dependencies build ready. 
> And when it is ready, the 
> time for this day is over :-). And a few days/weeks later a similar story. If 
> I don't code every day 
> this setup time is a major obstacle to reach a point where productive coding 
> is possible. Thanks for 
> clarifying some of the build details which makes it easier to better figure 
> 

Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-14 Thread Michael Pyne
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:
> 
> global
>  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.

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

>  make-options -j4
>  svn-server svn+ssh://s...@svn.kde.org/home/kde
> end global

Regards,
 - Michael Pyne


Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-13 Thread gregor.mi.sw

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.


- 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?


This is my current .kdesrc-buildrc file:

global
branch-group kf5-qt5
qtdir /usr
kdedir ~/kde/usr  # should this be replaced by prefix?
source-dir ~/kde/src
build-dir build   # would ../build also be ok?
make-options -j4
svn-server svn+ssh://s...@svn.kde.org/home/kde
end global

include /home/gregor/kde/src/kdesrc-build/kf5-frameworks-build-include
include /home/gregor/kde/src/kdesrc-build/kf5-workspace-build-include
include /home/gregor/kde/src/kdesrc-build/kf5-applications-build-include

I also filed two wish reports regarding those questions:

- https://bugs.kde.org/show_bug.cgi?id=394195 ("Warn if current environment variables do not match 
with the build of other modules")
- https://bugs.kde.org/show_bug.cgi?id=394196 ("Option to print all needed environment variables for 
manual cmake/build")


Gregor


Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-12 Thread Roman Gilg
Please try again with kdesrc-build from current master. I just pushed
a patch (mentioned by Michael before) about not moving up the /usr
directory in multiple environment variables including
CMAKE_PREFIX_PATH, what might have overwritten your manual setting.

Regarding your CMakeCache.txt: /usr/local is the default install
location set by cmake because you only set the source location in your
cmake call. I don't know more about the other values.

On Sat, May 12, 2018 at 12:20 PM, gregor.mi.sw  wrote:
>
>
> On 09.05.2018 13:12, gregor.mi.sw wrote:
>>
>>
>>
>> Am 09.05.2018 08:19 schrieb Ben Cooksley:
>>>
>>> On Wed, May 9, 2018 at 9:28 AM, gregor.mi.sw 
>>> wrote:



 On 08.05.2018 23:15, Milian Wolff wrote:
>
>
> On Dienstag, 8. Mai 2018 22:40:39 CEST gregor.mi.sw wrote:
>>
>>
>> Hello,
>>
>> I have a question regarding kdesrc-build and CMake.
>>
>> I setup the build environment variables and ran kdesrc-build and got a
>> compiler error kinfocenter.
>>
>> I investigated
>> /home/gregor/kde/src/build/kde/workspace/kinfocenter/CMakeCache.txt
>> and
>> found the following lines
>>
>>   //The directory containing a CMake configuration file for
>> KF5Service.
>>   KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service
>>
>>   //The directory containing a CMake configuration file for
>> KF5Solid.
>>   KF5Solid_DIR:PATH=/usr/lib64/cmake/KF5Solid
>>
>>   //The directory containing a CMake configuration file for
>> KF5Wayland.
>>   KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland
>>
>> The directories of the needed KF5 frameworks point to the system wide
>> installed ones.
>>
>> I removed the system-wide devel package for solid (because it caused
>> the
>> compiler error) and ran kdesrc-build again:
>>
>>   //The directory containing a CMake configuration file for
>> KF5Service.
>>   KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service
>>
>>   //The directory containing a CMake configuration file for
>> KF5Solid.
>>   KF5Solid_DIR:PATH=/home/gregor/kde/usr/lib64/cmake/KF5Solid
>>
>>   //The directory containing a CMake configuration file for
>> KF5Wayland.
>>   KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland
>>
>> Now it shows the correct (local) path for solid (but not the other
>> ones).
>> Is
>> there an environment variable or something I have to set to tell Cmake
>> to
>> always look for local modules first?
>
>
>
> Try CMAKE_PREFIX_PATH. See e.g. this old blog post on the matter:
>
> https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it



 Thanks for the hint. The variable was already set:

 CMAKE_PREFIX_PATH=/home/gregor/kde/usr:

 In the blog post, it is said, that CMAKE_PREFIX_PATH is searched
 _first_. I
 find it strange that I had to uninstall the system-wide devel package in
 order to have cmake pick up the library in /home/gregor/kde/usr. And for
 the
 other libraries it still uses /usr. Any idea how to investigate this
 further?
>>>
>>>
>>> If you have previously run CMake without setting CMAKE_PREFIX_PATH you
>>> will need to remove your build directory first, otherwise it will
>>> reuse modules it has already found.
>>
>>
>> Hello Ben, I already removed the build dir (forgot to mention that). I
>> assume that it should be sufficient to delete the build dir of the
>> application that should be configured
>> (/home/gregor/kde/src/build/kde/workspace/kinfocenter/) and not also those
>> of the imported libraries (KF5Service, KF5Solid, KF5Wayland etc.). I wonder
>> if there is maybe an additional (global) cmake cache or a special behaviour
>> of kdesrc-build.
>>
>> Gregor
>>
>
> Today, I opened the CMakeCache.txt again in Kate, deleted it and ran
>
> $ cmake /home/gregor/kde/src/kde/workspace/kinfocenter/
>
> with CMAKE_PREFIX_PATH set to "/home/gregor/kde/usr:"
>
> With Kate I made a diff between the previous (which did not work) and
> current (now works) file:
>
> https://ibb.co/bOznrJ (left: old/not working, right: new/compiles)
>
> Noteworthy differences:
> OLD (wrong paths)   NEW (correct paths)
> CMAKE_INSTALL_PREFIX:PATH=/home/gregor/kde/usr
> CMAKE_INSTALL_PREFIX:PATH=/usr/local
> CMAKE_PREFIX_PATH:UNINITIALIZED=/usrnothing
> ECM_DIR:PATH=/usr/share/ECM/cmake
> ECM_DIR:PATH=/home/gregor/kde/usr/share/ECM/cmake
>
> The interesting thing is that
> 1. Although the CMAKE_PREFIX_PATH was set as environment variable, it is not
> explicitly mentioned in the CMakeCache.txt but the ECM_DIR:PATH is now
> correct.
> 2. The CMAKE_INSTALL_PREFIX in the new version points to /usr/local which I
> assume is normally set by kdesrc-build to the correct location.
>
> So the 

Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-12 Thread gregor.mi.sw



On 09.05.2018 13:12, gregor.mi.sw wrote:



Am 09.05.2018 08:19 schrieb Ben Cooksley:

On Wed, May 9, 2018 at 9:28 AM, gregor.mi.sw  wrote:



On 08.05.2018 23:15, Milian Wolff wrote:


On Dienstag, 8. Mai 2018 22:40:39 CEST gregor.mi.sw wrote:


Hello,

I have a question regarding kdesrc-build and CMake.

I setup the build environment variables and ran kdesrc-build and got a
compiler error kinfocenter.

I investigated
/home/gregor/kde/src/build/kde/workspace/kinfocenter/CMakeCache.txt and
found the following lines

  //The directory containing a CMake configuration file for
KF5Service.
  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

  //The directory containing a CMake configuration file for KF5Solid.
  KF5Solid_DIR:PATH=/usr/lib64/cmake/KF5Solid

  //The directory containing a CMake configuration file for
KF5Wayland.
  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

The directories of the needed KF5 frameworks point to the system wide
installed ones.

I removed the system-wide devel package for solid (because it caused the
compiler error) and ran kdesrc-build again:

  //The directory containing a CMake configuration file for
KF5Service.
  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

  //The directory containing a CMake configuration file for KF5Solid.
  KF5Solid_DIR:PATH=/home/gregor/kde/usr/lib64/cmake/KF5Solid

  //The directory containing a CMake configuration file for
KF5Wayland.
  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

Now it shows the correct (local) path for solid (but not the other ones).
Is
there an environment variable or something I have to set to tell Cmake to
always look for local modules first?



Try CMAKE_PREFIX_PATH. See e.g. this old blog post on the matter:

https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it



Thanks for the hint. The variable was already set:

CMAKE_PREFIX_PATH=/home/gregor/kde/usr:

In the blog post, it is said, that CMAKE_PREFIX_PATH is searched _first_. I
find it strange that I had to uninstall the system-wide devel package in
order to have cmake pick up the library in /home/gregor/kde/usr. And for the
other libraries it still uses /usr. Any idea how to investigate this
further?


If you have previously run CMake without setting CMAKE_PREFIX_PATH you
will need to remove your build directory first, otherwise it will
reuse modules it has already found.


Hello Ben, I already removed the build dir (forgot to mention that). I assume that it should be 
sufficient to delete the build dir of the application that should be configured 
(/home/gregor/kde/src/build/kde/workspace/kinfocenter/) and not also those of the imported libraries 
(KF5Service, KF5Solid, KF5Wayland etc.). I wonder if there is maybe an additional (global) cmake 
cache or a special behaviour of kdesrc-build.


Gregor



Today, I opened the CMakeCache.txt again in Kate, deleted it and ran

$ cmake /home/gregor/kde/src/kde/workspace/kinfocenter/

with CMAKE_PREFIX_PATH set to "/home/gregor/kde/usr:"

With Kate I made a diff between the previous (which did not work) and current 
(now works) file:

https://ibb.co/bOznrJ (left: old/not working, right: new/compiles)

Noteworthy differences:
OLD (wrong paths)   NEW (correct paths)
CMAKE_INSTALL_PREFIX:PATH=/home/gregor/kde/usr  
CMAKE_INSTALL_PREFIX:PATH=/usr/local
CMAKE_PREFIX_PATH:UNINITIALIZED=/usrnothing
ECM_DIR:PATH=/usr/share/ECM/cmake   
ECM_DIR:PATH=/home/gregor/kde/usr/share/ECM/cmake

The interesting thing is that
1. Although the CMAKE_PREFIX_PATH was set as environment variable, it is not explicitly mentioned in 
the CMakeCache.txt but the ECM_DIR:PATH is now correct.
2. The CMAKE_INSTALL_PREFIX in the new version points to /usr/local which I assume is normally set 
by kdesrc-build to the correct location.


So the manual cmake works.

Then, I tried again with kdesrc-build and although CMAKE_PREFIX_PATH was still exported correctly 
(/home/gregor/kde/usr), in the CMakeCache.txt there is the lines


//No help, variable specified on the command line.
CMAKE_PREFIX_PATH:UNINITIALIZED=/usr

and

ECM_DIR:PATH=/usr/share/ECM/cmake

which I assume makes the KF5 framework modules to be found in the wrong 
(system) directory.

I would be interested how the CMakeCache.txt of a healthy kdesrc-build would 
look like.

Gregor


Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-09 Thread Michael Pyne
On Wed, May 09, 2018 at 01:12:10PM +0200, gregor.mi.sw wrote:
> Am 09.05.2018 08:19 schrieb Ben Cooksley:
> > On Wed, May 9, 2018 at 9:28 AM, gregor.mi.sw  
> > wrote:
> >> On 08.05.2018 23:15, Milian Wolff wrote:
> >>> On Dienstag, 8. Mai 2018 22:40:39 CEST gregor.mi.sw wrote:
>  
>  Hello,
>  
>  I have a question regarding kdesrc-build and CMake.
>  
>  I setup the build environment variables and ran kdesrc-build and got 
>  a
>  compiler error kinfocenter.
>  
>  Now it shows the correct (local) path for solid (but not the other 
>  ones).
>  Is
>  there an environment variable or something I have to set to tell 
>  Cmake to
>  always look for local modules first?

This is all sort of odd.

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).

If you're installing to /usr or /usr/local then maybe that is why CMake
is finding system libraries?  Roman Gilg actually recently submitted a
patch to fix this (https://phabricator.kde.org/D12739), if that's what
the problem is.

> >>> Try CMAKE_PREFIX_PATH. See e.g. this old blog post on the matter:
> >>> 
> >>> https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it
> >> 
> >> 
> >> Thanks for the hint. The variable was already set:
> >> 
> >> CMAKE_PREFIX_PATH=/home/gregor/kde/usr:
> >> 
> >> In the blog post, it is said, that CMAKE_PREFIX_PATH is searched 
> >> _first_. I
> >> find it strange that I had to uninstall the system-wide devel package 
> >> in
> >> order to have cmake pick up the library in /home/gregor/kde/usr. And 
> >> for the
> >> other libraries it still uses /usr. Any idea how to investigate this
> >> further?
> > 
> > If you have previously run CMake without setting CMAKE_PREFIX_PATH you
> > will need to remove your build directory first, otherwise it will
> > reuse modules it has already found.
> 
> Hello Ben, I already removed the build dir (forgot to mention that). I 
> assume that it should be sufficient to delete the build dir of the 
> application that should be configured 
> (/home/gregor/kde/src/build/kde/workspace/kinfocenter/) and not also 
> those of the imported libraries (KF5Service, KF5Solid, KF5Wayland etc.). 
> I wonder if there is maybe an additional (global) cmake cache or a 
> special behaviour of kdesrc-build.

There's no special behavior for kdesrc-build here (though there is a
cache, default .kdesrc-build-data in the same directory as your
kdesrc-buildrc).

However the CMake package to find when a CMake module config file is
loaded is based on the CMake paths when the module config file was
*installed*.  So all imported libraries would have be reinstalled to
fully fix the paths.

I've had these problems over the years and I've almost always found it
easier just to remove the CMake module config files entirely before
reinstalling to force it to be regenerated.

It may be easiest to remove the install directory completely and use
"kdesrc-build --refresh-build" to avoid interference from
previously-installed cruft.

Regards,
 - Michael Pyne


Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-09 Thread gregor.mi.sw



Am 09.05.2018 08:19 schrieb Ben Cooksley:
On Wed, May 9, 2018 at 9:28 AM, gregor.mi.sw  
wrote:



On 08.05.2018 23:15, Milian Wolff wrote:


On Dienstag, 8. Mai 2018 22:40:39 CEST gregor.mi.sw wrote:


Hello,

I have a question regarding kdesrc-build and CMake.

I setup the build environment variables and ran kdesrc-build and got 
a

compiler error kinfocenter.

I investigated
/home/gregor/kde/src/build/kde/workspace/kinfocenter/CMakeCache.txt 
and

found the following lines

  //The directory containing a CMake configuration file for
KF5Service.
  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

  //The directory containing a CMake configuration file for 
KF5Solid.

  KF5Solid_DIR:PATH=/usr/lib64/cmake/KF5Solid

  //The directory containing a CMake configuration file for
KF5Wayland.
  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

The directories of the needed KF5 frameworks point to the system 
wide

installed ones.

I removed the system-wide devel package for solid (because it caused 
the

compiler error) and ran kdesrc-build again:

  //The directory containing a CMake configuration file for
KF5Service.
  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

  //The directory containing a CMake configuration file for 
KF5Solid.

  KF5Solid_DIR:PATH=/home/gregor/kde/usr/lib64/cmake/KF5Solid

  //The directory containing a CMake configuration file for
KF5Wayland.
  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

Now it shows the correct (local) path for solid (but not the other 
ones).

Is
there an environment variable or something I have to set to tell 
Cmake to

always look for local modules first?



Try CMAKE_PREFIX_PATH. See e.g. this old blog post on the matter:

https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it



Thanks for the hint. The variable was already set:

CMAKE_PREFIX_PATH=/home/gregor/kde/usr:

In the blog post, it is said, that CMAKE_PREFIX_PATH is searched 
_first_. I
find it strange that I had to uninstall the system-wide devel package 
in
order to have cmake pick up the library in /home/gregor/kde/usr. And 
for the

other libraries it still uses /usr. Any idea how to investigate this
further?


If you have previously run CMake without setting CMAKE_PREFIX_PATH you
will need to remove your build directory first, otherwise it will
reuse modules it has already found.


Hello Ben, I already removed the build dir (forgot to mention that). I 
assume that it should be sufficient to delete the build dir of the 
application that should be configured 
(/home/gregor/kde/src/build/kde/workspace/kinfocenter/) and not also 
those of the imported libraries (KF5Service, KF5Solid, KF5Wayland etc.). 
I wonder if there is maybe an additional (global) cmake cache or a 
special behaviour of kdesrc-build.


Gregor



Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-08 Thread gregor.mi.sw



On 08.05.2018 23:15, Milian Wolff wrote:

On Dienstag, 8. Mai 2018 22:40:39 CEST gregor.mi.sw wrote:

Hello,

I have a question regarding kdesrc-build and CMake.

I setup the build environment variables and ran kdesrc-build and got a
compiler error kinfocenter.

I investigated
/home/gregor/kde/src/build/kde/workspace/kinfocenter/CMakeCache.txt and
found the following lines

  //The directory containing a CMake configuration file for KF5Service.
  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

  //The directory containing a CMake configuration file for KF5Solid.
  KF5Solid_DIR:PATH=/usr/lib64/cmake/KF5Solid

  //The directory containing a CMake configuration file for KF5Wayland.
  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

The directories of the needed KF5 frameworks point to the system wide
installed ones.

I removed the system-wide devel package for solid (because it caused the
compiler error) and ran kdesrc-build again:

  //The directory containing a CMake configuration file for KF5Service.
  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

  //The directory containing a CMake configuration file for KF5Solid.
  KF5Solid_DIR:PATH=/home/gregor/kde/usr/lib64/cmake/KF5Solid

  //The directory containing a CMake configuration file for KF5Wayland.
  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

Now it shows the correct (local) path for solid (but not the other ones). Is
there an environment variable or something I have to set to tell Cmake to
always look for local modules first?


Try CMAKE_PREFIX_PATH. See e.g. this old blog post on the matter:

https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it


Thanks for the hint. The variable was already set:

CMAKE_PREFIX_PATH=/home/gregor/kde/usr:

In the blog post, it is said, that CMAKE_PREFIX_PATH is searched _first_. I find it strange that I 
had to uninstall the system-wide devel package in order to have cmake pick up the library in 
/home/gregor/kde/usr. And for the other libraries it still uses /usr. Any idea how to investigate 
this further?


Gregor


Re: kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-08 Thread Milian Wolff
On Dienstag, 8. Mai 2018 22:40:39 CEST gregor.mi.sw wrote:
> Hello,
> 
> I have a question regarding kdesrc-build and CMake.
> 
> I setup the build environment variables and ran kdesrc-build and got a
> compiler error kinfocenter.
> 
> I investigated
> /home/gregor/kde/src/build/kde/workspace/kinfocenter/CMakeCache.txt and
> found the following lines
> 
>  //The directory containing a CMake configuration file for KF5Service.
>  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service
> 
>  //The directory containing a CMake configuration file for KF5Solid.
>  KF5Solid_DIR:PATH=/usr/lib64/cmake/KF5Solid
> 
>  //The directory containing a CMake configuration file for KF5Wayland.
>  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland
> 
> The directories of the needed KF5 frameworks point to the system wide
> installed ones.
> 
> I removed the system-wide devel package for solid (because it caused the
> compiler error) and ran kdesrc-build again:
> 
>  //The directory containing a CMake configuration file for KF5Service.
>  KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service
> 
>  //The directory containing a CMake configuration file for KF5Solid.
>  KF5Solid_DIR:PATH=/home/gregor/kde/usr/lib64/cmake/KF5Solid
> 
>  //The directory containing a CMake configuration file for KF5Wayland.
>  KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland
> 
> Now it shows the correct (local) path for solid (but not the other ones). Is
> there an environment variable or something I have to set to tell Cmake to
> always look for local modules first?

Try CMAKE_PREFIX_PATH. See e.g. this old blog post on the matter:

https://blogs.kde.org/2008/12/12/how-get-cmake-find-what-you-want-it

Cheers

-- 
Milian Wolff
m...@milianw.de
http://milianw.de

signature.asc
Description: This is a digitally signed message part.


kdesrc-build: cmake should take local (instead of system-wide) cmake modules

2018-05-08 Thread gregor.mi.sw

Hello,

I have a question regarding kdesrc-build and CMake.

I setup the build environment variables and ran kdesrc-build and got a compiler 
error kinfocenter.

I investigated /home/gregor/kde/src/build/kde/workspace/kinfocenter/CMakeCache.txt and found the 
following lines


//The directory containing a CMake configuration file for KF5Service.
KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

//The directory containing a CMake configuration file for KF5Solid.
KF5Solid_DIR:PATH=/usr/lib64/cmake/KF5Solid

//The directory containing a CMake configuration file for KF5Wayland.
KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

The directories of the needed KF5 frameworks point to the system wide installed 
ones.

I removed the system-wide devel package for solid (because it caused the compiler error) and ran 
kdesrc-build again:


//The directory containing a CMake configuration file for KF5Service.
KF5Service_DIR:PATH=/usr/lib64/cmake/KF5Service

//The directory containing a CMake configuration file for KF5Solid.
KF5Solid_DIR:PATH=/home/gregor/kde/usr/lib64/cmake/KF5Solid

//The directory containing a CMake configuration file for KF5Wayland.
KF5Wayland_DIR:PATH=/usr/lib64/cmake/KF5Wayland

Now it shows the correct (local) path for solid (but not the other ones). Is there an environment 
variable or something I have to set to tell Cmake to always look for local modules first?


Gregor