<div>Dear CMakers,</div>  Sorry for disturbing. Since nobody gave the answer, I just rephrased the title of my question.<div><br></div><div><div>  I am a beginner of CMake. My problem is that in MSVC, I have two projects: one is executable project A, and the other is library project B. A depends on B and A has to link B. I want A to link the corresponding B separately under different configurations. For example, if I build Release version, then A should link Release version of B, while if I build MinSizeRel version, A should  link B in MinSizeRel/. </div>
<div><br></div><div>  For this purpose, I tried 2 ways but both failed. The first one is to set dependency in CMake, however, CMake automatically set the property &quot;Link Library Dependencies&quot; in the generated MSVC project to &quot;No&quot;, which means it won&#39;t link B automatically. Hence it seems I have to explicitly specify B as a input library to A. So then I did this:</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>target_link_libraries(A debug Debug/B)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>target_link_libraries(A optimized Release/B)</div>
<div><br></div><div> Nevertheless, obviously, since optimized means all the other three configurations except &quot;Debug&quot;,  project A won&#39;t find library B if I directly build &quot;MinSizeRel&quot; version because the compiler can not find library B in directory Release/.</div>
<div><br></div><div> So I am wondering, what is the standard way to do this? It will be great if there is portable and unified way which is also working on Linux and Mac.</div><div><br></div><div>  Thanks in advance!</div>
<div><br></div><div>Best,</div><div>Meng</div></div>