Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
087f9f17
Commit
087f9f17
authored
Jun 09, 2016
by
Davis E. King
Committed by
GitHub
Jun 09, 2016
Browse files
Merge pull request #133 from AbdealiJK/ajk/setup
setup.py: Provide instructions to install cmake
parents
24efbdbc
faff10f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
setup.py
setup.py
+36
-1
No files found.
setup.py
View file @
087f9f17
...
@@ -456,7 +456,42 @@ class build(_build):
...
@@ -456,7 +456,42 @@ class build(_build):
"""use cmake to build and install the extension
"""use cmake to build and install the extension
"""
"""
if
cmake_path
is
None
:
if
cmake_path
is
None
:
raise
DistutilsSetupError
(
"Cannot find cmake in the path. Please specify its path with --cmake parameter."
)
cmake_install_url
=
"https://cmake.org/install/"
message
=
(
"You can install cmake using the instructions at "
+
cmake_install_url
)
msg_pkgmanager
=
(
"You can install cmake on {0} using "
"`sudo {1} install cmake`."
)
if
sys
.
platform
==
"darwin"
:
pkgmanagers
=
(
'brew'
,
'port'
)
for
manager
in
pkgmanagers
:
if
find_executable
(
manager
)
is
not
None
:
message
=
msg_pkgmanager
.
format
(
'OSX'
,
manager
)
break
elif
sys
.
platform
.
startswith
(
'linux'
):
distname
=
None
try
:
import
distro
except
ImportError
:
import
pip
pip_exit
=
pip
.
main
([
'install'
,
'distro'
])
if
pip_exit
>
0
:
raise
SystemExit
(
'Pip was unable to install `distro`'
)
import
distro
distname
=
distro
.
id
()
if
distname
in
(
'debian'
,
'ubuntu'
):
message
=
msg_pkgmanager
.
format
(
distname
.
title
(),
'apt-get'
)
elif
distname
in
(
'fedora'
,
'centos'
,
'redhat'
):
pkgmanagers
=
(
"dnf"
,
"yum"
)
for
manager
in
pkgmanagers
:
if
find_executable
(
manager
)
is
not
None
:
message
=
msg_pkgmanager
.
format
(
distname
.
title
(),
manager
)
break
raise
DistutilsSetupError
(
"Cannot find cmake, ensure it is installed and in the path.
\n
"
+
message
+
"
\n
"
"You can also specify its path with --cmake parameter."
)
platform_arch
=
platform
.
architecture
()[
0
]
platform_arch
=
platform
.
architecture
()[
0
]
log
.
info
(
"Detected Python architecture: %s"
%
platform_arch
)
log
.
info
(
"Detected Python architecture: %s"
%
platform_arch
)
...
...
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