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
ad88bbe8
Commit
ad88bbe8
authored
Mar 10, 2018
by
Kagami Hiiragi
Committed by
Davis E. King
Mar 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to set arbitrary cmake opts from setup.py (#1189)
Fixes #1188
parent
881ce174
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
setup.py
setup.py
+5
-2
No files found.
setup.py
View file @
ad88bbe8
...
...
@@ -26,6 +26,7 @@ Additional options:
--clean: delete any previous build folders and rebuild. You should do this if you change any build options
by setting --compiler-flags or --yes or --no since last time you ran a build to make sure the changes
take effect.
--set: set arbitrary options e.g. --set CUDA_HOST_COMPILER=/usr/bin/gcc-6.4.0
"""
import
os
import
re
...
...
@@ -43,7 +44,7 @@ from distutils.version import LooseVersion
def
get_extra_cmake_options
():
"""read --clean, --yes, --no, --compiler-flags, and -G options from the command line and add them as cmake switches.
"""read --clean, --yes, --no, --
set, --
compiler-flags, and -G options from the command line and add them as cmake switches.
"""
_cmake_extra_options
=
[]
_clean_build_folder
=
False
...
...
@@ -61,6 +62,8 @@ def get_extra_cmake_options():
_cmake_extra_options
.
append
(
'-D{arg}=yes'
.
format
(
arg
=
arg
.
strip
()))
elif
opt_key
==
'no'
:
_cmake_extra_options
.
append
(
'-D{arg}=no'
.
format
(
arg
=
arg
.
strip
()))
elif
opt_key
==
'set'
:
_cmake_extra_options
.
append
(
'-D{arg}'
.
format
(
arg
=
arg
.
strip
()))
if
opt_key
:
sys
.
argv
.
remove
(
arg
)
...
...
@@ -72,7 +75,7 @@ def get_extra_cmake_options():
sys
.
argv
.
remove
(
arg
)
continue
if
arg
in
[
'--yes'
,
'--no'
,
'--compiler-flags'
]:
if
arg
in
[
'--yes'
,
'--no'
,
'--
set'
,
'--
compiler-flags'
]:
opt_key
=
arg
[
2
:]
.
lower
()
sys
.
argv
.
remove
(
arg
)
continue
...
...
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