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

Add CONFIGURE_DEPENDS #1

Open
ivan-pi opened this issue Aug 25, 2022 · 0 comments
Open

Add CONFIGURE_DEPENDS #1

ivan-pi opened this issue Aug 25, 2022 · 0 comments

Comments

@ivan-pi
Copy link

ivan-pi commented Aug 25, 2022

file(GLOB sources *.f90 *.F90 *.c *.C)

You may want to add CONFIGURE_DEPENDS. For further context see the recent discussion at Discourse: https://fortran-lang.discourse.group/t/module-dependencies-in-cmake-not-tracked-after-a-module-is-updated/4202/18

Quoting from the More Modern CMake tutorial:

When you rerun the build step (not the configure step), then unless you set CONFIGURE_DEPENDS, your build tool will not check to see if you have added any new files that now pass the glob. This is the reason poorly written CMake projects often have issues when you are trying to add files; some people are in the habit of rerunning cmake before every build because of this. You shouldn’t ever have to manually reconfigure; the build tool will rerun CMake as needed with this one exception. If you add CONFIGURE_DEPENDS, then most build tools will actually start checking glob too. The classic rule of CMake was “never glob”; the new rule is “never glob, but if you have to, add CONFIGURE_DEPENDS”.

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