-
Notifications
You must be signed in to change notification settings - Fork 19
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
Updated CMakeLists to work with GEOS-ESM/ESMA_cmake#57 #226
Conversation
MAPL_Base/CMakeLists.txt
Outdated
@@ -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> |
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.
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.
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.
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?
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.
FLAP_FOUND
is the standard variable set by find_package(FLAP ...)
(i.e. find_package(XXX)
sets XXX_FOUND
according to here)
Huh. Was there a reason this was pulled into |
mea culpa - we'll deal with this once we've settled the cmake PR. |
This PR accompanies GEOS-ESM/ESMA_cmake#57