Hi Bill:<br><br> Thanks, it's exactly what you mentioned, and I got some mistake on my CMakeList.txt.<br><br> Originally I have some syntax like:<br><br>SET(LIB_DIRS ${LIB_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../../../lib)<br>
SET(LIBS ${LIBS} "libMyLibA.a")<br>TARGET_LINK_LIBRARIES(${PROGNAME} ${LIBS})<br> <br> And I suddenly found out the usage was wrong and just too stupid .. although it works on my first make.<br>However it would't relink when ../../../lib/libMyLibA.a got updated. <br>
<br> After I changed to:<br><br>SET(LIB_DIRS ${LIB_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../../../lib)<br>
SET(LIBS ${LIBS} "MyLibA")<br>
TARGET_LINK_LIBRARIES(${PROGNAME} ${LIBS})<br><br>// or <br>SET(LIBS ${LIBS} "../../../lib/libMyLibA.a")<br>
TARGET_LINK_LIBRARIES(${PROGNAME} ${LIBS})<br><br> Both works when libMyLibA got updated.<br><br> Now it works fine. And thank you.<br><br><div class="gmail_quote">On Thu, Jun 11, 2009 at 9:44 PM, Bill Hoffman <span dir="ltr"><<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a>></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 class="im">Chih-pin Wu 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 all:<br>
<br>
I'm working on an embedded platform and building integrated software as multimedia CE devices. And I am just started trying to introduce CMake to replace my legacy environment constructed by many hand-written gnu styled makefiles.<br>
<br>
I have many components which is cross referred to each other very complicatedly, and it really helps a lot when I started to migrate to CMake with the benefit of automatic dependency checking.<br>
<br>
However, my order of building is<br>
i) build lots of libraries, called components<br>
ii) then build final executable, called application, linking with libraries<br>
<br>
I really felt comfort when I modified some header files in the component directory, and makefiles generated by CMake automatically found it, rebuild all dependent source files as well as the libraries.<br>
However I could not make my final executable link those libraries automatically when libraries got changed.<br>
<br>
I used TARGET_LINK_LIBRARIES to enumerate linking libraries, also ADD_DEPENDENCIES with these libraries.<br>
But I still can't make it relink to a executable when those libraries got changed, no matter it's rebuilt by makefile or replaced by some newer revision.<br>
<br>
</blockquote>
<br></div>
Can you post some of your cmake code? This should work. I suspect that you are not using full paths to libraries in target_link_libraries. add_dependencies should not be needed.<br><font color="#888888">
<br>
-Bill<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Wu Chih-pin(吳智斌)<br>