@@ -54,6 +54,7 @@ if (LIBTIDY_VERSION)
54
54
list (GET VERSION_LIST 0 TIDY_MAJOR_VERSION)
55
55
list (GET VERSION_LIST 1 TIDY_MINOR_VERSION)
56
56
list (GET VERSION_LIST 2 TIDY_POINT_VERSION)
57
+ set (TIDY_SO_VERSION "${TIDY_MAJOR_VERSION}${TIDY_MINOR_VERSION} " )
57
58
else ()
58
59
message (FATAL_ERROR "*** FAILED to get a VERSION from version.txt!" )
59
60
endif ()
@@ -68,6 +69,21 @@ else ()
68
69
message (FATAL_ERROR "*** FAILED to get a DATE from version.txt!" )
69
70
endif ()
70
71
72
+ # Establish SOVERSION. Tidy uses a weird form of semantic versioning,
73
+ # wherein even minor versions are stable versions with SONAMEs, and
74
+ # odd minor versions are `next` versions that should NOT be released,
75
+ # are NOT stable, and should NOT have a valid SONAME.
76
+ if (TIDY_SO_VERSION)
77
+ math (EXPR NO_SONAME "${TIDY_SO_VERSION} % 2" )
78
+ if ( NO_SONAME EQUAL 0)
79
+ message ("-> TIDY_SO_VERSION = ${TIDY_SO_VERSION} . This is an EVEN (stable) release." )
80
+ else ()
81
+ message ("-> TIDY_SO_VERSION = ${TIDY_SO_VERSION} . This is an ODD (development) release." )
82
+ endif ()
83
+ else ()
84
+ message (FATAL_ERROR "*** FAILED to build a TIDY_SO_VERSION!" )
85
+ endif ()
86
+
71
87
72
88
#------------------------------------------------------------------------
73
89
# Library Types and Linking
@@ -420,7 +436,8 @@ if (BUILD_SHARED_LIB)
420
436
OUTPUT_NAME ${LIB_NAME} )
421
437
set_target_properties ( ${name} PROPERTIES
422
438
VERSION ${LIBTIDY_VERSION}
423
- SOVERSION ${TIDY_MAJOR_VERSION} )
439
+ SOVERSION ${TIDY_SO_VERSION}
440
+ NO_SONAME ${NO_SONAME} )
424
441
set_target_properties ( ${name} PROPERTIES
425
442
COMPILE_FLAGS "-DBUILD_SHARED_LIB -DBUILDING_SHARED_LIB" )
426
443
install (TARGETS ${name}
0 commit comments