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

FindESMF: Setting ESMFMKFILE to non-existent file should report error #56

Open
DusanJovic-NOAA opened this issue Sep 14, 2021 · 2 comments

Comments

@DusanJovic-NOAA
Copy link
Contributor

If ESMFMKFILE environment variable is set but points to a non-existent file, FindESMF silently returns even if in the application it is marked as required package.
This fatal error message:

  if (NOT DEFINED ESMFMKFILE)                                                                             
    message(FATAL_ERROR "ESMFMKFILE not defined. This is the path to esmf.mk file. \
Without this filepath, ESMF_FOUND will always be FALSE.")
  endif ()

should depend on whether or not file that ESMFMKFILE points to exists, not whether variable ESMFMKFILE is defined.

@DusanJovic-NOAA
Copy link
Contributor Author

At the end of FindESMF.cmake we should add something like:

# Check package has been found correctly
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
  ESMF
  REQUIRED_VARS
    esmf_lib
  VERSION_VAR ESMF_VERSION_STRING
) 

@kgerheiser
Copy link
Contributor

kgerheiser commented Sep 14, 2021

The CMakeModules you are looking at is out of date. find_package_handle_standard_args is there, though the original bug still exists, but it would fail because the vars aren't set.

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

2 participants