0

I have a CMake project which depends on gsl >= 2.3 for which I would like to distribute a debian package on ubuntu/xenial. As gsl > 2.3 is not the version shipped with ubuntu/xenial, I can not use in that case the CPACK_DEBIAN_PACKAGE_SHLIBDEPS variable to set gsl as a dependency of my package. Thus, I would like to ship the libgsl and libgslcblas dynamic libraries, that I built on my own, with my debian package. I tried the following approach

find_package(GSL 2.3 REQUIRED) --> this return the ${GSL_LIBRARIES} variable
...
install(FILES ${GSL_LIBRARIES} DESTINATION ${DEBIAN_INSTALL_DIR}lib COMPONENT LIB)

but because GSL_LIBRARIES returns links to the targeted libraries, it installed the links and not the libraries. Would you know how to proceed ?

Eurydice
  • 8,001
  • 4
  • 24
  • 37
  • "I tried with a CMake `install(FILES...)` command but it installed the link to the actual library instead of the library itself." - Probably, the link to the library is what you actually pass to the `install` command. – Tsyvarev Jun 28 '18 at 14:56
  • yes, exactly and this is where I am in trouble – Eurydice Jun 28 '18 at 15:01
  • So, just pass actual library file to the `install(FILES)` command, not a link to it. What is a problem in that? – Tsyvarev Jun 28 '18 at 15:03
  • the `${GSL_LIBRARIES}` variable returned by the `find_package(GSL 2.3 REQUIRED)` call, that I use to feed the `install` command, returns the link path instead of the actual targeted libraries – Eurydice Jun 28 '18 at 15:11
  • Oh, so you tried to install libraries listed in the variable `GSL_LIBRARIES`, which is created by `find_package`. Can you add this into the question post? I thought you install files manually. As for the problem - you may try to resolve paths listed in the variable. Use `readlink -f` shell's command for do that. – Tsyvarev Jun 28 '18 at 15:19
  • I can give a try even if I wanted to avoid this kind of system call which may indicate that I am thinking wrong and that my approach is not the way to go – Eurydice Jun 28 '18 at 15:28
  • 1
    Yes, `find_package()` is intended for **use** (link with) the library, not for **installing** it. For proper installing a 3d party lbrary you need to use an installer of the library's itself. The whole attempt to installing the 3d party manually is not a proper way. However, there many things in programming which are not intended to work, but needed. If you you need to install 3d-party library without the library's installer - just do that. – Tsyvarev Jun 28 '18 at 16:29
  • you right. thanks for your help – Eurydice Jun 28 '18 at 18:01

0 Answers0