Add VERSION and SOVERSION number to shared libraries

With this commit, when building or installing `glew`, VERSION and
SOVERSION symlinks to the `glew` shared library are created in the
library installation folder if the platform supports them and the linker
supports so-names.
VERSION and SOVERSION specify, respectively, the build version and API
version of the shared library.

As an example, under macOS, the following symlinks will be created:
libGLEW.2.0.0.dylib                      (the shared library)
libGLEW.2.0.dylib -> libGLEW.2.0.0.dylib (VERSION symlink)
libGLEW.dylib -> libGLEW.2.0.dylib       (SOVERSION symlink)

Fixes #141
This commit is contained in:
Claudio 2017-04-23 18:48:58 +02:00
parent 8ef3df14f3
commit e7bf0f70b3
No known key found for this signature in database
GPG Key ID: 49146E9700A0F328

View File

@ -93,7 +93,9 @@ if (WIN32)
endif ()
add_library (glew SHARED ${GLEW_PUBLIC_HEADERS_FILES} ${GLEW_SRC_FILES})
set_target_properties (glew PROPERTIES COMPILE_DEFINITIONS "GLEW_BUILD" OUTPUT_NAME "${GLEW_LIB_NAME}" PREFIX "${DLL_PREFIX}")
set_target_properties (glew PROPERTIES COMPILE_DEFINITIONS "GLEW_BUILD" OUTPUT_NAME "${GLEW_LIB_NAME}" PREFIX "${DLL_PREFIX}"
VERSION ${GLEW_VERSION}
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})
add_library (glew_s STATIC ${GLEW_PUBLIC_HEADERS_FILES} ${GLEW_SRC_FILES})
set_target_properties (glew_s PROPERTIES COMPILE_DEFINITIONS "GLEW_STATIC" OUTPUT_NAME "${GLEW_LIB_NAME}" PREFIX lib)