Thanks a lot.<br><br>But, like I said before, I found a workaround, and now, Philip&#39;s FindGtk2 work perfectly.<br><br><br><div class="gmail_quote">On Mon, Jan 12, 2009 at 3:56 AM, Kermit Mei <span dir="ltr">&lt;<a href="mailto:kermit.mei@gmail.com">kermit.mei@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;">Hi, how about this CMakeLists.txt? &nbsp;I use it to test my GTK+ programs,<br>
and it always work well;p<div class="Ih2E3d"><br>
<br>
<br>
cmake_minimum_required(VERSION 2.6)<br></div>
INCLUDE(UsePkgConfig)<br>
FIND_PACKAGE(GTK)<br>
IF (GTK_FOUND)<br>
 &nbsp; &nbsp;INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIR})<br>
 &nbsp; &nbsp; ADD_DEFINITIONS(-DHAVE_GTK)<br>
 &nbsp; &nbsp;MESSAGE(&quot;GTK 1.x found and used as GUI\n&quot;)<br>
ELSE (GTK_FOUND)<br>
 &nbsp; &nbsp;PKGCONFIG(gtk+-2.0 GTK2_INCLUDE_DIR GTK2_LINK_DIR GTK2_LINK_FLAGS GTK2_CFLAGS)<br>
 &nbsp; &nbsp;PKGCONFIG(gthread-2.0 GTHREAD_INCLUDE_DIR GTHREAD_LINK_DIR GTHREAD_LINK_FLAGS+- GTHREAD_CFLAGS)<br>
 &nbsp; &nbsp; IF (GTK2_INCLUDE_DIR)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; SET(CMAKE_C_FLAGS &quot;${GTK2_CFLAGS} ${GTHREAD_CFLAGS}&quot;)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; STRING(REGEX REPLACE &quot;-l&quot; &quot;&quot; GTK_LIBRARIES &quot;${GTK2_LINK_FLAGS} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;${GTHREAD_LINK_FLAGS}&quot;)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; SEPARATE_ARGUMENTS(GTK_LIBRARIES)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; ADD_DEFINITIONS(-DHAVE_GTK2)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; MESSAGE(&quot;GTK 2.x found and used as GUI\n&quot;)<br>
 &nbsp; &nbsp; ELSE (GTK2_INCLUDE_DIR)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; MESSAGE(FATAL_ERROR &quot;GTK or GTK2 is required to build this project.&quot;)<br>
 &nbsp; &nbsp; ENDIF (GTK2_INCLUDE_DIR)<br>
ENDIF (GTK_FOUND)<br>
<br>
ADD_EXECUTABLE(main main.c)<br>
TARGET_LINK_LIBRARIES(main ${GTK2_LINK_FLAGS})<br>
<br>
## Have fun!<div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Pierrick Grasland<br><br>