blob: d4c7765697b87efb4fd8f496822323d77c4a9767 [file] [log] [blame]
Brad Bishop0f291cc2019-09-01 15:16:57 -04001From a47ca75702318ff43446c70120f7aacde4ccee1b Mon Sep 17 00:00:00 2001
2From: Eero Aaltonen <eero.aaltonen@vaisala.com>
3Date: Thu, 20 Jun 2019 16:21:20 +0300
4Subject: [PATCH] Set library VERSION and SOVERSION
5
6With soversion and version specified, `install` target will install the
7library with the specified version and also create the proper symlink.
8
9Upstream-Status: Submitted [https://github.com/docopt/docopt.cpp/pull/112]
10but unlikely to be merged soon as it is a duplicate of
11[https://github.com/docopt/docopt.cpp/pull/112] which has been **Open**
12since 2016-12-08.
13---
14 CMakeLists.txt | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/CMakeLists.txt b/CMakeLists.txt
18index 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