MantisBT - CMake
View Issue Details
0012049CMakeModulespublic2011-04-06 03:462013-03-04 08:38
Boris Pek 
Philip Lowman 
normalminoralways
closedfixed 
CMake-2-8 
CMake 2.8.10CMake 2.8.10 
0012049: Problem with cmake module FindGTK2.cmake in Ubuntu >= 11.04 (Natty Narwhal)
Hi,

Some Ubuntu maintainers have a dissenting opinion where the header files should be placed in the system...

So you need to take into account some features of Ubuntu Natty:
they moved file /usr/lib/glib-2.0/include/glibconfig.h
to directories:
/usr/lib/i386-linux-gnu/glib-2.0/include/
/usr/lib/x86_64-linux-gnu/glib-2.0/include/

Temporary I solved this problem in our project with following patch:
--- a/cmake/FindGTK2.cmake
+++ b/cmake/FindGTK2.cmake
@@ -185,6 +185,10 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)

     find_path(${_var} ${_hdr}
         PATHS
+ # fix for Ubuntu >= 11.04 (Natty Narwhal)
+ /usr/lib/i386-linux-gnu/
+ /usr/lib/x86_64-linux-gnu/
+ # end fix for Ubuntu >= 11.04 (Natty Narwhal)
             /usr/local/lib64
             /usr/local/lib
             /usr/lib64

The Ubuntu maintainer proposed to use pkg-config.
I don't agree with him, but this problem must be fixed in cmake project in any way.
Or maybe you will be able to convince ubuntu developers undo this change.

For more details please read:
https://bugs.launchpad.net/ubuntu/+source/cmake/+bug/751940 [^]

Thank you for convenient and useful project.

Regards,
Boris
No tags attached.
related to 0012037closed Brad King support multiarch lib paths for Debian/Ubuntu 
Issue History
2011-04-06 03:46Boris PekNew Issue
2011-04-06 04:43Michael WildNote Added: 0026113
2011-04-06 07:42Eric NOULARDRelationship addedrelated to 0012037
2011-04-06 07:44Eric NOULARDNote Added: 0026114
2011-04-06 07:59Michael WildNote Added: 0026115
2011-04-06 08:00Michael WildNote Edited: 0026115bug_revision_view_page.php?bugnote_id=26115#r298
2011-04-06 08:00Michael WildNote Edited: 0026115bug_revision_view_page.php?bugnote_id=26115#r299
2011-04-06 08:00Michael WildNote Edited: 0026115bug_revision_view_page.php?bugnote_id=26115#r300
2011-04-06 08:01Eric NOULARDNote Added: 0026117
2011-06-13 11:31Brad KingAssigned To => Philip Lowman
2011-06-13 11:31Brad KingStatusnew => assigned
2011-06-13 11:31Brad KingNote Added: 0026847
2011-06-13 11:32Brad KingNote Added: 0026848
2012-08-17 10:23Brad KingNote Added: 0030690
2012-10-03 00:56Philip LowmanNote Added: 0031158
2012-10-03 00:56Philip LowmanTarget Version => CMake 2.8.10
2012-10-18 16:02Philip LowmanNote Added: 0031279
2012-10-18 16:02Philip LowmanStatusassigned => resolved
2012-10-18 16:02Philip LowmanResolutionopen => fixed
2012-10-18 16:02Philip LowmanFixed in Version => CMake 2.8.10
2013-03-04 08:38Robert MaynardNote Added: 0032478
2013-03-04 08:38Robert MaynardStatusresolved => closed

Notes
(0026113)
Michael Wild   
2011-04-06 04:43   
This is not GTK specific, it is a consequence of multi-arch support that is being implemented in Debian and Ubuntu (https://wiki.ubuntu.com/MultiarchSpec [^]). CMake needs those paths to be added to the default search paths.

Now, this won't solve this particular issue, because the header is located in a library-directory, and hard-coding all possible triplets (on Debian there will be many more than just those two) also isn't a solution, because you'll need to take into account the target architecture you are compiling for. It is very well possible that /usrl/lib/i386-linux-gnu is present on a system where you are compiling for x86_64. After all, this is the very purpose of multi-arch.

Simply asking pkg-config for a hint is perfectly acceptable, but doesn't help in the case of cross-compiling. But that (AFAIK) isn't supported at the moment, so that should be fine.
(0026114)
Eric NOULARD   
2011-04-06 07:44   
Just adding the relationship with the MultiArch feature request 0012049
(0026115)
Michael Wild   
2011-04-06 07:59   
(edited on: 2011-04-06 08:00)
You mean 0012037...

(0026117)
Eric NOULARD   
2011-04-06 08:01   
Yes right off course,
thanks Michael.
(0026847)
Brad King   
2011-06-13 11:31   
Assigned to Philip Lowman, the current module maintainer for FindGTK2.cmake.
(0026848)
Brad King   
2011-06-13 11:32   
Re 0012049:0026113: The problem is somewhat specific to FindGTK2 because it uses find_path to look for a header in the *lib* directory.

According to a link posted in 0012037:0026834:

  https://bugs.launchpad.net/ubuntu/+source/cmake/+bug/751940/comments/1 [^]

the proper way to find the header path and other parts of GTK2 is to use pkgconfig.
(0030690)
Brad King   
2012-08-17 10:23   
Debian applies the following fix:

http://anonscm.debian.org/gitweb/?p=collab-maint/cmake.git;a=blob;f=debian/patches/multiarch_findgtk2_fix.diff;hb=82fce4fc [^]

--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -187,6 +187,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hd
         PATHS
             /usr/local/lib64
             /usr/local/lib
+            /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
             /usr/lib64
             /usr/lib
             /opt/gnome/include
(0031158)
Philip Lowman   
2012-10-03 00:56   
Definitely need to fix this for 2.8.10. Need to tweak Debian's patch slightly given recent changes to FindGTK2 also.
(0031279)
Philip Lowman   
2012-10-18 16:02   
Fixed the issue
(0032478)
Robert Maynard   
2013-03-04 08:38   
Closing resolved issues that have not been updated in more than 4 months.