Thanks a lot John for the example. Let see how can use it for my problem.<br><br><div class="gmail_quote">On Thu, Apr 30, 2009 at 5:17 PM, John Drescher <span dir="ltr">&lt;<a href="mailto:drescherjm@gmail.com">drescherjm@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;"><div><div></div><div class="h5">On Thu, Apr 30, 2009 at 12:46 AM, Usman Ajmal &lt;<a href="mailto:uzmanajmal@gmail.com">uzmanajmal@gmail.com</a>&gt; wrote:<br>

&gt; Hi,<br>
&gt;<br>
&gt; I am not clear with this CMakeLists.txt as to how to create it automatically<br>
&gt; because i don&#39;t know the conventions related to it.<br>
&gt;<br>
&gt; I have a project named <a href="http://test.pro" target="_blank">test.pro</a> having following files<br>
&gt;<br>
&gt; treemap.cpp<br>
&gt; treemap.h<br>
&gt; main.cpp<br>
&gt;<br>
&gt; Libraries i am using are qt4, qt3support. The treemap.cpp comes from KDE<br>
&gt; sources so i will need to use some KDE libraries. Qmake is not working<br>
&gt; because it could not find kconfig.h, klocale.h and kdebug.h so i turned to<br>
&gt; cmake and now i don&#39;t now what CMakeLists.txt should be for my project.<br>
&gt;<br>
&gt; Any help will be a great relief for me.<br>
&gt;<br>
</div></div>How about an example. Last week I took the qt example simpletreemodel<br>
and made a CMakeLists.txt file for it:<br>
<br>
project(simpletreemodel)<br>
<br>
cmake_minimum_required(VERSION 2.6)<br>
<br>
FIND_PACKAGE( Qt4 REQUIRED )<br>
INCLUDE( ${QT_USE_FILE} )<br>
<br>
include_directories(Include)<br>
<br>
SET (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL<br>
&quot;Single output directory for building all libraries.&quot;)<br>
SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL<br>
&quot;Single output directory for building all executables.&quot;)<br>
<br>
SET( DEMO_SRCS<br>
        ./src/main.cpp<br>
        ./src/treemodel.cpp<br>
        ./src/treeitem.cpp<br>
)<br>
<br>
SET( DEMO_HDRS<br>
<br>
)<br>
<br>
SET( DEMO_MOC_HDRS<br>
        ./Include/treemodel.h<br>
        ./Include/treeitem.h<br>
)<br>
<br>
# some .ui files<br>
SET( DEMO_UIS<br>
)<br>
<br>
# and finally an resource file<br>
SET( DEMO_RCS<br>
        ./rc/simpletreemodel.qrc<br>
)<br>
<br>
# this command will generate rules that will run rcc on all files from DEMO_RCS<br>
# in result DEMO_RC_SRCS variable will contain paths to files produced by rcc<br>
QT4_ADD_RESOURCES( DEMO_RC_SRCS ${DEMO_RCS} )<br>
<br>
# and finally this will run moc:<br>
QT4_WRAP_CPP( DEMO_MOC_SRCS ${DEMO_MOC_HDRS} )<br>
<br>
# this will run uic on .ui files:<br>
QT4_WRAP_UI( DEMO_UI_HDRS ${DEMO_UIS} )<br>
<br>
add_executable(simpletreemodel ${DEMO_SRCS}<br>
    ${DEMO_MOC_SRCS}<br>
        ${DEMO_HDRS}<br>
        ${DEMO_MOC_HDRS}<br>
        ${DEMO_UI_HDRS}<br>
        ${DEMO_RC_SRCS}<br>
)<br>
<br>
target_link_libraries(simpletreemodel<br>
        ${QT_LIBRARIES}<br>
)<br>
</blockquote></div><br>