-
Notifications
You must be signed in to change notification settings - Fork 30
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
parsing cmake variables values of bool #25
Comments
Along these lines it is difficult for me to expand a variable from a name, can this be achieved (i.e. I tried to implement the
I just can't seem to get it working |
A small update, the way I am doing it now is:
I would, however, still prefer to be able to loop variable names. |
I can now also loop variable names, I encountered some spurious error messages, but finally got my head around it.
|
Nice solution. The only problem I see is, that with this approach you first create (by using fypp) a file, which must be processed once more by fypp to turn the CMake values into Python-logicals. Inspired by your comments above, I could come up with a solution, which turns the CMake values into Python bools within one preprocessing step. It uses the global variable mechanism to manipulate global variables from within a function.
|
Thanks Balint.
Of course it would be best if projects determine this from the configuration files of the build it-self (i.e. through cmake variables defined in the shipped project details. However, in some cases you just want to limit your project's capabilities by following the library. In this case you want to ship a Hope this clarifies. This was my intent. :) |
Using fypp to parse cmake options are really great, but I generally have a problem parsing
WITH_*
arguments.I would rather not do:
but rather something like:
I can of course define a function that parses this, but I think this could be very generally useful? The truth/false values could optionally be set by some global
FYPP_BOOL_TRUE/FALSE
variables?The text was updated successfully, but these errors were encountered: