[CMake] Linking static targets from sibling directories

Scott MacVicar macvicar at facebook.com
Thu Feb 18 11:46:47 EST 2010


The linking doesn't include the .a files from the other directories, the final lib is missing those symbols.

I checked with nm here, the error doesn't occur until until I attempt to use the built static library.

Scott



On 18 Feb 2010, at 07:36, "David Cole" <david.cole at kitware.com<mailto:david.cole at kitware.com>> wrote:

What do you mean by "refuses to link the static libraries which are targets from the subfolders"

I looked at your CMakeLists.txt files, which, at first glance, look correct... What error do you get?

If you say "make VERBOSE=1" does it give you more data about what might be going wrong?



On Thu, Feb 18, 2010 at 3:48 AM, Scott MacVicar <<mailto:macvicar at facebook.com>macvicar at facebook.com<mailto:macvicar at facebook.com>> wrote:
Hi,

I've been converting a current autoconf project to use CMake, the layout is such that there is a root directory and 3 sub directories containing various parts of the project.

filters and nls build two static libs and mbfl builds a third static lib that links to the previous two.

root
--filters
--mbfl
--nls

mbfl contains
target_link_libraries(mbfl mbfl_filters)
target_link_libraries(mbfl mbfl_nls)

but refuses to link the static libraries which are targets from the subfolders.

Entire repository is available at <http://github.com/scottmac/libmbfl> http://github.com/scottmac/libmbfl

I could convert it to be built at one single lib in one go but would rather keep parity with the autoconf equivalents.

Any help or pointers would be appreciated.

Scott

_______________________________________________
Powered by <http://www.kitware.com> www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at <http://www.kitware.com/opensource/opensource.html> http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: <http://www.cmake.org/Wiki/CMake_FAQ> http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
<http://www.cmake.org/mailman/listinfo/cmake>http://www.cmake.org/mailman/listinfo/cmake

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100218/a11ff8df/attachment.htm>


More information about the CMake mailing list