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
ad88bbe8
Commit
ad88bbe8
authored
Mar 10, 2018
by
Kagami Hiiragi
Committed by
Davis E. King
Mar 09, 2018
Browse files
Allow to set arbitrary cmake opts from setup.py (#1189)
Fixes #1188
parent
881ce174
Changes
1
Show 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:
...
@@ -26,6 +26,7 @@ Additional options:
--clean: delete any previous build folders and rebuild. You should do this if you change any build 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
by setting --compiler-flags or --yes or --no since last time you ran a build to make sure the changes
take effect.
take effect.
--set: set arbitrary options e.g. --set CUDA_HOST_COMPILER=/usr/bin/gcc-6.4.0
"""
"""
import
os
import
os
import
re
import
re
...
@@ -43,7 +44,7 @@ from distutils.version import LooseVersion
...
@@ -43,7 +44,7 @@ from distutils.version import LooseVersion
def
get_extra_cmake_options
():
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
=
[]
_cmake_extra_options
=
[]
_clean_build_folder
=
False
_clean_build_folder
=
False
...
@@ -61,6 +62,8 @@ def get_extra_cmake_options():
...
@@ -61,6 +62,8 @@ def get_extra_cmake_options():
_cmake_extra_options
.
append
(
'-D{arg}=yes'
.
format
(
arg
=
arg
.
strip
()))
_cmake_extra_options
.
append
(
'-D{arg}=yes'
.
format
(
arg
=
arg
.
strip
()))
elif
opt_key
==
'no'
:
elif
opt_key
==
'no'
:
_cmake_extra_options
.
append
(
'-D{arg}=no'
.
format
(
arg
=
arg
.
strip
()))
_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
:
if
opt_key
:
sys
.
argv
.
remove
(
arg
)
sys
.
argv
.
remove
(
arg
)
...
@@ -72,7 +75,7 @@ def get_extra_cmake_options():
...
@@ -72,7 +75,7 @@ def get_extra_cmake_options():
sys
.
argv
.
remove
(
arg
)
sys
.
argv
.
remove
(
arg
)
continue
continue
if
arg
in
[
'--yes'
,
'--no'
,
'--compiler-flags'
]:
if
arg
in
[
'--yes'
,
'--no'
,
'--set'
,
'--compiler-flags'
]:
opt_key
=
arg
[
2
:].
lower
()
opt_key
=
arg
[
2
:].
lower
()
sys
.
argv
.
remove
(
arg
)
sys
.
argv
.
remove
(
arg
)
continue
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