Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
4bcecf25
Commit
4bcecf25
authored
Feb 11, 2016
by
Davis E. King
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77 from jimreesman/master
detect OS X, and query sysconfig for libdir
parents
c9090bfd
0b3cc3c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
setup.py
setup.py
+14
-1
No files found.
setup.py
View file @
4bcecf25
...
...
@@ -37,7 +37,7 @@ from distutils.command.build_ext import build_ext as _build_ext
from
distutils.command.build
import
build
as
_build
from
distutils.errors
import
DistutilsSetupError
from
distutils.spawn
import
find_executable
from
distutils.sysconfig
import
get_python_inc
,
get_python_version
from
distutils.sysconfig
import
get_python_inc
,
get_python_version
,
get_config_var
from
distutils
import
log
import
os
import
sys
...
...
@@ -466,6 +466,19 @@ class build(_build):
if
sys
.
version_info
>=
(
3
,
0
):
cmake_extra_arch
+=
[
'-DPYTHON3=yes'
]
log
.
info
(
"Detected platform:
%
s"
%
sys
.
platform
)
if
sys
.
platform
==
"darwin"
:
# build on OS X
inc_dir
=
get_python_inc
()
cmake_extra_arch
+=
[
'-DPYTHON_INCLUDE_DIR={inc}'
.
format
(
inc
=
inc_dir
)]
# by default, cmake will choose the system python lib in /usr/lib
# this checks the sysconfig and will correctly pick up a brewed python lib
# e.g. in /usr/local/Cellar
py_ver
=
get_python_version
()
py_lib
=
os
.
path
.
join
(
get_config_var
(
'LIBDIR'
),
'libpython'
+
py_ver
+
'.dylib'
)
cmake_extra_arch
+=
[
'-DPYTHON_LIBRARY={lib}'
.
format
(
lib
=
py_lib
)]
if
platform_arch
==
'64bit'
and
sys
.
platform
==
"win32"
:
# 64bit build on Windows
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment