# Cmake build errors



## rossiya (Aug 1, 2013)

I am trying to build KDE:


```
CMake Error at /usr/local/share/cmake/Modules/FindKDE4.cmake:98 (message):
  ERROR: cmake/modules/FindKDE4Internal.cmake not found in
Call Stack (most recent call first):
  CMakeLists.txt:12 (find_package)


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
*** [do-configure] Error code 1

Stop in /usr/ports/x11/libkonq.
```

This CMake issue now permeates many of the KDE4 ports I try to build.  Has anyone encountered this problem?  Google search turns up nothing!


----------



## SirDice (Aug 2, 2013)

What version of devel/cmake do you have installed? Have you tried updating that first?


----------



## xibo (Aug 2, 2013)

The warning originates from the fact that kde-baseapps is supposed to be monolithically built, yet ports builds it in fractions because it facilitates pkg-plist tracking considerably. And yes, it's safe to ignore the warning 

The file that cannot be found (FindKDE4Internal.cmake) is installed by x11/kdelibs4. As far as I can track it back, it was there for as long as there was a FreeBSD ports to it


----------



## rossiya (Aug 3, 2013)

SirDice said:
			
		

> What version of devel/cmake do you have installed? Have you tried updating that first?



I built and rebuilt the latest cmake but it made no difference. This error appears on many KDE4 builds and at this point KDE is unbuildable



			
				xibo said:
			
		

> The file that cannot be found (FindKDE4Internal.cmake) is installed by x11/kdelibs4. As far as I can track it back, it was there for as long as there was a FreeBSD ports to it



I have kdelibs4, specifically /var/db/pkg/kdelibs-4.10.5/, but that cmake file doesn't seem to be found when building.


----------



## cpm@ (Aug 3, 2013)

Reinstall x11/kdelibs4 and try again.


----------



## rossiya (Aug 4, 2013)

cpu82 said:
			
		

> Reinstall x11/kdelibs4 and try again.



Did that


```
yes '' | nice -n -20  portmaster   -GDB --no-confirm  -x ssh2-nox11 -x bsdpan -x host  -x qmail  -x paq  -x licq   x11/kdelibs4 
yes '' | nice -n -20 portmaster -GDB -r kdelibs-4\*
```

 then still get this error with 


```
CMake Error at /usr/local/share/cmake/Modules/FindKDE4.cmake:98 (message):
  ERROR: cmake/modules/FindKDE4Internal.cmake not found in
Call Stack (most recent call first):
  CMakeLists.txt:12 (find_package)

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
*** [do-configure] Error code 1

Stop in /usr/ports/x11/libkonq.

===>>> make failed for x11/libkonq
===>>> Aborting update

===>>> Update for x11/libkonq failed
===>>> Aborting update

===>>> Update for ark-4.10.1 failed
===>>> Aborting update

===>>> Killing background jobs
```


----------



## wblock@ (Aug 4, 2013)

There's no dash in the name, and please try just: `portmaster -r x11/kdelibs4`.


----------



## rossiya (Aug 8, 2013)

wblock@ said:
			
		

> There's no dash in the name, and please try just: `portmaster -r x11/kdelibs4`.



That command doesn't work directly:

```
# portmaster -r x11/kdelibs4
===>>> The argument to -r must be a package name, or a glob pattern
===>>> Aborting update
===>>> Killing background jobs
Terminated
===>>> Exiting
```

I'm sure you mean some obvious variant.  I'm beginning to smell the stink of decay in my box since she was built way back in 2002.  A quick `ls /usr/lib/` shows some junk from 2010.  I suspect attempting full builds from a clean virtual machine will be informative.


----------



## xibo (Aug 9, 2013)

_A_ssuming /usr/src hosts your FreeBSD source tree, you can use `# make -C /usr/src delete-old delete-old-libs` to remove outdated files installed by some former FreeBSD version. You can also use the terminal_'_s autocompletion for port names if you are in the ports root directory, or cd into the port directory and use `# portmaster .`.

Although kdelibs4 is still called x11/kdelibs4, as said by @wblock.


----------



## cpm@ (Aug 9, 2013)

rossiya said:
			
		

> That command doesn't work directly:
> 
> ```
> # portmaster -r x11/kdelibs4
> ...



Do the trick running `portmaster x11/kdelibs4`. Note that performs the update only if there is a later version, otherwise reinstall the port. Read the portmaster(8)() manpage for support.


----------

