-
Notifications
You must be signed in to change notification settings - Fork 8
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
"requiredness" of find_package dependencies not modifiable by super-projects #33
Comments
@lizziel I'm a bit confused. To build pFlogger they are required. Are you somehow building pFlogger without them? |
I've explained to @mathomp4 via backchannels. |
Thinking about it some more, I should add the explanation in this thread for others that might need to understand. If a codebase uses submodules to directly include the pFlogger dependencies then the CMake The only options that I am currently aware of are (1) putting in some sort of conditional as alluded to by the OP, or (2) using CMake's ExternalProject command. This command can download (or clone) external dependencies and build&install. In this scenario the download step would be skipped. @lizziel Let me know if you have the energy to try ExternalProject. I'm thinking this might be useful in your environment as it gives you direct control over how these dependencies are handled. |
ExternalProject may indeed be the best long-term solution for us. @LiamBindle mentioned this is something he could look more into later in the summer. |
Hi everyone. I can take a look at ExternalProject again (later in the summer once I get my thesis done). I looked into it in the past for GEOS-Chem, and I decided against it, so I am a bit wary of ExternalProjects. The reason I ruled it out in the past is (IIRC) ExternalProjects configures and builds the project during the configure step of the super project (i.e. during the Are there problems that come up by skipping the if (not target GFTL::GFTL)
find_package(GFTL REQUIRED)
endif() Here, if the |
@LiamBindle that was my concern as well. I thought I recently ran across a variant that defers the build until, er, build. But my memory is such that I don't recall the name of the feature. I'll try poking around to see if I can find it in an email from the person that I think mentioned it to me. Lacking that, I agree that a conditional is the only option. I find the second variant with an explicit conditional easier to understand, but only marginally. |
@tclune That would be great for us if there was a way to defer their builds until after the build step. In fact, if that was the case, I think GCHPctm could potentially build MAPL and all its dependencies with that approach. I don't see why CMake couldn't do this--all the info that goes into a ConfigModule is knowable during the config step--at least, I think it is. To iterate on that explicit conditional, perhaps something like set(PFLOGGER_RESOLVE_DEPENDENCIES_FROM_CURRENT_SCOPE "FALSE" CACHE ...)
if (not PFLOGGER_RESOLVE_DEPENDENCIES_FROM_CURRENT_SCOPE)
find_package(GFTL REQUIRED)
endif() would be more clear. |
Several dependencies are hard-coded as
REQUIRED
in calls tofind_package
. This causes CMake configure problems when pFlogger is built in a super-project that does not use GMAO Baselibs.pFlogger/CMakeLists.txt
Lines 36 to 38 in 25c3c6e
The find_package calls can be made more flexible by using an
IS_REQUIRED
variable set at a higher level for whether the package must be found. For example:This issue is also relevant to
find_package
calls within CMakeLists.txt of MAPL and yaFyaml.The text was updated successfully, but these errors were encountered: