Hi all, I'd like to create a shared library that uses another toolkit Foobar, so within the main CMakeLists.txt I write
TARGET_LINK_LIBRARIES("mylib" ${Foobar_LIBRARIES}) to avoid undefined symbols (I link with -Wl,-no-undefined). ${Foobar_LIBRARIES} consists of {foobarA;foobarB;foobarC}. This pulls in all Foobar libraries on the link like. Moreover, the respective src/CMakeFiles/mylib.dir/build.make contains ======================== *snip* ======================== [...] # External object files for target nosh nosh_EXTERNAL_OBJECTS = src/libmylib.so.11.0.0: src/CMakeFiles/mylib.dir/mysource1.cpp.o src/libmylib.so.11.0.0: src/CMakeFiles/mylib.dir/mysource2.cpp.o src/libmylib.so.11.0.0: src/CMakeFiles/mylib.dir/mysource3.cpp.o src/libmylib.so.11.0.0: src/CMakeFiles/mylib.dir/build.make src/libmylib.so.11.0.0: /usr/lib/libfoobarA.so.11 src/libmylib.so.11.0.0: /usr/lib/libfoobarB.so.11 src/libmylib.so.11.0.0: /usr/lib/libfoobarC.so.11 src/libmylib.so.11.0.0: /usr/lib/liblapack.so src/libmylib.so.11.0.0: /usr/lib/libblas.so src/libmylib.so.11.0.0: /usr/lib/libnetcdf.so src/libmylib.so.11.0.0: src/CMakeFiles/mylib.dir/link.txt [...] ======================== *snap* ======================== CMake correctly pulls in the libraries BLAS, LAPACK, and netCDF on which Foobar depends, without me having to specify those in mylib. Nice! I'm having one problem with this though: ldd reveals that libfoobar*.so contains dynamic links to the respective libraries with versioning info, i.e., $ ldd /usr/lib/libfoobarA.so.11 | grep netcdf libnetcdf.so.7 => /usr/lib/libnetcdf.so.7 (0x00007f1fe33da000) $ In fact, there is no library by the exact name /usr/lib/libnetcdf.so installed. The same goes for BLAS and LAPACK. I'm now wondering how CMake generates the information in src/CMakeFiles/mylib.dir/build.make, and how to fix this. Hints, anyone? --Nico -- Powered by www.kitware.com Visit other Kitware open-source projects at 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 Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake