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
ca7a1458
Commit
ca7a1458
authored
10 years ago
by
Ghislain MARY
Browse files
Options
Download
Patches
Plain Diff
Improve build of Python module + add build of wheel package.
parent
33117479
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
+50
-24
configs/python/CMakeLists.txt
configs/python/setup.py.cmake
+22
-4
configs/python/setup.py.cmake
with
72 additions
and
28 deletions
configs/python/CMakeLists.txt
+
50
−
24
View file @
ca7a1458
...
@@ -68,8 +68,9 @@ add_custom_target(api_xml
...
@@ -68,8 +68,9 @@ add_custom_target(api_xml
)
)
# Generate the Python wrapper source code for the API in XML format
# Generate the Python wrapper source code for the API in XML format
add_custom_target
(
pylinphone_source ALL
set
(
SOURCE_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone.c"
)
${
PYTHON_EXECUTABLE
}
"
${
LINPHONE_SOURCE_DIR
}
/tools/python/apixml2python.py"
"--outputfile"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone.c"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/api.xml"
add_custom_target
(
pylinphone_source
${
PYTHON_EXECUTABLE
}
"
${
LINPHONE_SOURCE_DIR
}
/tools/python/apixml2python.py"
"--outputfile"
"
${
SOURCE_FILENAME
}
"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/api.xml"
DEPENDS api_xml
"
${
LINPHONE_SOURCE_DIR
}
/tools/python/apixml2python.py"
"
${
LINPHONE_SOURCE_DIR
}
/tools/python/apixml2python/linphone.py"
DEPENDS api_xml
"
${
LINPHONE_SOURCE_DIR
}
/tools/python/apixml2python.py"
"
${
LINPHONE_SOURCE_DIR
}
/tools/python/apixml2python/linphone.py"
WORKING_DIRECTORY
"
${
LINPHONE_SOURCE_DIR
}
/tools/python"
WORKING_DIRECTORY
"
${
LINPHONE_SOURCE_DIR
}
/tools/python"
)
)
...
@@ -80,21 +81,32 @@ if(WIN32)
...
@@ -80,21 +81,32 @@ if(WIN32)
list
(
APPEND LINPHONE_LIBRARIES gcc mingwex
)
list
(
APPEND LINPHONE_LIBRARIES gcc mingwex
)
file
(
GLOB LINPHONE_DYNAMIC_LIBRARIES
"
${
CMAKE_INSTALL_PREFIX
}
/bin/*.dll"
)
file
(
GLOB LINPHONE_DYNAMIC_LIBRARIES
"
${
CMAKE_INSTALL_PREFIX
}
/bin/*.dll"
)
endif
()
endif
()
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone"
)
set
(
_BUILDS
"exe"
"msi"
"zip"
"wheel"
)
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/__init__.py.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone/__init__.py"
)
if
(
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Debug"
)
file
(
COPY
${
LINPHONE_DYNAMIC_LIBRARIES
}
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone"
)
list
(
PREPEND _BUILDS
"debug"
)
if
(
MSVC AND NOT
"
${
MSVC_VERSION
}
"
STREQUAL
"9"
)
file
(
COPY
${
MSVCR_LIB
}
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone"
)
endif
()
file
(
COPY
"
${
CMAKE_INSTALL_PREFIX
}
/share/images"
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone/share/"
)
file
(
COPY
"
${
CMAKE_INSTALL_PREFIX
}
/share/linphone"
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone/share/"
)
file
(
COPY
"
${
CMAKE_INSTALL_PREFIX
}
/share/sounds"
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone/share/"
)
file
(
GLOB_RECURSE LINPHONE_DATA_FILES RELATIVE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/linphone/*"
)
if
(
MSVC AND
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Debug"
)
set
(
PDB_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build/lib.win32-
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
/linphone/linphone.pdb"
)
list
(
APPEND LINPHONE_DATA_FILES
${
PDB_FILENAME
}
)
endif
()
endif
()
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/setup.py.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py"
)
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"
)
file
(
COPY
${
LINPHONE_DYNAMIC_LIBRARIES
}
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone"
)
if
(
MSVC AND NOT
"
${
MSVC_VERSION
}
"
STREQUAL
"9"
)
file
(
COPY
${
MSVCR_LIB
}
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone"
)
endif
()
file
(
COPY
"
${
CMAKE_INSTALL_PREFIX
}
/share/images"
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone/share/"
)
file
(
COPY
"
${
CMAKE_INSTALL_PREFIX
}
/share/linphone"
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone/share/"
)
file
(
COPY
"
${
CMAKE_INSTALL_PREFIX
}
/share/sounds"
DESTINATION
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone/share/"
)
file
(
GLOB_RECURSE LINPHONE_DATA_FILES RELATIVE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/linphone/*"
)
if
(
MSVC
AND
(
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Debug"
)
AND
(
NOT
"
${
_BUILD
}
"
STREQUAL
"debug"
))
set
(
PDB_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_debug/build/lib.win32-
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
/linphone/linphone.pdb"
)
list
(
APPEND LINPHONE_DATA_FILES
${
PDB_FILENAME
}
)
endif
()
if
(
"
${
_BUILD
}
"
STREQUAL
"msi"
)
set
(
BUILD_VERSION
${
LINPHONE_VERSION
}
)
else
()
set
(
BUILD_VERSION
${
LINPHONE_GIT_REVISION
}
)
endif
()
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/setup.py.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_
${
_BUILD
}
/linphone/setup.py"
)
endforeach
()
if
(
MSVC
)
if
(
MSVC
)
...
@@ -106,32 +118,46 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
...
@@ -106,32 +118,46 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
add_custom_target
(
pylinphone_debug ALL
add_custom_target
(
pylinphone_debug ALL
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py"
"build"
"--debug"
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py"
"build"
"--debug"
DEPENDS pylinphone_source
DEPENDS pylinphone_source
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_debug/linphone"
)
)
else
()
else
()
add_custom_target
(
pylinphone_debug ALL DEPENDS pylinphone_source
)
add_custom_target
(
pylinphone_debug ALL DEPENDS pylinphone_source
)
endif
()
endif
()
# Generate the installer
# Generate the installer
set
(
EXE_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dist/linphone-
${
LINPHONE_
VER
SION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.exe"
)
set
(
EXE_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
build_exe/linphone/
dist/linphone-
${
LINPHONE_
GIT_REVI
SION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.exe"
)
add_custom_target
(
pylinphone_exe ALL
add_custom_target
(
pylinphone_exe ALL
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py"
"bdist_wininst"
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
build_exe/linphone/
setup.py"
"bdist_wininst"
DEPENDS pylinphone_debug
DEPENDS pylinphone_debug
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_exe/linphone"
)
)
install
(
FILES
${
EXE_FILENAME
}
DESTINATION
"."
RENAME
"linphone-
${
LINPHONE_GIT_REVISION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.exe"
)
install
(
FILES
${
EXE_FILENAME
}
DESTINATION
"."
)
# Generate the msi
# Generate the msi
set
(
MSI_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dist/linphone-
${
LINPHONE_VERSION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.msi"
)
set
(
MSI_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
build_msi/linphone/
dist/linphone-
${
LINPHONE_VERSION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.msi"
)
add_custom_target
(
pylinphone_msi ALL
add_custom_target
(
pylinphone_msi ALL
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py"
"bdist_msi"
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
build_msi/linphone/
setup.py"
"bdist_msi"
DEPENDS pylinphone_exe
DEPENDS pylinphone_exe
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_msi/linphone"
)
)
install
(
FILES
${
MSI_FILENAME
}
DESTINATION
"."
RENAME
"linphone-
${
LINPHONE_GIT_REVISION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.msi"
)
install
(
FILES
${
MSI_FILENAME
}
DESTINATION
"."
)
# Generate the zip
# Generate the zip
set
(
ZIP_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dist/linphone-
${
LINPHONE_
VER
SION
}
.win32.zip"
)
set
(
ZIP_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
build_zip/linphone/
dist/linphone-
${
LINPHONE_
GIT_REVI
SION
}
.win32.zip"
)
add_custom_target
(
pylinphone_zip ALL
add_custom_target
(
pylinphone_zip ALL
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/setup.py"
"bdist"
"--format=zip"
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
build_zip/linphone/
setup.py"
"bdist"
"--format=zip"
DEPENDS pylinphone_msi
DEPENDS pylinphone_msi
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_zip/linphone"
)
)
install
(
FILES
${
ZIP_FILENAME
}
DESTINATION
"."
RENAME
"linphone-
${
LINPHONE_GIT_REVISION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.zip"
)
install
(
FILES
${
ZIP_FILENAME
}
DESTINATION
"."
RENAME
"linphone-
${
LINPHONE_GIT_REVISION
}
.win32-py
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
.zip"
)
# Generate the wheel package
string
(
REPLACE
"-"
"_"
LINPHONE_UNDERSCORE_GIT_REVISION
${
LINPHONE_GIT_REVISION
}
)
set
(
WHEEL_FILENAME
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_wheel/linphone/dist/linphone-
${
LINPHONE_UNDERSCORE_GIT_REVISION
}
-cp27-none-win32.whl"
)
add_custom_target
(
pylinphone_wheel ALL
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_wheel/linphone/setup.py"
"bdist_wheel"
DEPENDS pylinphone_zip
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/build_wheel/linphone"
)
install
(
FILES
${
WHEEL_FILENAME
}
DESTINATION
"."
)
endif
()
endif
()
This diff is collapsed.
Click to expand it.
configs/python/setup.py.cmake
+
22
−
4
View file @
ca7a1458
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
import os
import os
import string
import string
from
distutils.core
import setup, Extension
from
setuptools
import setup, Extension
version =
"@
LINPHONE
_VERSION@"
version =
"@
BUILD
_VERSION@"
macros =
"@LINPHONE_CPPFLAGS@"
macros =
"@LINPHONE_CPPFLAGS@"
include_dirs =
"@LINPHONE_INCLUDE_DIRS@"
include_dirs =
"@LINPHONE_INCLUDE_DIRS@"
libraries =
"@LINPHONE_LIBRARIES@"
libraries =
"@LINPHONE_LIBRARIES@"
...
@@ -45,15 +45,33 @@ ext = Extension('linphone',
...
@@ -45,15 +45,33 @@ ext = Extension('linphone',
include_dirs = include_dirs,
include_dirs = include_dirs,
libraries = libraries,
libraries = libraries,
library_dirs = library_dirs,
library_dirs = library_dirs,
sources = ['
linphone.c
']
sources = ['
@SOURCE_FILENAME@
']
)
)
setup
(
name = 'linphone',
setup
(
name = 'linphone',
version = version,
version = version,
description = 'Linphone package for Python',
description = 'Linphone package for Python',
author =
"Belledonne Communications"
,
author =
"Belledonne Communications"
,
author_email =
"contact@belledonne-communications.com"
,
url =
"http://www.linphone.org/"
,
url =
"http://www.linphone.org/"
,
packages = ['linphone'],
packages = ['linphone'],
ext_package = 'linphone',
ext_package = 'linphone',
ext_modules = [ext],
ext_modules = [ext],
package_data = {'linphone': data_files}
package_data = {'linphone': data_files},
zip_safe = True,
keywords = [
"sip"
,
"voip"
],
classifiers = [
"Development Status :: 4 - Beta"
,
"Environment :: Win32 (MS Windows)"
,
"Intended Audience :: Developers"
,
"Intended Audience :: Telecommunications Industry"
,
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)"
,
"Natural Language :: English"
,
"Operating System :: Microsoft :: Windows"
,
"Programming Language :: C"
,
"Programming Language :: C++"
,
"Programming Language :: Python :: 2.7"
,
"Topic :: Communications :: Chat"
,
"Topic :: Communications :: Internet Phone"
,
"Topic :: Communications :: Telephony"
]
)
)
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