Brad Bishop | 0f291cc | 2019-09-01 15:16:57 -0400 | [diff] [blame^] | 1 | From a47ca75702318ff43446c70120f7aacde4ccee1b Mon Sep 17 00:00:00 2001 |
| 2 | From: Eero Aaltonen <eero.aaltonen@vaisala.com> |
| 3 | Date: Thu, 20 Jun 2019 16:21:20 +0300 |
| 4 | Subject: [PATCH] Set library VERSION and SOVERSION |
| 5 | |
| 6 | With soversion and version specified, `install` target will install the |
| 7 | library with the specified version and also create the proper symlink. |
| 8 | |
| 9 | Upstream-Status: Submitted [https://github.com/docopt/docopt.cpp/pull/112] |
| 10 | but unlikely to be merged soon as it is a duplicate of |
| 11 | [https://github.com/docopt/docopt.cpp/pull/112] which has been **Open** |
| 12 | since 2016-12-08. |
| 13 | --- |
| 14 | CMakeLists.txt | 4 ++++ |
| 15 | 1 file changed, 4 insertions(+) |
| 16 | |
| 17 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 18 | index 23da468..feff32e 100644 |
| 19 | --- a/CMakeLists.txt |
| 20 | +++ b/CMakeLists.txt |
| 21 | @@ -50,6 +50,10 @@ else() |
| 22 | set_target_properties(docopt_o PROPERTIES POSITION_INDEPENDENT_CODE TRUE) |
| 23 | |
| 24 | add_library(docopt SHARED $<TARGET_OBJECTS:docopt_o>) |
| 25 | + set_target_properties(docopt PROPERTIES |
| 26 | + VERSION ${PROJECT_VERSION} |
| 27 | + SOVERSION ${PROJECT_VERSION_MAJOR} |
| 28 | + ) |
| 29 | add_library(docopt_s STATIC $<TARGET_OBJECTS:docopt_o>) |
| 30 | endif() |
| 31 | |