[CMake] How to include libraries from classic toolchain to be installed and/or packaged?

Jan Dolecek juzna.cz at gmail.com
Mon May 30 12:33:24 EDT 2011


Hi guys,

I like CMake and I'm trying to learn it, however I have problem with my
project which I'm not able to solve for couple of days. The problem is, that
my project depends on another library which I need to compile and which uses
classic toolchain (autoconf + configure). This library automatically
compiles other libraries which are also needed. I managed to build these
libraries manually and link them to my project just by adding relative path
to them to target_link_libraries. It's get compiled well.

However I also need "make install" to work, or especially "make package"
which internally uses install targets. This install however installs only my
app, not the libraries needed :(

I tried:
add_library(LIB_CORE SHARED IMPORTED)
set_property(TARGET LIB_CORE PROPERTY IMPORTED_LOCATION path_to_library.so)
target_link_libraries(MY_PROJECT LIB_CORE)
install(TARGETS ${LIB_CORE} LIBRARY DESTINATION lib)

which will compile everything well bus just ignore the library when "make
install" or  "make package"


I tried it another way:
install(PROGRAMS ${LIBS_PATH} DESTINATION lib)

which doesn't work either, because LIBS_PATH has path to shared libraries
which are only symlinks to real files (real files has version in filename).
And only this symlinks are copied, without actual library.


What is the right way to include 3rd party libraries into my
install/package?

Thanks


Jan Dolecek
juzna.cz at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110530/87315baa/attachment.htm>


More information about the CMake mailing list