<div>Hi all,<br clear="all"></div><div></div><div>I have a project setup with the following directory structure:</div><div></div><div>/</div><div> CMakeLists.txt</div><div> Messages/</div><div> CMakeLists.txt</div>
<div> MessageTest/</div><div> CMakeLists.txt</div><div> Build/</div><div> bin/</div><div> Debug/</div><div> Release/</div><div> </div><div>The subdirectory "Messages" outputs a shared library called "Messages" in release mode and "Messages_d" in debug mode. The Messages library links statically to the Google Protocol Buffer library.</div>
<div></div><div>The subdirectory "MessageTest" outputs an executable called "MessageTest.exe", which needs to link to the Messages library.</div><div></div><div>The subdirectory "Build" is where I tell CMake to build the project. The directory "bin" where I'd like the output (not object files) files to be placed.</div>
<div></div><div>When I tell MessageTest to link to Messages (using target_link_libraries and specifying the Messages library), the Google Protocol Buffer library is added as a dependency. This is undesired, since the library is already linked statically to the Messages library, and is not directly needed by the MessageTest executable. Also, the .lib file generated by the build does not get placed into Build/bin, which is what I would like. What is the best way to do this?</div>
<div></div><div>Thanks as always,</div><br>-- <br>Nathan Paul<br><br>