Skip to content
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: consider removing deal_ii_setup_target() and using import targets directly (deal.II version 9.5 or later) #5632

Open
tamiko opened this issue Apr 23, 2024 · 0 comments

Comments

@tamiko
Copy link
Contributor

tamiko commented Apr 23, 2024

There is nothing wrong with the current setup of using deal_ii_setup_target() in aspect. (In particular modifying the various DEAL_II_* variables for compiler and linker flags and then simply calling deal_ii_setup_target() is very convenient)

In deal.II 9.5 or later we switched to the modern way of using CMake import targets (effectively deprecating the deal_ii_setup_target() macro). This is particularly convenient if you ever want to take full control of compiler and linker setup independently of the configuration originally chosen for deal.II. On the flip-side this requires deal.II version 9.5 or newer.

Changing the CMake configuration would look as follows:

  • instead of using deal_ii_setup_target(<target> DEBUG|RELEASE) simply use the CMake builtin target_link_libraries(<target> dealii::dealii_debug|release).

  • Set up CMAKE_(C|CXX|Fortran)_FLAGS(|_DEBUG|_RELEASE) (or ASPECT_, or whatever) and compile definitions and populate them according to your needs and write a small wrapper that sets those flags for targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant