mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-15 07:01:18 +02:00
Updates the way shared libraries are hadled
1. We put all shared libraries into one place. Both conan and locally built 2. We invoke CopyLibs to copy the libraries to a proper location and to correctly set the RPATH Fixes CopyLibs script on Windows Fixes CopyLibs.cmake for Linux Fixes CopyLibs on macOS Fixes CopyLibs on macOS
This commit is contained in:
committed by
Dmitry Vedenko
parent
77cc7bed6f
commit
4e6a1a81a9
@@ -199,10 +199,10 @@ function ( _conan_install build_type )
|
||||
GENERATORS cmake_find_package_multi
|
||||
BUILD_REQUIRES ${CONAN_BUILD_REQUIRES}
|
||||
${CONAN_CONFIG_OPTIONS}
|
||||
IMPORTS "bin, *.dll -> ./bin/shared/${build_type} @ keep_path=False"
|
||||
IMPORTS "lib, *.dll -> ./bin/shared/${build_type} @ keep_path=False"
|
||||
IMPORTS "lib, *.dylib -> ./lib/shared/${build_type} @ keep_path=False"
|
||||
IMPORTS "lib, *.so* -> ./lib/shared/${build_type} @ keep_path=False"
|
||||
IMPORTS "bin, *.dll -> ./${_SHARED_PROXY_BASE}/${build_type} @ keep_path=False"
|
||||
IMPORTS "lib, *.dll -> ./${_SHARED_PROXY_BASE}/${build_type} @ keep_path=False"
|
||||
IMPORTS "lib, *.dylib -> ./${_SHARED_PROXY_BASE}/${build_type} @ keep_path=False"
|
||||
IMPORTS "lib, *.so* -> ./${_SHARED_PROXY_BASE}/${build_type} @ keep_path=False"
|
||||
OPTIONS ${CONAN_PACKAGE_OPTIONS}
|
||||
)
|
||||
|
||||
|
@@ -348,7 +348,7 @@ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
|
||||
)
|
||||
else()
|
||||
set( ATTRIBUTES "shape=octagon" )
|
||||
set_target_property_all( ${TARGET} ${DIRECTORY_PROPERTY} "${_EXEDIR}" )
|
||||
set_target_property_all( ${TARGET} ${DIRECTORY_PROPERTY} "${_SHARED_PROXY_PATH}" )
|
||||
set_target_properties( ${TARGET}
|
||||
PROPERTIES
|
||||
PREFIX ""
|
||||
@@ -379,7 +379,7 @@ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
|
||||
foreach( IMPORT ${IMPORT_TARGETS} )
|
||||
list( APPEND LIBRARIES "${IMPORT}" )
|
||||
endforeach()
|
||||
|
||||
|
||||
list( APPEND LIBRARIES ${ADDITIONAL_LIBRARIES} )
|
||||
|
||||
# list( TRANSFORM SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/" )
|
||||
|
@@ -45,6 +45,8 @@ function( gather_libs src )
|
||||
list( APPEND libs ${lib} )
|
||||
|
||||
gather_libs( ${lib} )
|
||||
elseif ( EXISTS "${DST}/${line}" )
|
||||
gather_libs( "${DST}/${line}" )
|
||||
endif()
|
||||
endforeach()
|
||||
elseif( CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" )
|
||||
@@ -57,7 +59,11 @@ function( gather_libs src )
|
||||
foreach( line ${output} )
|
||||
if( line MATCHES "^.*\\.dylib " )
|
||||
string( REGEX REPLACE "dylib .*" "dylib" line "${line}" )
|
||||
set( lib "${WXWIN}/${line}" )
|
||||
|
||||
get_filename_component( dylib_name "${line}" NAME)
|
||||
|
||||
message(STATUS "Checking out ${line}")
|
||||
set( lib "${WXWIN}/${dylib_name}" )
|
||||
|
||||
if( NOT lib STREQUAL "${src}" AND NOT line MATCHES "@executable" AND EXISTS "${lib}")
|
||||
message(STATUS "\tProcessing ${lib}...")
|
||||
@@ -68,7 +74,7 @@ function( gather_libs src )
|
||||
|
||||
message(STATUS "\t\tAdding ${refname} to ${src}")
|
||||
|
||||
list( APPEND postcmds "sh -c 'install_name_tool -change ${refname} @executable_path/../Frameworks/${refname} ${src}'" )
|
||||
list( APPEND postcmds "sh -c 'install_name_tool -change ${line} @executable_path/../Frameworks/${refname} ${src}'" )
|
||||
|
||||
gather_libs( ${lib} )
|
||||
endif()
|
||||
@@ -82,10 +88,10 @@ function( gather_libs src )
|
||||
get_filename_component( libname "${src}" NAME )
|
||||
|
||||
foreach( line ${output} )
|
||||
message (STATUS "\tChecking ${line}...")
|
||||
|
||||
string( REGEX REPLACE "(.*) => .* \\(.*$" "\\1" line "${line}" )
|
||||
|
||||
message (STATUS "\tChecking ${line}...")
|
||||
|
||||
set(line "${WXWIN}/${line}")
|
||||
|
||||
if (EXISTS "${line}")
|
||||
|
Reference in New Issue
Block a user