changeset 320:53f912ce0f4e

Add shared object version information
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 19 May 2010 15:09:27 +0900
parents 91f2f9531c47
children fafe53aadc75
files CMakeLists.txt INSTALL.Ubuntu freeDiameter/CMakeLists.txt include/freeDiameter/freeDiameter-host.h.in include/freeDiameter/libfreeDiameter.h libfreeDiameter/CMakeLists.txt
diffstat 6 files changed, 32 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Wed May 19 14:04:52 2010 +0900
+++ b/CMakeLists.txt	Wed May 19 15:09:27 2010 +0900
@@ -6,10 +6,15 @@
 # Informations to display in daemon's help
 SET(FD_PROJECT_NAME freeDiameter)
 SET(FD_PROJECT_BINARY freeDiameterd)
+SET(FD_PROJECT_COPYRIGHT "Copyright (c) 2008-2009, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)")
+
+# Version of the source code
 SET(FD_PROJECT_VERSION_MAJOR 1)
 SET(FD_PROJECT_VERSION_MINOR 0)
 SET(FD_PROJECT_VERSION_REV 0)
-SET(FD_PROJECT_COPYRIGHT "Copyright (c) 2008-2009, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)")
+
+# Version of the API with the library
+SET(FD_PROJECT_VERSION_API 1)
 
 # Some subfolders may have tests
 ENABLE_TESTING()
--- a/INSTALL.Ubuntu	Wed May 19 14:04:52 2010 +0900
+++ b/INSTALL.Ubuntu	Wed May 19 15:09:27 2010 +0900
@@ -54,7 +54,7 @@
 
 ===========================================
 
-You can alternatively do:
+# You can alternatively do:
 apt-get -y install mercurial cmake make gcc bison flex libsctp-dev libgnutls-dev libgcrypt-dev libpq-dev ssl-cert debhelper
 cd /usr/src
 hg clone http://aaa.koganei.wide.ad.jp/hg/freeDiameter
--- a/freeDiameter/CMakeLists.txt	Wed May 19 14:04:52 2010 +0900
+++ b/freeDiameter/CMakeLists.txt	Wed May 19 15:09:27 2010 +0900
@@ -42,6 +42,11 @@
 		fdd.tab.c
 		fdd.tab.h
 	)
+	
+# Save the list of files for the tests 
+SET(FD_COMMON_SRC ${FD_COMMON_SRC} PARENT_SCOPE)
+SET(FD_COMMON_GEN_SRC ${FD_COMMON_GEN_SRC} PARENT_SCOPE)
+
 
 # Require GNU TLS for building the daemon
 FIND_PACKAGE(GnuTLS REQUIRED)
@@ -54,9 +59,14 @@
 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR)
 INCLUDE_DIRECTORIES(${GCRYPT_INCLUDE_DIR})
 
-# Building the executable
+
+# Build the executable
 ADD_EXECUTABLE(freeDiameterd ${FD_COMMON_SRC} ${FD_COMMON_GEN_SRC} main.c)
 
+# The version
+SET_TARGET_PROPERTIES(freeDiameterd PROPERTIES 
+	VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV})
+
 # Add this to workaround an apparent bug in FreeBSD cmake (already defined in Linux)
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-rdynamic")
 
@@ -64,10 +74,6 @@
 LINK_DIRECTORIES(${CURRENT_BINARY_DIR}/../libfreeDiameter)
 TARGET_LINK_LIBRARIES(freeDiameterd libfreeDiameter ${FD_LIBS})
 
-# Save the list of files, if needed
-SET(FD_COMMON_SRC ${FD_COMMON_SRC} PARENT_SCOPE)
-SET(FD_COMMON_GEN_SRC ${FD_COMMON_GEN_SRC} PARENT_SCOPE)
-
 # The unary tests directory
 OPTION(SKIP_TESTS "Skip compilation of the tests?" ON)
 IF ( NOT SKIP_TESTS )
--- a/include/freeDiameter/freeDiameter-host.h.in	Wed May 19 14:04:52 2010 +0900
+++ b/include/freeDiameter/freeDiameter-host.h.in	Wed May 19 15:09:27 2010 +0900
@@ -65,8 +65,10 @@
 #ifndef FD_PROJECT_VERSION_REV
 # define FD_PROJECT_VERSION_REV 0
 #endif /*FD_PROJECT_VERSION_REV*/
-/* HG_VERSION */
-/* PACKAGE_HG_REVISION */
+#cmakedefine FD_PROJECT_VERSION_API   @FD_PROJECT_VERSION_API@
+#ifndef FD_PROJECT_VERSION_API
+# define FD_PROJECT_VERSION_API 0
+#endif /*FD_PROJECT_VERSION_API*/
 #cmakedefine FD_PROJECT_COPYRIGHT "@FD_PROJECT_COPYRIGHT@"
 
 #cmakedefine DEFAULT_CONF_PATH "@DEFAULT_CONF_PATH@"
--- a/include/freeDiameter/libfreeDiameter.h	Wed May 19 14:04:52 2010 +0900
+++ b/include/freeDiameter/libfreeDiameter.h	Wed May 19 15:09:27 2010 +0900
@@ -39,6 +39,8 @@
  * It provides the tools to manipulate Diameter messages and related data.
  * This file should always be included as #include <freeDiameter/libfreeDiameter.h>
  *
+ * If any change is made to this file, you must increment the FD_PROJECT_VERSION_API version.
+ *
  * The file contains the following parts:
  *	DEBUG
  *	MACROS
--- a/libfreeDiameter/CMakeLists.txt	Wed May 19 14:04:52 2010 +0900
+++ b/libfreeDiameter/CMakeLists.txt	Wed May 19 15:09:27 2010 +0900
@@ -16,18 +16,21 @@
 	signal.c
 	)
 
+# Save the list of files for testcases in the daemon's directory
+SET(LFD_SRC ${LFD_SRC} PARENT_SCOPE)
+
 # Build as a shared library
 ADD_LIBRARY(libfreeDiameter SHARED ${LFD_SRC})
 
-# Avoid the liblib name
-SET_TARGET_PROPERTIES(libfreeDiameter PROPERTIES OUTPUT_NAME "freeDiameter")
+# Avoid the liblib name, and set the version
+SET_TARGET_PROPERTIES(libfreeDiameter PROPERTIES 
+	OUTPUT_NAME "freeDiameter"
+	SOVERSION ${FD_PROJECT_VERSION_API}
+	VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV})
 
 # The library itself needs other libraries 
 TARGET_LINK_LIBRARIES(libfreeDiameter ${LFD_LIBS})
 
-# Save the list of files for testcases in the daemon's directory
-SET(LFD_SRC ${LFD_SRC} PARENT_SCOPE)
-
 
 ####
 ## INSTALL section ##
"Welcome to our mercurial repository"