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

Updated CMakeLists to work with GEOS-ESM/ESMA_cmake#57 #226

Merged

Conversation

LiamBindle
Copy link
Contributor

This PR accompanies GEOS-ESM/ESMA_cmake#57

@@ -22,7 +22,7 @@ set (srcs
MAPL_GenericCplComp.F90 MAPL_Sort.F90
MAPL_Generic.F90 MAPL_sun_uc.F90 MAPL_SatVapor.F90
MAPL_HistoryCollection.F90
MAPL_HistoryGridComp.F90 MAPL_CapOptions.F90 MAPL_FlapCapOptions.F90
MAPL_HistoryGridComp.F90 MAPL_CapOptions.F90 $<$<BOOL:${FLAP_FOUND}>:MAPL_FlapCapOptions.F90>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm weak on CMake generator expressions. Does this construct build the source file only if FLAP is found? If so, very nice, though might be good to put it on a separate line if we need to make any other changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's correct. Personally, I prefer them to if() blocks because I find they simplify the logic of CMakeLists (e.g. you'd need a new variable to accomplish this otherwise).

Specifically, $<BOOL:${FLAP_FOUND}> evaluates ${FLAP_FOUND} to 0 or 1 according to CMake's if logic. Then the ouside generator expression evaluates to "MAPL_FlapCapOptions.F90" iff the inside generator expression was 1.

I just added it to a new line. How does that look?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FLAP_FOUND is the standard variable set by find_package(FLAP ...) (i.e. find_package(XXX) sets XXX_FOUND according to here)

@tclune tclune merged commit fe086eb into GEOS-ESM:release/2.0.0 Feb 12, 2020
@mathomp4
Copy link
Member

Huh. Was there a reason this was pulled into release/2.0.0? I'm pretty sure this means that branch is now unbuildable (on its HEAD) without GEOS-ESM/ESMA_cmake#57

@tclune
Copy link
Collaborator

tclune commented Feb 13, 2020

mea culpa - we'll deal with this once we've settled the cmake PR.

@LiamBindle LiamBindle deleted the feature/community-build-system-support branch April 5, 2021 14:14
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

Successfully merging this pull request may close these issues.

3 participants