Set VERSION and SOVERSION for all targets as appropriate (#676)

Set VERSION property for non-static library targets and executable targets, and set
SOVERSION for non-MSVC targets.
This commit is contained in:
RichardTea 2021-02-03 21:57:22 +00:00 committed by GitHub
parent 8f9ebcdb9f
commit 3ea441ec1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -889,9 +889,6 @@ else()
# For Mac, we need to build a .bundle for the unity plugin.
if(APPLE)
set_target_properties(dracodec_unity PROPERTIES BUNDLE true)
elseif(NOT unity_decoder_lib_type STREQUAL STATIC)
set_target_properties(dracodec_unity
PROPERTIES SOVERSION ${DRACO_SOVERSION})
endif()
endif()
@ -916,9 +913,6 @@ else()
# For Mac, we need to build a .bundle for the plugin.
if(APPLE)
set_target_properties(draco_maya_wrapper PROPERTIES BUNDLE true)
else()
set_target_properties(draco_maya_wrapper
PROPERTIES SOVERSION ${DRACO_SOVERSION})
endif()
endif()

View File

@ -87,6 +87,7 @@ macro(draco_add_executable)
endif()
add_executable(${exe_NAME} ${exe_SOURCES})
set_target_properties(${exe_NAME} PROPERTIES VERSION ${DRACO_VERSION})
if(exe_OUTPUT_NAME)
set_target_properties(${exe_NAME} PROPERTIES OUTPUT_NAME ${exe_OUTPUT_NAME})
@ -318,8 +319,12 @@ macro(draco_add_library)
set_target_properties(${lib_NAME} PROPERTIES PREFIX "")
endif()
if(lib_TYPE STREQUAL SHARED AND NOT MSVC)
set_target_properties(${lib_NAME} PROPERTIES SOVERSION ${DRACO_SOVERSION})
# VERSION and SOVERSION as necessary
if(NOT lib_TYPE STREQUAL STATIC)
set_target_properties(${lib_NAME} PROPERTIES VERSION ${DRACO_VERSION})
if(NOT MSVC)
set_target_properties(${lib_NAME} PROPERTIES SOVERSION ${DRACO_SOVERSION})
endif()
endif()
if(BUILD_SHARED_LIBS AND (MSVC OR WIN32))