shithub: dumb

Download patch

ref: 56f99e44bca8f43639eeff9a4db0a873ef0d2de4
parent: 5e999be4958dcec6e27d3c07bd93143f1677d15c
parent: 87219e8c7135c5d54ae37d8f9cbae9eba67dde4b
author: Christopher Snowhill <kode54@gmail.com>
date: Mon Jul 17 14:25:06 EDT 2017

Merge pull request #36 from akien-mga/lib-soname

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} dumb)