From 10bf12e199e4965607bfd17c7fb14e0e242c4333 Mon Sep 17 00:00:00 2001 From: Andrew Andrianov Date: Mon, 15 Aug 2016 15:28:39 +0300 Subject: [PATCH] CMakeLists.txt: Fix .so version naming Signed-off-by: Andrew Andrianov --- CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dd272bc1..40886f3f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,8 +152,17 @@ add_library(${PROJECT_NAME} SHARED ${STLINK_HEADERS} # header files for ide projects generated by cmake ${STLINK_SOURCE}) target_link_libraries(${PROJECT_NAME} ${LIBUSB_LIBRARY}) -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${STLINK_PACKAGE_VERSION} -VERSION ${STLINK_PACKAGE_VERSION_MAJOR}) + +if (WIN32 OR MSYS OR MINGW) + set(STLINK_SHARED_VERSION + ${STLINK_PACKAGE_VERSION_MAJOR}.${STLINK_PACKAGE_VERSION_MINOR} +else() + set(STLINK_SHARED_VERSION + ${STLINK_PACKAGE_VERSION_MAJOR}.${STLINK_PACKAGE_VERSION_MINOR}.${STLINK_PACKAGE_VERSION_PATCH}) +endif() + +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${STLINK_PACKAGE_VERSION_MAJOR} +VERSION ${STLINK_SHARED_VERSION}) add_library(${PROJECT_NAME}static STATIC ${STLINK_HEADERS} # header files for ide projects generated by cmake