File: 0001-Library-Versioning.patch

package info (click to toggle)
nvidia-texture-tools 2.1.0-git20160229%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,016 kB
  • sloc: cpp: 43,200; ansic: 22,635; sh: 67; makefile: 14
file content (109 lines) | stat: -rw-r--r-- 3,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
From: Lennart Weller <lhw@ring0.de>
Date: Thu, 3 Mar 2016 17:24:05 +0100
Subject: Library Versioning

---
 CMakeLists.txt             | 2 ++
 cmake/Libraries.cmake      | 8 ++++++++
 src/nvcore/CMakeLists.txt  | 3 +++
 src/nvimage/CMakeLists.txt | 3 +++
 src/nvmath/CMakeLists.txt  | 3 +++
 src/nvtt/CMakeLists.txt    | 3 +++
 6 files changed, 22 insertions(+)
 create mode 100644 cmake/Libraries.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41dde6b..50a7f1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,8 @@ IF(NVTT_SHARED)
 	SET(NVIMAGE_SHARED TRUE)
 ENDIF(NVTT_SHARED)
 
+INCLUDE(${NV_CMAKE_DIR}/Libraries.cmake)
+
 ADD_SUBDIRECTORY(extern)
 
 ADD_SUBDIRECTORY(src)
diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake
new file mode 100644
index 0000000..d03b19d
--- /dev/null
+++ b/cmake/Libraries.cmake
@@ -0,0 +1,8 @@
+file(READ "VERSION" VERSION)
+
+string(REGEX REPLACE "([0-9]).*" "\\1" MAJOR ${VERSION})
+string(REGEX REPLACE "[0-9].([0-9]).*" "\\1" MINOR ${VERSION})
+string(REGEX REPLACE ".*([0-9])\n$" "\\1" MAINTENANCE ${VERSION})
+
+set(GENERIC_LIB_VERSION "${MAJOR}.${MINOR}.${MAINTENANCE}")
+set(GENERIC_LIB_SOVERSION ${MAJOR}.${MINOR})
diff --git a/src/nvcore/CMakeLists.txt b/src/nvcore/CMakeLists.txt
index 9246768..9951c19 100644
--- a/src/nvcore/CMakeLists.txt
+++ b/src/nvcore/CMakeLists.txt
@@ -37,6 +37,9 @@ ELSE(NVCORE_SHARED)
 ENDIF(NVCORE_SHARED)
 
 TARGET_LINK_LIBRARIES(nvcore ${LIBS})
+SET_TARGET_PROPERTIES(nvcore PROPERTIES
+	VERSION ${GENERIC_LIB_VERSION}
+	SOVERSION ${GENERIC_LIB_SOVERSION})
 
 INSTALL(TARGETS nvcore
     RUNTIME DESTINATION bin
diff --git a/src/nvimage/CMakeLists.txt b/src/nvimage/CMakeLists.txt
index dce627d..ea322c7 100644
--- a/src/nvimage/CMakeLists.txt
+++ b/src/nvimage/CMakeLists.txt
@@ -54,6 +54,9 @@ ELSE(NVIMAGE_SHARED)
 ENDIF(NVIMAGE_SHARED)
 
 TARGET_LINK_LIBRARIES(nvimage ${LIBS} nvcore posh bc6h bc7 nvmath)
+SET_TARGET_PROPERTIES(nvimage PROPERTIES
+	VERSION ${GENERIC_LIB_VERSION}
+	SOVERSION ${GENERIC_LIB_SOVERSION})
 
 INSTALL(TARGETS nvimage
     RUNTIME DESTINATION bin
diff --git a/src/nvmath/CMakeLists.txt b/src/nvmath/CMakeLists.txt
index 093f108..894a90f 100644
--- a/src/nvmath/CMakeLists.txt
+++ b/src/nvmath/CMakeLists.txt
@@ -25,6 +25,9 @@ ELSE(NVMATH_SHARED)
 ENDIF(NVMATH_SHARED)
 
 TARGET_LINK_LIBRARIES(nvmath ${LIBS} nvcore)
+SET_TARGET_PROPERTIES(nvmath PROPERTIES
+	VERSION ${GENERIC_LIB_VERSION}
+	SOVERSION ${GENERIC_LIB_SOVERSION})
 
 INSTALL(TARGETS nvmath
     RUNTIME DESTINATION bin
diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt
index 9f1e394..e930a21 100644
--- a/src/nvtt/CMakeLists.txt
+++ b/src/nvtt/CMakeLists.txt
@@ -48,6 +48,9 @@ ELSE(NVTT_SHARED)
 ENDIF(NVTT_SHARED)
 
 TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvimage nvthread squish bc6h bc7 nvmath)
+SET_TARGET_PROPERTIES(nvtt PROPERTIES
+	VERSION ${GENERIC_LIB_VERSION}
+	SOVERSION ${GENERIC_LIB_SOVERSION})
 
 INSTALL(TARGETS nvtt 
     RUNTIME DESTINATION bin
--- a/src/nvthread/CMakeLists.txt
+++ b/src/nvthread/CMakeLists.txt
@@ -21,6 +21,9 @@ ELSE(NVTHREAD_SHARED)
 ENDIF(NVTHREAD_SHARED)
 
 TARGET_LINK_LIBRARIES(nvthread ${LIBS} nvcore)
+SET_TARGET_PROPERTIES(nvthread PROPERTIES
+	VERSION ${GENERIC_LIB_VERSION}
+	SOVERSION ${GENERIC_LIB_SOVERSION})
 
 INSTALL(TARGETS nvthread
 	RUNTIME DESTINATION bin