On Fri, Dec 19, 2008 at 5:38 AM, Pierrick Grasland <span dir="ltr"><<a href="mailto:pierrick.grasland@gmail.com">pierrick.grasland@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><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 though I resolved my problem, but not.<br><br>Actually, my project can link gtk2 with my C source file, with the following include :<div class="Ih2E3d"><br><br>#include <gtk-2.0/gtk/gtk.h><br><br></div>
But, within gtk.h, gtk includes are linked with the following :<br>
<br>#include <gtk/gdk.h> (for example)<br><br>So, I can't build since I don'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;"><div class="Ih2E3d"><span style="color: rgb(51, 51, 255);">SET(CMAKE_MODULE_PATH "/home/bobby/workspace/SipSec/gui")</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_DIRS})</span><div class="Ih2E3d"><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 ${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></div><br>How can I tell CMake to link Gtk2 as <gtk/*> instead of <gtk-2.0/gtk/*> ? <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>Any ideas someone ?</blockquote><div><br>I could probably help you add a hack to FindGTK2 to get what you want but I'm pretty sure nearly everyone else out there uses the #include <gtk/*> syntax.<br><br>
The best thing for you to do would be to fix your #includes and in whatever build system you're currently using just ensure "/usr/include/gtk-2.0" is in the include path (I suspect it's already there otherwise you would have had the same compilation issues you have now with your widgets).<br>
<br>If you have a lot of source files you could use the "sed" tool along with a regular expression to accomplish your fix (make backups first obviously).<br><br></div></div>-- <br>Philip Lowman<br>