add possibility to pass options to cmake via setup.py

This commit is contained in:
Radovan Bast
2015-07-29 22:33:48 +02:00
parent 8b8e95521f
commit cfe2823c09
5 changed files with 41 additions and 0 deletions

View File

@ -102,6 +102,8 @@ def gen_cmake_command(config):
s.append(" command.append('-DCMAKE_BUILD_TYPE=%s' % arguments['--type'])")
s.append(" command.append('-G \"%s\"' % arguments['--generator'])")
s.append(" for word in arguments['--cmake-options'].split():")
s.append(" command.append('%s' % word)")
s.append("\n return ' '.join(command)")
@ -151,6 +153,7 @@ def gen_setup(config, relative_path):
options.append(['--type=<TYPE>', 'Set the CMake build type (debug, release, or relwithdeb) [default: release].'])
options.append(['--generator=<STRING>', 'Set the CMake build system generator [default: Unix Makefiles].'])
options.append(['--show', 'Show CMake command and exit.'])
options.append(['--cmake-options=<OPTIONS>', 'Define options to CMake [default: None].'])
options.append(['<builddir>', 'Build directory.'])
options.append(['-h --help', 'Show this screen.'])