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><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_GTK_INCLUDE_DIR})</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} ${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><br>
</div><br><br><br><div class="gmail_quote">On Fri, Dec 19, 2008 at 10:23 AM, Philip Lowman <span dir="ltr">&lt;<a href="mailto:philip@yhbt.com">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><div></div><div class="Wj3C7c">On Thu, Dec 18, 2008 at 8:05 PM, Timothy M. Shead <span dir="ltr">&lt;<a href="mailto:tshead@k-3d.com" target="_blank">tshead@k-3d.com</a>&gt;</span> wrote:<br></div></div><div class="gmail_quote">
<div><div></div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Pierrick Grasland wrote:<br>
<br>
&gt; I&#39;m testing CMake with a little project, but I encounter a problem with GTK.<br>
<br>
</div><div>&gt; I was building with autotools and pkg_config before, so I know I have<br>
&gt; GTK+-2.0 on my system.<br>
<br>
</div>Since pkg-config is the &quot;officially supported&quot; way to obtain GTK<br>
dependencies and compiler flag (I believe it was designed by many of the<br>
same developers), I find that using CMake&#39;s pkg-config module works best<br>
(even on Win32). &nbsp;See the documentation at<br>
<br>
<a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#module:FindPkgConfig" target="_blank">http://www.cmake.org/cmake/help/cmake2.6docs.html#module:FindPkgConfig</a><br>
<br>
and try something along the lines of<br>
<br>
find_package(PkgConfig)<br>
pkg_check_modules(GTK gtk+-2.0)<br>
include_directories(${GTK_INCLUDE_DIRS})</blockquote></div></div><div><br>I&#39;m not having much luck on my system with pkg-config at the moment.<br><br>GTK_INCLUDE_DIRS = C:/Program<br>GTK_LIBRARY_DIRS = C:/Program<br>
<br>Looks to be a problem with the pkg-config.exe I have and not FindPkgConfig judging by the output of &quot;pkg-config --cflags gtk+-2.0&quot;<br>
<br>Also, I&#39;m not sure how to configure pkg-config to give me debug libraries.&nbsp; All I can figure is I would have to perform this step manually in CMake script?<br><br>Aside from the fact that pkg-config will tell me about library dependencies are there any advantages of using this tool within the context of CMake?&nbsp; I only ask because in my experience GTK has been fairly stable in it&#39;s dependencies along the way from 2.0.&nbsp; I know they added Cairo but exceptions like that can probably be handled within a properly written and tested FindGTK2.cmake<br>

</div></div><br>-- <br><font color="#888888">Philip Lowman<br>
</font><br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><br>-- <br>Pierrick Grasland<br><br>