shithub: dumb

Download patch

ref: 87219e8c7135c5d54ae37d8f9cbae9eba67dde4b
parent: 292a32823ddb0b3667e6db878c755cf41893cc51
author: Rémi Verschelde <rverschelde@gmail.com>
date: Mon Jul 17 10:11:21 EDT 2017

Add proper shared library versioning, set SOVERSION to 1

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,11 @@
 cmake_minimum_required(VERSION 3.1)
 project(libdumb C)
 
+# Bump major (== soversion) on API breakages
+set(DUMB_VERSION_MAJOR 1)
+set(DUMB_VERSION_MINOR 0)
+set(DUMB_VERSION ${DUMB_VERSION_MAJOR}.${DUMB_VERSION_MINOR})
+
 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake-scripts)
 
 option(BUILD_EXAMPLES "Build example binaries" ON)
@@ -138,9 +143,14 @@
 
 add_library(dumb ${SOURCES})
 set_target_properties(dumb PROPERTIES DEBUG_POSTFIX d)
+set_target_properties(dumb PROPERTIES VERSION ${DUMB_VERSION})
+set_target_properties(dumb PROPERTIES SOVERSION ${DUMB_VERSION_MAJOR})
 
 if(BUILD_ALLEGRO4)
     add_library(aldmb ${ALLEGRO_SOURCES})
+    set_target_properties(aldmb PROPERTIES DEBUG_POSTFIX d)
+    set_target_properties(aldmb PROPERTIES VERSION ${DUMB_VERSION})
+    set_target_properties(aldmb PROPERTIES SOVERSION ${DUMB_VERSION_MAJOR})
     list(APPEND DUMB_TARGETS aldmb)
     list(APPEND INSTALL_HEADERS include/aldumb.h)
     target_link_libraries(aldmb ${ALLEGRO_LIBRARIES})