Skip to content

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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ include (Log4CPlusUtils.cmake)
log4cplus_get_version ("${PROJECT_SOURCE_DIR}/include"
log4cplus_version_major log4cplus_version_minor log4cplus_version_patch)
message("-- Generating build for Log4cplus version ${log4cplus_version_major}.${log4cplus_version_minor}.${log4cplus_version_patch}")
set (log4cplus_soversion 0)
set (log4cplus_soversion 3)
set (log4cplus_libtoolversion 0.0.0)
set (log4cplus_postfix "")

option(LOG4CPLUS_BUILD_TESTING "Build the test suite." ON)
Expand Down
15 changes: 13 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,20 @@ if (ANDROID)
target_compile_definitions (${log4cplus} PRIVATE INSIDE_LOG4CPLUS)
else ()
set_target_properties (${log4cplus} PROPERTIES
VERSION "${log4cplus_version_major}.${log4cplus_version_minor}.${log4cplus_version_patch}"
SOVERSION "${log4cplus_soversion}")
VERSION "${log4cplus_libtoolversion}"
SOVERSION "${log4cplus_soversion}"
OUTPUT_NAME "${log4cplus}-${log4cplus_version_major}.${log4cplus_version_minor}")
target_compile_definitions (${log4cplus} PRIVATE INSIDE_LOG4CPLUS)
get_target_property(libname ${log4cplus} OUTPUT_NAME)
get_target_property(libversion ${log4cplus} VERSION)
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

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…

cd $DESTDIR/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
echo -n -- Installing: `pwd`/
ln -sfv ${lib}${libname}${so}.${libversion} ${lib}${log4cplus}${so}
\")")
endif ()

if (MINGW AND LOG4CPLUS_MINGW_STATIC_RUNTIME)
Expand Down