diff options
author | Carsten Brandt <mail@cebe.cc> | 2017-01-05 21:47:10 +0100 |
---|---|---|
committer | Carsten Brandt <mail@cebe.cc> | 2017-01-08 19:18:06 +0100 |
commit | 6ec23c98bd5e6b6ca3dad9d5da5a46e83419f5bb (patch) | |
tree | a385bfa0929f4470f84d39bae3465027ca75f1a0 /cmake | |
parent | 31eaffe44bec059248788c490a7f2f9890e6fa0b (diff) |
Add soversion to library files to generate proper symlinks
As mentioned in https://github.com/TokTok/c-toxcore/issues/359#issuecomment-270710463
the current CMake build does not generate version symlinks for library .so files.
This is because the version is not specified for library targets.
See
- https://cmake.org/cmake/help/v3.0/prop_tgt/SOVERSION.html#prop_tgt:SOVERSION
- https://cmake.org/cmake/help/v3.0/prop_tgt/VERSION.html#prop_tgt:VERSION
Use PROJECT_VERSION_MAJOR and MINOR for SOVERSION because
api may break from 0.1 to 0.2 in the 0.x release cycle.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/ModulePackage.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/ModulePackage.cmake b/cmake/ModulePackage.cmake index 613633ba..f6e7e31a 100644 --- a/cmake/ModulePackage.cmake +++ b/cmake/ModulePackage.cmake | |||
@@ -54,7 +54,13 @@ function(add_module lib) | |||
54 | 54 | ||
55 | if(ENABLE_SHARED) | 55 | if(ENABLE_SHARED) |
56 | add_library(${lib}_shared SHARED ${ARGN}) | 56 | add_library(${lib}_shared SHARED ${ARGN}) |
57 | set_target_properties(${lib}_shared PROPERTIES OUTPUT_NAME ${lib}) | 57 | set_target_properties(${lib}_shared PROPERTIES |
58 | OUTPUT_NAME ${lib} | ||
59 | VERSION ${PROJECT_VERSION} | ||
60 | # While on 0.x, the x behaves like the major version. 0.2 will be | ||
61 | # incompatible with 0.1. Change this, when releasing 1.0! | ||
62 | SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} | ||
63 | ) | ||
58 | install(TARGETS ${lib}_shared DESTINATION "lib") | 64 | install(TARGETS ${lib}_shared DESTINATION "lib") |
59 | endif() | 65 | endif() |
60 | if(ENABLE_STATIC) | 66 | if(ENABLE_STATIC) |