File: 01-library-versioning.patch

package info (click to toggle)
nvidia-texture-tools 2.0.8-1%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,304 kB
  • sloc: cpp: 22,495; ansic: 1,097; sh: 59; makefile: 12
file content (91 lines) | stat: -rw-r--r-- 2,805 bytes parent folder | download | duplicates (2)
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
Title: Library Versioning
DEP: 3
Last-Update: 2012-01-07
Author: Lennart Weller <lhw@ring0.de>
Forwarded: http://code.google.com/p/nvidia-texture-tools/issues/detail?id=170&thanks=170&ts=1326227583
Abstract:
 Added library versioning to match debian standards. Patch is submitted upstream. 

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51f1253..68b4fe4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ IF(NVTT_SHARED)
 	SET(NVIMAGE_SHARED TRUE)
 ENDIF(NVTT_SHARED)
 
-
+INCLUDE(${NV_CMAKE_DIR}/Libraries.cmake)
 ADD_SUBDIRECTORY(src)
 
 IF(WIN32)
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})
diff --git a/src/nvcore/CMakeLists.txt b/src/nvcore/CMakeLists.txt
index 385e201..50ace0f 100644
--- a/src/nvcore/CMakeLists.txt
+++ b/src/nvcore/CMakeLists.txt
@@ -40,6 +40,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 7b2f197..bfcb576 100644
--- a/src/nvimage/CMakeLists.txt
+++ b/src/nvimage/CMakeLists.txt
@@ -60,6 +60,9 @@ ELSE(NVIMAGE_SHARED)
 ENDIF(NVIMAGE_SHARED)
 
 TARGET_LINK_LIBRARIES(nvimage ${LIBS} nvcore nvmath posh)
+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 96aec78..5e42733 100644
--- a/src/nvmath/CMakeLists.txt
+++ b/src/nvmath/CMakeLists.txt
@@ -26,6 +26,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 9ce93d0..1be4200 100644
--- a/src/nvtt/CMakeLists.txt
+++ b/src/nvtt/CMakeLists.txt
@@ -51,6 +51,9 @@ ELSE(NVTT_SHARED)
 ENDIF(NVTT_SHARED)
 
 TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvmath nvimage squish)
+SET_TARGET_PROPERTIES(nvtt PROPERTIES
+	VERSION ${GENERIC_LIB_VERSION}
+	SOVERSION ${GENERIC_LIB_SOVERSION})
 
 INSTALL(TARGETS nvtt 
 	RUNTIME DESTINATION bin