Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add soname/soversion in Unix libs #143

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
# "Visual Studio 16 2019" + LLVM 8.0 (clang) optional platform generator Win32 and x64
CMAKE_MINIMUM_REQUIRED( VERSION 3.8.2 )

# Get PROJECT_VERSION property from 'avs_core/core/version.h.in'
file(READ "avs_core/core/version.h.in" versioning)
string(REGEX MATCH "AVS_MAJOR_VER ([0-9]*)" _ ${versioning})
set(version_major ${CMAKE_MATCH_1})
string(REGEX MATCH "AVS_MINOR_VER ([0-9]*)" _ ${versioning})
set(version_minor ${CMAKE_MATCH_1})
string(REGEX MATCH "AVS_BUGFIX_VER ([0-9]*)" _ ${versioning})
set(version_bugfix ${CMAKE_MATCH_1})
# Get AVISYNTH_INTERFACE_VERSION from avs_core/include/avisynth.h
file(READ "avs_core/include/avisynth.h" versioning)
string(REGEX MATCH "AVISYNTH_INTERFACE_VERSION = ([0-9]*)" _ ${versioning})
set(AVISYNTH_INTERFACE_VERSION ${CMAKE_MATCH_1})

option(HEADERS_ONLY "Install only the Headers" ${INSTALL_ONLY_HEADER})
if(${INSTALL_ONLY_HEADER})
set(INSTALL_ONLY_HEADER OFF)
Expand All @@ -18,7 +31,7 @@ include(GNUInstallDirs)

if(NOT HEADERS_ONLY)

project("AviSynth+")
project("AviSynth+" VERSION ${version_major}.${version_minor}.${version_bugfix} LANGUAGES CXX)

# Avoid uselessly linking to unused libraries
set(CMAKE_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
Expand Down Expand Up @@ -195,7 +208,7 @@ if(NOT HEADERS_ONLY)

else()

project(AviSynth-Headers NONE)
project(AviSynth-Headers VERSION ${version_major}.${version_minor}.${version_bugfix} LANGUAGES)
message(STATUS "Install Only Headers: ON")

add_library(${PROJECT_NAME} INTERFACE)
Expand Down
12 changes: 3 additions & 9 deletions avs_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ else()
endif()

# Create library
project("AvsCore")
project("AvsCore" VERSION "${PROJECT_VERSION}" LANGUAGES CXX)
Include("Files.cmake")
add_library("AvsCore" SHARED ${AvsCore_Sources})
set_target_properties("AvsCore" PROPERTIES "OUTPUT_NAME" "${CoreName}")
if (MINGW)
set_target_properties("AvsCore" PROPERTIES PREFIX "")
set_target_properties("AvsCore" PROPERTIES IMPORT_PREFIX "")
elseif(UNIX)
set_target_properties("AvsCore" PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${AVISYNTH_INTERFACE_VERSION})
endif()

# Automatically group source files according to directory structure
Expand Down Expand Up @@ -138,14 +140,6 @@ ADD_CUSTOM_TARGET(
ADD_DEPENDENCIES("AvsCore" VersionGen)

# Generate pkg-config file
file(READ "core/version.h.in" versioning)
string(REGEX MATCH "AVS_MAJOR_VER ([0-9]*)" _ ${versioning})
set(version_major ${CMAKE_MATCH_1})
string(REGEX MATCH "AVS_MINOR_VER ([0-9]*)" _ ${versioning})
set(version_minor ${CMAKE_MATCH_1})
string(REGEX MATCH "AVS_BUGFIX_VER ([0-9]*)" _ ${versioning})
set(version_bugfix ${CMAKE_MATCH_1})
set(AVS_VERSION "${version_major}.${version_minor}.${version_bugfix}")
get_target_property(LIB_NAME AvsCore OUTPUT_NAME)
set(LIBS "-l${LIB_NAME}")
CONFIGURE_FILE("avisynth.pc.in" "avisynth.pc" @ONLY)
Expand Down
2 changes: 1 addition & 1 deletion avs_core/avisynth.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ includedir=${exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@/avisynth

Name: AviSynth+
Description: A powerful nonlinear scripting language for video.
Version: @AVS_VERSION@
Version: @PROJECT_VERSION@

Libs: -L${libdir} @LIBS@
Cflags: -I${includedir}
2 changes: 1 addition & 1 deletion plugins/ConvertStacked/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (NOT WIN32)
endif()

# Create library
project(${ProjectName})
project(${ProjectName} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
list (APPEND SourceFiles
"ConvertStacked.cpp"
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/DirectShowSource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(DSHOWSRC_BASECLASSES_PATH "${DEFAULT_BASECLASSES_PATH}" CACHE STRING "Fold
set(DSHOWSRC_BASECLASSES_LIB "${DEFAULT_BASECLASSES_LIB}" CACHE FILEPATH "File path to the DirectShow example baseclasses precompiled static library ('strmbase.lib').")

# Create library
project(${ProjectName})
project(${ProjectName} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
list (APPEND SourceFiles
"directshow_source.cpp"
"directshow_source.h"
Expand Down
2 changes: 1 addition & 1 deletion plugins/ImageSeq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (NOT WIN32)
endif()

# Create library
project(${ProjectName})
project(${ProjectName} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
list (APPEND SourceFiles
"ImageSeq.cpp"
"ImageSeq.h"
Expand Down
2 changes: 1 addition & 1 deletion plugins/Shibatch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (NOT WIN32)
endif()

# Create library
project(${ProjectName})
project(${ProjectName} VERSION ${PROJECT_VERSION} LANGUAGES C)
list (APPEND SourceFiles
"dbesi0.c"
"fft.h"
Expand Down
2 changes: 1 addition & 1 deletion plugins/TimeStretch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (NOT WIN32)
endif()

# Create library
project(${ProjectName})
project(${ProjectName} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
list (APPEND SourceFiles
"TimeStretch.cpp"
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/VDubFilter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(PluginName "VDubFilter")
set(ProjectName "Plugin${PluginName}")

# Create library
project(${ProjectName})
project(${ProjectName} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
list (APPEND SourceFiles
"VDubFilter.cpp"
"GetCPUFlags.cpp"
Expand Down
2 changes: 1 addition & 1 deletion plugins/VFAPIFilter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(DSHOWSRC_BASECLASSES_LIB CACHE FILEPATH "File path to the DirectShow example
set(DSHOWSRC_DX_INCLUDE_PATH "C:/Program Files/Microsoft DirectX SDK (August 2009)/Include" CACHE STRING "Include folder path to the DirectX headers.")

# Create library
project(${ProjectName})
project(${ProjectName} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
list (APPEND SourceFiles
"VFAPIFilter.cpp"
)
Expand Down