views:

111

answers:

2

I'm attempting to compile zzogl using CMake and I keep running into issues. My first issue stated that I needed pkgconfig, so I installed that, for which I also had to install MacPorts. Then it said I needed gtk+-2.0 module, so I got that too. After that took forever to install, I still get this error:

checking for module 'gtk+-2.0'
package 'gtk+-2.0' not found
CMake Error at /Applications/CMake 2.8-2.app/Contents/share/cmake-2.8/Modules/FindPkgConfig.cmake:266 (message):
A required package was not found
Call Stack (most recent call first):
/Applications/CMake 2.8-2.app/Contents/share/cmake-2.8/Modules/FindPkgConfig.cmake:320 (_pkg_check_modules_internal)
CMakeLists.txt:106 (pkg_check_modules)


CMake Error at cmake/funcs.cmake:32 (message):
gtk not found, aborting...
Call Stack (most recent call first):
cmake/funcs.cmake:23 (reportFound)
CMakeLists.txt:107 (checkFor)


Configuring incomplete, errors occurred!

I'm not really familiar with what I am doin, and it is completely possible I am doing it all wrong. Anyone have any incite into my problem? I am using a mac with snow leopard btw.

+1  A: 

Did you install gtk with a command similar to sudo port install gtk2? If yes, then normally gtk should be found by cmake. You can test if gtk is correctly found by pkg-config manually like this:

pkg-config --cflags gtk+-2.0

which should print something like

-pthread -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12

but with different paths, the above is on a Linux system.

If indeed the pkg-config call succeeds, something is wrong with your CMake config. You might then try to install the MacPorts version of cmake like this: sudo port install cmake and use this one.

fschmitt
Thanks for the response but after running pkg-config --cflags gtk+-2.0 I got basically what you had but replace -I/usr/lib/gtk with: -I/opt/local/include/gtk-2.0 etc. I then tried installing cmake again with the command line, then tried compiling again. I ended up with the same error as my previous try, verbatim.
MBguitarburst
Did you start CMake from the same terminal in which pkg-config worked? Then I'm really out of ideas...
fschmitt
Originally I was running a Cmake application with a gui. However this time around I ran it in command line using: cmake zzogl. I assume that was correct?
MBguitarburst
Yes. With cmake you normally work out of source. That means you go to the source directory, e.g. ~/src/zzogl. Then you say mkdir build; cd build; cmake ..
fschmitt
Ya I'm really not sure what the problem is, Cmake just doesn't seem to be able to locate gtk, I suppose maybe I installed gtk improperly, or perhaps the wrong gtk module? Oh well, thanks for trying.
MBguitarburst