3.2.1.6 : La gestion des version de bibliothèques

Voici le phoenix_add_library.cmake : Petite fonction pour ajouter la version du projet comme suffixe du nom des bibliothèques associées (ça fait classe comme les bibliothèques systèmes, et ça évite les collisions malheureuses si vous ne faites pas attention) :
1
2
3
4
5
6
7
8
9
10
11
12
# Add Shared library with suffix by respect to the program version set with the phoenix_base_project function
# 	targetName : name of the library target to be created
# 	ARGN : list of dependencies
function(phoenix_add_library targetName)
	add_library(${targetName} SHARED ${ARGN})

	string(REPLACE "." ";" PROGRAM_VERSION_LIST ${PROGRAM_VERSION})
	list(GET PROGRAM_VERSION_LIST 0 PROGRAM_VERSION_SO)
	set_target_properties(${targetName} PROPERTIES
		VERSION "${PROGRAM_VERSION}"
		SOVERSION "${PROGRAM_VERSION_SO}")
endfunction(phoenix_add_library)


Le fichier phoenix_add_library.cmake complet :
1
2
3
4
5
6
7
8
9
10
11
12
# Add Shared library with suffix by respect to the program version set with the phoenix_base_project function
# 	targetName : name of the library target to be created
# 	ARGN : list of dependencies
function(phoenix_add_library targetName)
	add_library(${targetName} SHARED ${ARGN})

	string(REPLACE "." ";" PROGRAM_VERSION_LIST ${PROGRAM_VERSION})
	list(GET PROGRAM_VERSION_LIST 0 PROGRAM_VERSION_SO)
	set_target_properties(${targetName} PROPERTIES
		VERSION "${PROGRAM_VERSION}"
		SOVERSION "${PROGRAM_VERSION_SO}")
endfunction(phoenix_add_library)
Lien de téléchargement ici.