Commit d1bafb5a authored by Ehsan Azarnasab's avatar Ehsan Azarnasab

simplify passing cmake yes and no options.

parent 34e73a6b
...@@ -12,15 +12,10 @@ To repackage the previously built package as wheel (bypassing build): ...@@ -12,15 +12,10 @@ To repackage the previously built package as wheel (bypassing build):
python setup.py bdist_wheel --repackage python setup.py bdist_wheel --repackage
To install a develop version (egg with symbolic link): To install a develop version (egg with symbolic link):
python setup.py develop python setup.py develop
To exclude/include certain features in the build: To exclude/include certain options in the cmake config use --yes and --no:
--no-gui-support: sets DLIB_NO_GUI_SUPPORT for example:
--enable-stack-trace: sets DLIB_ENABLE_STACK_TRACE --yes DLIB_NO_GUI_SUPPORT: will set -DDLIB_NO_GUI_SUPPORT=yes
--enable-asserts: sets DLIB_ENABLE_ASSERTS --no DLIB_NO_GUI_SUPPORT: will set -DDLIB_NO_GUI_SUPPORT=no
--no-blas: unsets DLIB_USE_BLAS
--no-lapack: unsets DLIB_USE_LAPACK
--no-libpng: unsets DLIB_LINK_WITH_LIBPNG
--no-libjpeg: unsets DLIB_LINK_WITH_LIBJPEG
--no-sqlite3: unsets DLIB_LINK_WITH_SQLITE3
Additional options: Additional options:
--debug: makes a debug build --debug: makes a debug build
--cmake: path to specific cmake executable --cmake: path to specific cmake executable
...@@ -73,6 +68,10 @@ def _get_options(): ...@@ -73,6 +68,10 @@ def _get_options():
for opt_idx, arg in enumerate(sys.argv): for opt_idx, arg in enumerate(sys.argv):
if opt_key == 'cmake': if opt_key == 'cmake':
_cmake_path = arg _cmake_path = arg
elif opt_key == 'yes':
_cmake_extra.append('-D{arg}=yes'.format(arg=arg.trim()))
elif opt_key == 'no':
_cmake_extra.append('-D{arg}=no'.format(arg=arg.trim()))
if opt_key: if opt_key:
sys.argv.remove(arg) sys.argv.remove(arg)
...@@ -88,6 +87,10 @@ def _get_options(): ...@@ -88,6 +87,10 @@ def _get_options():
opt_key = opt opt_key = opt
sys.argv.remove(arg) sys.argv.remove(arg)
continue continue
elif opt in ['yes', 'no']:
opt_key = opt
sys.argv.remove(arg)
continue
opt_key = None opt_key = None
custom_arg = True custom_arg = True
...@@ -95,22 +98,6 @@ def _get_options(): ...@@ -95,22 +98,6 @@ def _get_options():
_cmake_config = 'Debug' _cmake_config = 'Debug'
elif opt == 'release': elif opt == 'release':
_cmake_config = 'Release' _cmake_config = 'Release'
elif opt == 'no-gui-support':
_cmake_extra.append('-DDLIB_NO_GUI_SUPPORT=yes')
elif opt == 'enable-stack-trace':
_cmake_extra.append('-DDLIB_ENABLE_STACK_TRACE=yes')
elif opt == 'enable-asserts':
_cmake_extra.append('-DDLIB_ENABLE_ASSERTS=yes')
elif opt == 'no-blas':
_cmake_extra.append('-DDLIB_USE_BLAS=no')
elif opt == 'no-lapack':
_cmake_extra.append('-DDLIB_USE_LAPACK=no')
elif opt == 'no-libpng':
_cmake_extra.append('-DDLIB_LINK_WITH_LIBPNG=no')
elif opt == 'no-libjpeg':
_cmake_extra.append('-DDLIB_LINK_WITH_LIBJPEG=no')
elif opt == 'no-sqlite3':
_cmake_extra.append('-DDLIB_LINK_WITH_SQLITE3=no')
elif opt in ['debug', 'release', elif opt in ['debug', 'release',
'repackage']: 'repackage']:
_options.append(opt) _options.append(opt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment