Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simulate autotools behaviour in SO-NAME and symlink generation. #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
coldtobi wants to merge 1 commit into log4cplus:master
base: master
Choose a base branch
Loading
from coldtobi:cmake-same-so-name

Conversation

Copy link

@coldtobi coldtobi commented Oct 28, 2020

This patch aligns cmake so that the SONAME and library name matches the output of autotools:

With autotools: (build and then make install DESTDIR=sometmpdir)

tobi@isildor:~/workspace/deb/packages/log4cplus/upstream/log4cplus/build/tmp/usr/local/lib$ ls -la 
insgesamt 21448
drwxr-xr-x 3 tobi tobi 4096 28. Okt 18:08 .
drwxr-xr-x 4 tobi tobi 4096 28. Okt 18:08 ..
lrwxrwxrwx 1 tobi tobi 25 28. Okt 18:08 liblog4cplus-3.0.so.0 -> liblog4cplus-3.0.so.0.0.0
-rwxr-xr-x 1 tobi tobi 10671368 28. Okt 18:08 liblog4cplus-3.0.so.0.0.0
-rwxr-xr-x 1 tobi tobi 967 28. Okt 18:08 liblog4cplus.la
lrwxrwxrwx 1 tobi tobi 25 28. Okt 18:08 liblog4cplus.so -> liblog4cplus-3.0.so.0.0.0
drwxr-xr-x 2 tobi tobi 4096 28. Okt 18:08 pkgconfig

(the unicode flavour libs has been removed from above ls to illustrate the point better)

With CMake: (build and then make install DESTDIR=sometmpdir)

tobi@isildor:~/workspace/deb/packages/log4cplus/upstream/log4cplus/build_cmake/tmp/usr/local/lib$ ls -lah
insgesamt 6,4M
drwxr-xr-x 3 tobi tobi 4,0K 28. Okt 18:14 .
drwxr-xr-x 5 tobi tobi 4,0K 28. Okt 18:14 ..
drwxr-xr-x 3 tobi tobi 4,0K 28. Okt 18:14 cmake
lrwxrwxrwx 1 tobi tobi 21 28. Okt 18:14 liblog4cplus-3.0.so -> liblog4cplus-3.0.so.3
-rw-r--r-- 1 tobi tobi 6,4M 28. Okt 18:13 liblog4cplus-3.0.so.0.0.0
lrwxrwxrwx 1 tobi tobi 25 28. Okt 18:14 liblog4cplus-3.0.so.3 -> liblog4cplus-3.0.so.0.0.0

Please note that there is still one discrepancy: Autotools generates a SO-Version of zero (as configured in configure.ac) and CMake does a SO-Version of 3 (as you recently changed in wilx@aa1a04c) I left this to you to decide whether it sould be "zero" or "three", but it should be aligned.

Thanks!

set(lib ${CMAKE_SHARED_LIBRARY_PREFIX})
set(so ${CMAKE_SHARED_LIBRARY_SUFFIX})
install(CODE "execute_process(
COMMAND bash -c \"set -e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work with many platforms.

Copy link
Author

@coldtobi coldtobi Nov 9, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, this should be wrapped in some if(LINUX) or like...

@wilx wilx force-pushed the master branch 5 times, most recently from 447594f to a2990a2 Compare June 6, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@wilx wilx wilx left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /