1

Having a heck of a time trying to build CodeLite for an ARM-based Ubuntu Linux target. (Build instructions here: http://codelite.org/Developers/Linux). I get an error from CMAKE that says Could not locate GTK2. Looking in the CmakeLists.txt file I can see that this is a result of find_package(GTK2) failing to find GTK2. I think I have installed gtk according to what the CodeLite build instructions say to do using the command sudo apt-get install libgtk2.0-dev.

In terms of cmake, I don't understand what a "package" is. How would I [manually] locate this package on my filesystem and how do I get cmake to find it?

Kyle Sweet
  • 306
  • 1
  • 3
  • 15
  • `How would I [manually] locate this package on my filesystem` - [Use dpkg-query](http://askubuntu.com/questions/32507/how-do-i-get-a-list-of-installed-files-from-a-package). Using this approach, find where `gtk/gtk.h` is located on your filesystem. – Tsyvarev Feb 15 '17 at 18:16
  • Good call. I found gtk.h. It is located in /usr/include/gtk-2.0/gtk/, /usr/include/gtk-3.0/gtk/, and /home/ubuntu/wxWidgets3.0/wxWidgets-3.0.2/build/wince/missing/gtk/. Does the fact that it shows up in the "missing" folder mean anything? – Kyle Sweet Feb 15 '17 at 19:31
  • Hm, but script [findGTK2.cmake](https://github.com/Kitware/CMake/blob/master/Modules/FindGTK2.cmake#L289) doesn't search under `/usr/include/gtk-2.0/`. Try to set [CMAKE_INCLUDE_PATH](https://cmake.org/cmake/help/v3.7/variable/CMAKE_INCLUDE_PATH.html#variable:CMAKE_INCLUDE_PATH) to given directory when call `cmake`: `cmake -DCMAKE_INCLUDE_PATH=/usr/include/gtk-2.0/ ...`. Probably, similar action will be needed for find libraries: set [CMAKE_LIBRARY_PATH](https://cmake.org/cmake/help/v3.7/variable/CMAKE_LIBRARY_PATH.html#variable:CMAKE_LIBRARY_PATH) variable to appropriate directory. – Tsyvarev Feb 15 '17 at 21:19
  • No dice. gtk.h wouldn't be considered the "package", would it? Might it be some object files or a dll that cmake is looking for? – Kyle Sweet Feb 15 '17 at 22:43
  • 1
    Actually, `gtk/gtk.h` is one of the GTK2 files CMake is looking for. You may enable debugging and check what exact files CMake has failed to find: `cmake -DGTK2_DEBUG=on ...`. Also, you may examine CMake cache (`CMakeCache.txt` in the build directory) and among GTK2 variables find ones which `-NOTFOUND`. – Tsyvarev Feb 16 '17 at 07:00

1 Answers1

1

For my aarch64 ubuntu 17.04, the libraries and headers were under /usr/lib/aarch64-linux-gnu, so invoking cmake with them produced the correct build files:

cmake -DCMAKE_INCLUDE_PATH=/usr/lib/aarch64-linux-gnu/ -DCMAKE_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/ -DCMAKE_BUILD_TYPE=Release .. -DCOPY_WX_LIBS=1
silverj
  • 11
  • 1