-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow commandline arguments to be passed through to cmake #1006
allow commandline arguments to be passed through to cmake #1006
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1006 +/- ##
==========================================
+ Coverage 82.78% 86.32% +3.54%
==========================================
Files 75 191 +116
Lines 3306 19004 +15698
Branches 0 2105 +2105
==========================================
+ Hits 2737 16406 +13669
- Misses 569 2052 +1483
- Partials 0 546 +546
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice add!
Something we might think about is finding a place to document these so they don't stay in the realm of tribal knowledge.
Yes, although part of the reason I'd prefer to break up the build systems is so that it's possible to communicate directly with cmake using standard cmake tools. Not having to document these weird pass throughs the setup.py would be better... They aren't discoverable and are pretty non standard as far as I've seen. |
@ssteinbach There is ways to expose custom arguments. For example we could have: class OTIO_build_ext(setuptools.command.build_ext.build_ext):
user_options = setuptools.command.build_ext.build_ext.user_options + [
('cmake=', None, 'JC custom extension')
]
def initialize_options(self):
setuptools.command.build_ext.build_ext.initialize_options(self)
self.cmake = None # Really important. If you don't do this, the option will not be available Running the Not sure if that would be an acceptable solution. The downside is that I don't think we can pass this argument to |
Yeah... I think in this case we need to pass these options through pip since that is the way that wheels are to be built. But that is a great suggestion... pip doesn't have functionality like that? |
You can create a wheel like this: python setup.py build_ext
python setup.py bdist_wheel and because
Pip has some flags, like I've tried them and I'm still not too sure how everything works with these flags. There is also the fact that if you specify flags like these, they will apply to all dependencies being installed... Which means the |
ff707a1
to
1b78e35
Compare
- need to put this into the argument generator method
@JeanChristopheMorinPerso I did another pass at this w/ a rebase. Do you still have concerns over this approach? I think we need this for internal build system stuff. |
@ssteinbach I'm good with the approach. My concern was just that I am under the impression we can do this already but haven't figured out yet how. If we later find a cleaner (read "more native") way we can always create a new PR. So I guess it's alright to merge. |
@reinecke I added some notes to the README and to the Quickstart.md. Any notes on that or does that look good? |
Maybe a slight tweak to say which shell (bash?) the example env command works with? It is probably something else for cmd.exe, for example :) |
sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meshula how do these changes sound?
These changes are good and address Eric's request IMO. I was just suggesting that the env statement could use an annotation around line 134 that instead of saying "Example:" says "Example for a unix style shell" or whatever. There's a lot of Windows OTIO users, and it would be nice to provide that extra hint that their mileage might vary. |
Sometimes its helpful to be able to pass command line arguments through setup.py to cmake. This change appends the CMAKE_ARGS variable to the flags passed to cmake. It can be used like this:
env CMAKE_ARGS="-DCMAKE_VAR_1=VALUE1 -DCMAKE_VAR_2=VALUE2" python setup.py build
or
env CMAKE_ARGS="-DCMAKE_VAR=VALUE1 -DCMAKE_VAR_2=VALUE2" pip install .
TODO: