-
Notifications
You must be signed in to change notification settings - Fork 90
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
CMake examples targets #2429
CMake examples targets #2429
Conversation
If BOUT_BUILD_EXAMPLES is Off, add the examples subdirectory but with the EXCLUDE_FROM_ALL option. That enables examples to be built after the library is built, and specific examples can be built by using the `--target` argument to `cmake`.
Ah sorry, I think my earlier comment was misleading -- you can build individual examples with |
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.
LGTM 👍
I think this may be a little more complicated than I initially thought. There are I think three scenarios to cover:
Previously the What about: |
An alternative: `BOUT_BUILD_EXAMPLES` configures them with
`EXCLUDE_FROM_ALL`, and we add a target `build-all-examples`?
We do a similar thing with the tests, and this feels like perhaps the
easiest thing to do from the user point of view.
…On Sat, 2 Oct 2021, 01:22 Ben Dudson, ***@***.***> wrote:
I think this may be a little more complicated than I initially thought.
There are I think three scenarios to cover:
1. BOUT-dev is being included as a sub-module of a model, so we just
want the library and are not interested in examples
2. We are first compiling the library, then later may want to compile
one or more examples (I think this should be the default)
3. We want to build executables for all examples. I don't think this
will happen often, but should be an option at least for testing if all
examples can build
Previously the BOUT_BUILD_EXAMPLES switch chose between (1) and (3); this
PR changes it to choosing between (2) and (3).
What about:
BOUT_CONFIGURE_EXAMPLES is On by default, and adds the examples to the
cmake build. Turning it Off also turns BOUT_BUILD_EXAMPLES to Off. This
switches between (1) and (2 or 3)
BOUT_BUILD_EXAMPLES is Off by default. It controls whether
EXCLUDE_FROM_ALL is used when adding the examples. It switches between
(2) and (3)
?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2429 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALLAXT2NLMIYI36WYA7SB3UEZGEZANCNFSM5EFSJ6XQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
CMake switch BOUT_BUILD_EXAMPLES now controls whether the examples directory is added. It is ON by default, and adds the examples with the EXCLUDE_FROM_ALL flag. To actually build all examples, this adds a build-all-examples target, and examples are added to it. Specific examples can be built by using specific targets or cd'ing into their directory (in the build directory) and running "make". If BOUT_BUILD_EXAMPLES is turned OFF, then the examples are not copied into the build directory. This could be used if BOUT++ is a sub-module of another project.
If BOUT_BUILD_EXAMPLES is Off, add the examples subdirectory but with the EXCLUDE_FROM_ALL option. That enables examples to be built after the library is built, and specific examples can be built by using the
--target
argument tocmake
.