32

I have been building freerpd client for Eclipse in Ubuntu 14.04 but an error is popping up :

Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)

when I use CMake 2.8. How can I get rid of it?

Kevin Bowen
  • 19,395
  • 55
  • 76
  • 81
Ananthu r nath
  • 431
  • 1
  • 4
  • 5
  • You are either missing the `cmake-data` package, have managed to delete some files it contains, or Eclipse is using a different cmake than comes in Ubuntu, or is messing with the default modules path environment of cmake. – dobey Jan 05 '16 at 17:27
  • eclipse is out of question as it is not involved in building, cmake-data is already there ,is there any possiblity that i can correct it with path environment ? – Ananthu r nath Jan 05 '16 at 18:20
  • 2
    Does `sudo apt-get install --reinstall pkg-config cmake-data` help, in case any of their files were corrupted? – David Foerster Jan 05 '16 at 22:50

3 Answers3

51

Try:

sudo apt-get install pkg-config
Dimitri Podborski
  • 2,505
  • 16
  • 22
7

I ran into this nuts problem while compiling opencv. The problem is that CMake is not finding the pkg-config executable.

Fix like this:

1)In ubuntu terminal,

which pkg-config

You will get "usr/bin/pkg-config" if it's installed

2) Add

set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")

to your Cmake file, or in your build directory, run "cmake-gui" to add it using the GUI. Now, Cmake will find the pkg-config.

Isuru Walpola
  • 71
  • 1
  • 3
2

https://github.com/vitalif/grive2/issues/74

SOLUTION that worked for me:

sudo apt-get install --reinstall pkg-config cmake-data
Gryu
  • 7,279
  • 9
  • 31
  • 52