Hello all,<br><br>I'm testing CMake with a little project, but I encounter a problem with GTK.<br><br>I have the following architecture with CMake 2.6-patch2 on ubuntu 8.04 :<br><br>src/<br> gui/<br> tools/<br>target/<br>
<br>My goal is to generate my project in target. <br><br>So I created a CMakeLists.txt in src :<br><br style="font-family: courier new,monospace;"><div style="margin-left: 40px;"><span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">cmake_minimum_required(VERSION 2.6)</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">project( MyProject )</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">include_directories( ${MyProject_SOURCE_DIR}/gui )</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">link_directories( ${MyProject_SOURCE_DIR}/gui )</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
<br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">include_directories( ${MyProject_SOURCE_DIR}/tools )</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
link_directories( ${MyProject_SOURCE_DIR}/tools )</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">add_subdirectory(gui) </span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">add_subdirectory(tools) </span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);" clear="all">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">set( MyProject_SRC main.c conf.c )</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">add_executable( myproject ${MyProject_SRC})</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
<br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">set( MyProject_LIB tools gui )</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 255);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 255);">target_link_libraries(myproject ${MyProject_LIB} ) </span><br></div><br>and, in src/gui/ the following CMakeLists.txt :<br><br><div style="margin-left: 40px; font-family: courier new,monospace; color: rgb(51, 51, 255);">
find_package (GTK REQUIRED)<br> <br>include_directories (${GTK_INCLUDE_DIR})<br><br>set( GUI_SRC gtkCallback.c interface.c widgetUI.c)<br>add_library (gui ${GUI_SRC} ${GTK_LIBRARIES}) <br></div><br>But, when I run configure in cmake-gui, I have the following result :<br>
<br><div style="margin-left: 40px;"><span style="color: rgb(204, 0, 0);">GTK_..._NOTFOUND for all corresponding libraries in GTK.</span><br></div><br>and when I trying to make my project in target, I can't because gcc doesn't know where is GTK<br>
<br>I was building with autotools and pkg_config before, so I know I have GTK+-2.0 on my system.<br><br>I realized the migration between autotools and Cmake without a specialized tools, in order to learn how to use CMake. I'm now stuck with this problem, without a single clue (on CMake wiki or google) to correct it. I hope for some help here.<br>
<br>Regards,<br><br><br>-- <br>Pierrick Grasland<br><br>