Hello,<div><br></div><div>How do you call invoke CMakeLists1.txt and CMakeLists2.txt?</div><div><br></div><div>If you want to keep separate CMakeLists.txt, I would do something like this:</div><div><br></div><div><div class="im" style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>main/</div><div>CMakeLists.txt</div><div><div>-- resources/</div><div>-- -- pixmaps/</div></div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">-- CMakeLists1.txt</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">-- icons.qrc</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
exe/</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">-- CMakeLists2.txt</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
-- main.cpp</div></div><div><br></div><div>Where CMakeLists.txt is something like this:</div><div><br></div><div>project(blah)</div><div><br></div><div>find_package(Qt4 REQUIRED)</div><div>include(${QT4_USE_FILE})</div><div>
<br></div><div>add_subdirectory(resources)</div><div>add_subdirectory(exe)</div><div><br>Then CMakeLists1.txt is something like this:</div><div><br></div><div>qt4_add_resources(lib_resources ${blah_SOURCE_DIR}/resources/icons.qrc)</div>
<div><br></div><div>(strictly speaking, the you don't need ${blah_SOURCE_DIR}/resources, but I like to have full paths for things that may move around)</div><div><br></div><div>And CMakeLists2.txt would be something like this:</div>
<div><br></div><div>add_library(mylib ${lib_resources} ${other_sources})</div><div>target_link_libraries(mylib ${QT4_LIBRARIES})</div><div><br></div><div>But now you probably have a scoping problem with the variable lib_resources, you may need to promote it to the parent scope.</div>
<div><br></div><div>Do you really require separate CMakeLists.txt? I only do that for complex projects. If your project is not that involved, I think it's easier if you add everything in one CMakeLists.txt in the root folder and you are done.</div>
<div><br></div><div><br><div class="gmail_quote">On Mon, Jul 8, 2013 at 6:59 PM, Júlio Hoffimann <span dir="ltr"><<a href="mailto:julio.hoffimann@gmail.com" target="_blank">julio.hoffimann@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>My CMakeLists.txt resides at the same directory as icons.qrc, but my main application is linked in a completely separate folder:<br>
</div><div class="im"><div><br></div><div>main/</div><div><div>-- resources/</div><div>
-- -- pixmaps/</div></div></div><div>-- CMakeLists1.txt</div><div>-- icons.qrc</div><div>exe/</div><div>-- CMakeLists2.txt</div><div>-- main.cpp</div><div><br></div><div>Is it okay? What should be the CMakeLists(1|2).txt in this case?</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Júlio.</div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Pau Garcia i Quiles<br><a href="http://www.elpauer.org">http://www.elpauer.org</a><br>(Due to my workload, I may need 10 days to answer)
</div>