CMake: Enforce library versioning compatible with GNU Libtool for macOS
This commit is contained in:
parent
27d5b8ba17
commit
f00c5857f9
@ -422,6 +422,18 @@ if(NOT WIN32)
|
|||||||
set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
|
set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
|
||||||
set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
|
set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
|
||||||
set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
|
set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
if(NOT CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
|
||||||
|
message(FATAL_ERROR "Expat requires CMake >=3.17 on platform \"APPLE\".")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# NOTE: This intends to talk CMake into compatiblity with GNU Libtool
|
||||||
|
math(EXPR _EXPAT_MACHO_COMPATIBILITY_VERSION "${LIBCURRENT} + 1")
|
||||||
|
set(_EXPAT_MACHO_CURRENT_VERSION "${_EXPAT_MACHO_COMPATIBILITY_VERSION}.${LIBREVISION}")
|
||||||
|
set_property(TARGET expat PROPERTY MACHO_COMPATIBILITY_VERSION ${_EXPAT_MACHO_COMPATIBILITY_VERSION})
|
||||||
|
set_property(TARGET expat PROPERTY MACHO_CURRENT_VERSION ${_EXPAT_MACHO_CURRENT_VERSION})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(WIN32 AND NOT MINGW)
|
if(WIN32 AND NOT MINGW)
|
||||||
# NOTE: This avoids a name collision with Expat.dll of Perl's XML::Parser::Expat
|
# NOTE: This avoids a name collision with Expat.dll of Perl's XML::Parser::Expat
|
||||||
|
Loading…
Reference in New Issue
Block a user