forked from ufs-community/UFS_UTILS
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kyle's updates for finding the wgrib2 library.
Fixes ufs-community#559
- Loading branch information
1 parent
7e87be1
commit 47e3ea8
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This module produces the target wgrib2::wgrib2 | ||
|
||
find_path(WGRIB2_INCLUDES wgrib2api.mod) | ||
|
||
find_library(WGRIB2_LIBRARIES libwgrib2.a) | ||
|
||
find_program(WGRIB2_EXE wgrib2) | ||
execute_process(COMMAND ${WGRIB2_EXE} --version OUTPUT_VARIABLE version_str) | ||
string(SUBSTRING ${version_str} 3 5 version) | ||
|
||
mark_as_advanced(WGRIB2_INCLUDES WGRIB2_LIBRARIES) | ||
|
||
add_library(wgrib2::wgrib2 UNKNOWN IMPORTED) | ||
|
||
set_target_properties(wgrib2::wgrib2 PROPERTIES | ||
IMPORTED_LOCATION "${WGRIB2_LIBRARIES}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${WGRIB2_INCLUDES}" | ||
INTERFACE_LINK_LIBRARIES "${WGRIB2_LIBRARIES}") | ||
|
||
find_package_handle_standard_args(wgrib2 | ||
REQUIRED_VARS WGRIB2_LIBRARIES WGRIB2_INCLUDES WGRIB2_EXE | ||
VERSION_VAR version | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters