Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
linphone-cmake-builder
Commits
3e140f9a
Commit
3e140f9a
authored
10 years ago
by
Ghislain MARY
Browse files
Options
Download
Patches
Plain Diff
Some changes to build the Python module on Mac OS X.
parent
4b2f6a77
master
android_3.3.1
android_strip
build_soci
desktop-3.10.x
desktop-3.8.x
desktop-3.9.x
desktop_cmake_rework
dev_android_aaudio
dev_bb10
dev_bctoolbox_rpm
dev_codec_downloader
dev_codecbv16
dev_screensharing
dev_windows10
external_auth_plugin_option
feature/android_ndk_r23b
feature/av1-support
feature/enable_wrapper_swift
feature/flexisip-video-conf
feature/make_bellesip_framework
feature/python_wrapper
feature/python_wrapper_5.1
feature/python_wrapper_5.3
feature/remove-no-longer-supported-i386-arch-for-ios
feature/sfu-audio-conf
feature/video_conf_mix_master
feature/videoconf
feature/yocto-kirkstone
features/sysconf_install_dir_for_prepare
fix/build-of-ffmpeg-for-android
fix/build_flexisip_macosx
fix/build_master
fix/change_linphone_submodule_name
fix/cmake_build
fix/flexisip
fix/hot_fix_release_4.2
fix/ice-dtls-turn-4.5
fix/improve_macosx_toolchain_detection
fix/mac_android
fix/mediadir
fix/nightly_builds
fix/openh264_static_build
fix/openh264_x86_64
fix/version_check
fix_belr
ios-3.13.19
private-master
release/4.3
release/4.4
release/4.5
release/5.0
release/5.1
release/5.2
releases/linphone-android/3.4.x
releases/linphone-android/4.0
rework
tests/build_windows
tmp/pq
5.2.19
5.2.10
5.2.3
5.2.1
5.2.0-beta
5.1.0
5.0.48
5.0.3
5.0.0-alpha
4.5.0
4.5.0-alpha
4.4.0
4.4.0-alpha
4.3.2
4.3.1
4.3.0
desktop-3.10.0
desktop-3.9.0
desktop-3.8.5
desktop-3.8.4
desktop-3.8.3
desktop-3.8.2
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configs/python/CMakeLists.txt
+38
-10
configs/python/CMakeLists.txt
configs/python/setup.py.cmake
+21
-11
configs/python/setup.py.cmake
with
59 additions
and
21 deletions
configs/python/CMakeLists.txt
+
38
−
10
View file @
3e140f9a
...
...
@@ -92,22 +92,50 @@ if(WIN32)
file
(
GLOB LINPHONE_DYNAMIC_LIBRARIES
"
${
CMAKE_INSTALL_PREFIX
}
/bin/*.dll"
)
list
(
APPEND _BUILDS
"exe"
"msi"
"zip"
"wheel"
)
endif
()
if
(
UNIX AND NOT APPLE
)
set
(
LINPHONE_DYNAMIC_LIBRARIES
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libavcodec.so.53"
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libavutil.so.51"
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libswscale.so.2"
)
if
(
UNIX
)
set
(
LINPHONE_STATIC_LIBRARIES
)
set
(
LINPHONE_DYNAMIC_LIBRARIES
)
foreach
(
lib
${
LINPHONE_LIBRARIES
}
)
if
(
${
lib
}
MATCHES
"
\\
.a$"
)
list
(
APPEND LINPHONE_STATIC_LIBRARIES
${
lib
}
)
else
()
list
(
APPEND LINPHONE_DYNAMIC_LIBRARIES
${
lib
}
)
endif
()
endforeach
()
find_program
(
LORDER_EXECUTABLE lorder
)
if
(
NOT LORDER_EXECUTABLE
)
message
(
FATAL_ERROR
"lorder executable is needed."
)
endif
()
find_program
(
TSORT_EXECUTABLE tsort
)
if
(
NOT TSORT_EXECUTABLE
)
message
(
FATAL_ERROR
"tsort executable is needed."
)
endif
()
execute_process
(
COMMAND
${
LORDER_EXECUTABLE
}
${
LINPHONE_STATIC_LIBRARIES
}
OUTPUT_FILE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/lorder.out"
)
execute_process
(
COMMAND
${
TSORT_EXECUTABLE
}
OUTPUT_VARIABLE LINPHONE_STATIC_LIBRARIES INPUT_FILE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/lorder.out"
)
separate_arguments
(
LINPHONE_STATIC_LIBRARIES UNIX_COMMAND
"
${
LINPHONE_STATIC_LIBRARIES
}
"
)
if
(
APPLE
)
set
(
LINPHONE_DYNAMIC_LIBRARIES_TO_INSTALL
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libavcodec.53.61.100.dylib"
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libavutil.51.35.100.dylib"
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libswscale.2.1.100.dylib"
)
else
()
set
(
LINPHONE_DYNAMIC_LIBRARIES_TO_INSTALL
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libavcodec.so.53.61.100"
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libavutil.so.51.35.100"
"
${
CMAKE_INSTALL_PREFIX
}
/lib/libswscale.so.2.1.100"
)
endif
()
list
(
APPEND _BUILDS
"zip"
"wheel"
)
endif
()
foreach
(
_BUILD
${
_BUILDS
}
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone"
)
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/__init__.py.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone/__init__.py"
)
if
(
UNIX AND NOT APPLE
)
foreach
(
lib
${
LINPHONE_DYNAMIC_LIBRARIES
}
)
get_filename_component
(
libname
${
lib
}
NAME
)
file
(
GLOB reallib
"
${
lib
}
.*"
)
if
(
UNIX
)
foreach
(
reallib
${
LINPHONE_DYNAMIC_LIBRARIES_TO_INSTALL
}
)
get_filename_component
(
libpath
${
reallib
}
DIRECTORY
)
get_filename_component
(
reallibname
${
reallib
}
NAME
)
string
(
REGEX REPLACE
"([0-9]+)
\\
.[0-9]+
\\
.[0-9]+"
"
\\
1"
libname
${
reallibname
}
)
file
(
COPY
${
reallib
}
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone"
)
file
(
RENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone/
${
reallibname
}
"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone/
${
libname
}
"
)
endforeach
()
...
...
This diff is collapsed.
Click to expand it.
configs/python/setup.py.cmake
+
21
−
11
View file @
3e140f9a
...
...
@@ -17,6 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os
import re
import string
import sys
from setuptools import setup, Extension
...
...
@@ -28,6 +29,8 @@ version = "@BUILD_VERSION@"
macros =
"@LINPHONE_CPPFLAGS@"
include_dirs =
"@LINPHONE_INCLUDE_DIRS@"
libraries =
"@LINPHONE_LIBRARIES@"
static_libraries =
"@LINPHONE_STATIC_LIBRARIES@"
dynamic_libraries =
"@LINPHONE_DYNAMIC_LIBRARIES@"
data_files =
"@LINPHONE_DATA_FILES@"
define_macros = []
...
...
@@ -38,25 +41,32 @@ for macro in macros:
define_macros.
append
((
macro, None
))
include_dirs =
list
(
set
(
include_dirs.
split
(
';'
)))
libraries = libraries.
split
(
';'
)
library_dirs = [os.path.
dirname
(
item
)
for item in libraries if os.path.
dirname
(
item
)
!= '' and os.path.
dirname
(
item
)
!= lib_install_prefix]
if static_libraries != '':
static_libraries = static_libraries.
split
(
';'
)
if dynamic_libraries != '':
dynamic_libraries = dynamic_libraries.
split
(
';'
)
library_dirs = []
for l in [libraries, static_libraries, dynamic_libraries]:
library_dirs += [os.path.
dirname
(
item
)
for item in l if os.path.
dirname
(
item
)
!= '' and os.path.
dirname
(
item
)
!= lib_install_prefix]
library_dirs =
list
(
set
(
library_dirs
))
library_dirs.
insert
(
0, lib_install_prefix
)
libraries = [os.path.
basename
(
item
)
for item in libraries]
static_libraries = [os.path.
basename
(
item
)
for item in static_libraries]
dynamic_libraries = [os.path.
basename
(
item
)
for item in dynamic_libraries]
extra_compile_args = []
extra_link_args = []
if sys.platform.
startswith
(
"win32"
)
:
libraries = [string.
replace
(
item, '.lib', ''
)
for item in libraries]
else:
libraries = [item[3:] for item in libraries]
static_libraries = [item for item in libraries if item.
endswith
(
'.a'
)
]
dynamic_libraries = [item for item in libraries if '.so' in item]
static_libraries = [string.
replace
(
item, '.a', ''
)
for item in static_libraries]
dynamic_libraries = [string.
replace
(
item, '.so', ''
)
for item in dynamic_libraries]
extra_link_args.
append
(
"-Wl,--start-group"
)
extra_link_args += ['-l' + item for item in static_libraries]
extra_link_args.
append
(
"-Wl,--end-group"
)
extra_link_args.
append
(
"-Wl,-rpath=$ORIGIN"
)
libraries = dynamic_libraries
if sys.platform.
startswith
(
"darwin"
)
:
dynext = '.dylib'
else:
dynext = '.so'
static_libraries = [re.
search
(
'
lib
(
\w+
)
.*', item
)
.
group
(
1
)
for item in static_libraries]
dynamic_libraries = [re.
search
(
'
lib
(
\w+
)
.*', item
)
.
group
(
1
)
for item in dynamic_libraries]
if sys.platform.
startswith
(
"linux"
)
:
extra_link_args.
append
(
"-Wl,-rpath=$ORIGIN"
)
libraries = static_libraries + dynamic_libraries
if build_type ==
"Debug"
:
extra_compile_args = [
"-O0"
]
data_files = data_files.
split
(
';'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets