Hi,<br><br><div class="gmail_quote">On Mon, Oct 22, 2012 at 5:35 PM, 张峰 <span dir="ltr"><<a href="mailto:fangler2012@126.com" target="_blank">fangler2012@126.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial"><div><br></div><div>1.if i put "TARGET_LINK_LIBRARIES(fan test)" before ADD_EXECUTABLE command,this does not work ,why??</div>
<div></div></div></div></blockquote><div><br></div><div>Because until yout call add_executable(), the target name doesn't exist. You have to use the target name as first parameter of target_link_libraries().</div><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial">
<div> </div><div>2. but if i ADD_LIBRARY(test STATIC ${LIBTEST_SRC} ${LIBHELLO_SRC}) ,it is ok,why ??</div><div></div></div></div></blockquote><div><br></div><div><br></div><div>I don't understand the question.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial">
<div> </div><div>3.if i put "TARGET_LINK_LIBRARIES(fan test)" after ADD_EXECUTABLE command,it works ,why ??</div><div> </div></div></div></blockquote><div><br></div><div>For the reason I explained in 1.</div><div>
<br></div><div>Joel Lamotte</div><div> </div></div>