Hi.<br><br>I though I resolved my problem, but not.<br><br>Actually,&nbsp; my project can link gtk2 with my C source file, with the following include :<br><br>#include &lt;gtk-2.0/gtk/gtk.h&gt;<br><br>But, within gtk.h, gtk includes are linked with the following :<br>
<br>#include &lt;gtk/gdk.h&gt; (for example)<br><br>So, I can&#39;t build since I don&#39;t have access to my widgets.<br><br>Like before, my CMakeLists.txt is something like that :<br><br style="color: rgb(51, 51, 255);">
<div style="margin-left: 40px;"><span style="color: rgb(51, 51, 255);">SET(CMAKE_MODULE_PATH &quot;/home/bobby/workspace/SipSec/gui&quot;)</span><br style="color: rgb(51, 51, 255);"><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">FIND_PACKAGE(GTK2 COMPONENTS gtk)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">include_directories (${GTK2_INCLUDE_DIRS})</span><br style="color: rgb(51, 51, 255);"><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">set( GUI_SRC gtkCallback.c interface.c widgetUI.c)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">add_library (sipsecgui&nbsp; ${GUI_SRC} ) </span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">target_link_libraries(sipsecgui ${GTK2_LIBRARIES} ) </span><br>
</div><br>How can I tell CMake to link Gtk2 as &lt;gtk/*&gt; instead of &lt;gtk-2.0/gtk/*&gt; ?<br><br>Any ideas someone ?<br><br><br><div class="gmail_quote">On Fri, Dec 19, 2008 at 11:14 AM, Pierrick Grasland <span dir="ltr">&lt;<a href="mailto:pierrick.grasland@gmail.com">pierrick.grasland@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Found it !<br><br><span style="color: rgb(51, 51, 255);">${GTK2_INCLUDE_DIR} != </span><span style="color: rgb(51, 51, 255);">${GTK2_INCLUDE_DIR<b><span style="color: rgb(204, 0, 0);">S</span></b>}</span><br>
<br>Sorry for bothering you.<div><div></div><div class="Wj3C7c"><br>
<br><br><div class="gmail_quote">On Fri, Dec 19, 2008 at 11:12 AM, Pierrick Grasland <span dir="ltr">&lt;<a href="mailto:pierrick.grasland@gmail.com" target="_blank">pierrick.grasland@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Ok.<br><br>I modify my CMakeLists.txt :<div><br><br><span style="color: rgb(51, 51, 255);">SET(CMAKE_MODULE_PATH &quot;/home/bobby/workspace/SipSec/gui&quot;)</span><br style="color: rgb(51, 51, 255);"><br style="color: rgb(51, 51, 255);">


<span style="color: rgb(51, 51, 255);">FIND_PACKAGE(GTK2 COMPONENTS gtk)</span><br style="color: rgb(51, 51, 255);"></div><span style="color: rgb(51, 51, 255);">include_directories (${GTK2_INCLUDE_DIR})</span><div>
<br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">set( GUI_SRC gtkCallback.c interface.c widgetUI.c)</span><br style="color: rgb(51, 51, 255);"></div><span style="color: rgb(51, 51, 255);">add_library (sipsecgui&nbsp; ${GUI_SRC}) </span><br style="color: rgb(51, 51, 255);">


<span style="color: rgb(51, 51, 255);">target_link_libraries(sipsecgui ${GTK2_LIBRARIES} ) </span><br><br>But gcc respond with : <br><br>/home/bobby/workspace/SipSec/gui/gtkCallback.h:12:21: erreur: gtk/gtk.h : Aucun fichier ou dossier de ce type (ie File not exist)<div>

<div></div><div><br>
<br><div class="gmail_quote">On Fri, Dec 19, 2008 at 10:45 AM, Philip Lowman <span dir="ltr">&lt;<a href="mailto:philip@yhbt.com" target="_blank">philip@yhbt.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div>On Fri, Dec 19, 2008 at 4:40 AM, Pierrick Grasland <span dir="ltr">&lt;<a href="mailto:pierrick.grasland@gmail.com" target="_blank">pierrick.grasland@gmail.com</a>&gt;</span> wrote:<br></div><div class="gmail_quote">


<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I just tried FindGTK2.cmake<br><br>It correctly locate GTK2 library, but when I trying to build my project, GCC output a lot of error in GTK lib ...<br><br>It seems to be unable to find definition of GTK.<br><br>




I copy / paste here my CMakeLists.txt (I think I forgot something) :<br style="color: rgb(51, 51, 255);"><div style="margin-left: 40px;"><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">SET(CMAKE_MODULE_PATH &quot;/home/bobby/workspace/SipSec/gui&quot;)</span><div>



<br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">FIND_PACKAGE(GTK2 COMPONENTS gtk)</span><br style="color: rgb(51, 51, 255);"></div><span style="color: rgb(51, 51, 255);">include_directories (${GTK2_GTK_INCLUDE_DIR})</span><div>



<br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">set( GUI_SRC gtkCallback.c interface.c widgetUI.c)</span><br style="color: rgb(51, 51, 255);"></div><span style="color: rgb(51, 51, 255);">add_library (sipsecgui&nbsp; ${GUI_SRC} ${GTK2_GTK_LIBRARIES}) </span><br style="color: rgb(51, 51, 255);">




<span style="color: rgb(51, 51, 255);">target_link_libraries(sipsecgui ${GTK2_GTK_LIBRARIES} ) </span><br></div><br><br>and some errors from GCC output :<br><br style="color: rgb(204, 0, 0);"><div style="margin-left: 40px;">




<span style="color: rgb(204, 0, 0);">/usr/include/gtk-2.0/gtk/gtktextbufferrichtext.h:90: erreur: expected declaration specifiers before «G_END_DECLS»</span><br style="color: rgb(204, 0, 0);"><span style="color: rgb(204, 0, 0);">In file included from /usr/include/gtk-2.0/gtk/gtk.h:176,</span><br style="color: rgb(204, 0, 0);">




<span style="color: rgb(204, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from /home/bobby/workspace/SipSec/gui/gtkCallback.h:12,</span><br style="color: rgb(204, 0, 0);"><span style="color: rgb(204, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from /home/bobby/workspace/SipSec/gui/gtkCallback.c:7:</span><br style="color: rgb(204, 0, 0);">




<span style="color: rgb(204, 0, 0);">/usr/include/gtk-2.0/gtk/gtktextview.h:53: erreur: expected declaration specifiers before «GtkTextWindowType»</span><br style="color: rgb(204, 0, 0);"><span style="color: rgb(204, 0, 0);">/usr/include/gtk-2.0/gtk/gtktextview.h:57: erreur: storage class specified for parameter «GtkTextView»</span></div>



</blockquote></div><div><br><br>Due to GTK&#39;s dependencies (header files in a dozen different directories and many libraries) when using this module you should use:<br><br>INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})<br>


and<br>
TARGET_LINK_LIBRARIES(foo ${GTK2_LIBRARIES})<br><br>The module appends all the stuff in two large lists exposed as GTK2_INCLUDE_DIRS and GTK2_LIBRARIES.<br><br></div></div>-- <br><font color="#888888">Philip Lowman<br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br><font color="#888888">Pierrick Grasland<br><br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br><font color="#888888">Pierrick Grasland<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Pierrick Grasland<br><br>