[CMake] Library dependencies

Nathan Paul nathanjpaul at gmail.com
Thu Jun 25 22:54:11 EDT 2009


Hi all,
I have a project setup with the following directory structure:
/
    CMakeLists.txt
    Messages/
        CMakeLists.txt
    MessageTest/
        CMakeLists.txt
    Build/
        bin/
            Debug/
            Release/

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.
The subdirectory "MessageTest" outputs an executable called
"MessageTest.exe", which needs to link to the Messages library.
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.
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?
Thanks as always,

-- 
Nathan Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090625/4af28bf4/attachment-0001.htm>


More information about the CMake mailing list