build: libopencv_* -> libopencv5_*, update SOVERSION

This commit is contained in:
Alexander Alekhin 2022-01-04 14:10:48 +00:00
parent 2c2d7774b9
commit 4d3c14421f
2 changed files with 11 additions and 8 deletions

View File

@ -924,6 +924,11 @@ macro(_ocv_create_module)
get_native_precompiled_header(${the_module} precomp.hpp)
endif()
string(REGEX REPLACE "^opencv_" "opencv${OPENCV_VERSION_MAJOR}_" the_module_output_name "${the_module}")
if(OPENCV_DLLVERSION)
set(the_module_output_name "${the_module_output_name}${OPENCV_DLLVERSION}")
endif()
if(WIN32
AND (BUILD_SHARED_LIBS AND NOT "x${OPENCV_MODULE_TYPE}" STREQUAL "xSTATIC")
AND NOT OPENCV_VS_VERSIONINFO_SKIP)
@ -936,8 +941,8 @@ macro(_ocv_create_module)
ocv_generate_vs_version_file("${_VS_VERSION_FILE}"
NAME "${the_module}"
FILEDESCRIPTION "OpenCV module: ${OPENCV_MODULE_${the_module}_DESCRIPTION}"
INTERNALNAME "${the_module}${OPENCV_DLLVERSION}"
ORIGINALFILENAME "${the_module}${OPENCV_DLLVERSION}.dll"
INTERNALNAME "${the_module_output_name}"
ORIGINALFILENAME "${the_module_output_name}.dll"
)
endif()
if(_VS_VERSION_FILE)
@ -996,10 +1001,10 @@ macro(_ocv_create_module)
endif()
set_target_properties(${the_module} PROPERTIES
OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}"
OUTPUT_NAME "${the_module_output_name}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME "${the_module}${OPENCV_DLLVERSION}"
COMPILE_PDB_NAME_DEBUG "${the_module}${OPENCV_DLLVERSION}${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME "${the_module_output_name}"
COMPILE_PDB_NAME_DEBUG "${the_module_output_name}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
COMPILE_PDB_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}

View File

@ -10,9 +10,7 @@ set(OPENCV_VERSION_PLAIN "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPEN
set(OPENCV_VERSION "${OPENCV_VERSION_PLAIN}${OPENCV_VERSION_STATUS}")
string(REGEX MATCH "[0-9][0-9]$" OPENCV_VERSION_MINOR_2DIGITS "00${OPENCV_VERSION_MINOR}")
string(REGEX MATCH "[0-9][0-9]$" OPENCV_VERSION_PATCH_2DIGITS "00${OPENCV_VERSION_PATCH}")
ocv_update(OPENCV_SOVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR_2DIGITS}")
ocv_update(OPENCV_SOVERSION "${OPENCV_VERSION_MINOR}")
ocv_update(OPENCV_LIBVERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
# create a dependency on the version file