#536 cmake is not building expat library with libexpat.so.1 name

Feature Request
closed-fixed
nobody
None
5
2016-06-05
2016-05-23
No

We use CMAKE to build 'libexpat' for linux platforms. The build generates libexpat library as libexpat.so Many other libraries like fontconfig have a dependency on libexpat.so.0 or libexpat.so.1. It would be nice if the expat library can be built with name 'libexpat.so.1'.

Note: I tried 'make' and expat library is properly built with name libexpat.so.1. It's just that CMAKE doesn't build in a standard manner.

Just a FYI, I added the following line in CMakeLists.txt and the problem was fixed.

set_property(TARGET expat PROPERTY SOVERSION 1)

Thanks
Sankar.

Discussion

  • Sankar Tanguturi

    Here is the diff for my fix:

    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -61,6 +61,7 @@ else(BUILD_shared)
    endif(BUILD_shared)

    add_library(expat ${_SHARED} ${expat_SRCS})
    +set_property(TARGET expat PROPERTY SOVERSION 0)^M

    install(TARGETS expat RUNTIME DESTINATION bin
    LIBRARY DESTINATION lib

     
  • Sebastian Pipping

     
    • Sankar Tanguturi

      Thanks for the patch. This generates the following:

      libexpat.so -> libexpat.so.1.6.0
      libexpat.so.1.6.0

      To be consistent with other older versions of expat, can we also have libexpat.so.1 which should symlink to libexpat.so.1.6.0

      So, it will be

      libexpat.so -> libexpat.so.1.6.0
      libexpat.so.1 -> libexpat.so.1.6.0
      libexpat.so.1.6.0

      Thanks

       
  • Sebastian Pipping

    Hi!

    I'm having trouble finding a clean (or any good) way to do that. My impression is that CMake does not create as many links as Automake would. What I found is NAMELINK_ONLY and NAMELINK_SKIP (neither of which help) and http://stackoverflow.com/a/18734490 .
    I am happy to apply a clean patch if you make some. Also please let me know how bad .so.1.6.0 is to you if there is no clean fix and we hacve to pick from .1.6.0 and .1 . Thanks!

     
  • Sebastian Pipping

    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks