Skip to content

Commit

Permalink
Merge pull request #67 from andrsd/cmake-import-target
Browse files Browse the repository at this point in the history
Creating import target for exodusii
  • Loading branch information
andrsd authored Sep 13, 2024
2 parents 36cb8e7 + 266232e commit 47c8fb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cmake/FindExodusII.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ find_package_handle_standard_args(
VERSION_VAR EXODUSII_VERSION
)

if (EXODUSII_FOUND AND NOT TARGET exodusii::exodusii)
add_library(exodusii::exodusii UNKNOWN IMPORTED)
set_target_properties(exodusii::exodusii
PROPERTIES
IMPORTED_LOCATION "${EXODUSII_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${EXODUSII_INCLUDE_DIR}"
)
endif()

mark_as_advanced(FORCE
EXODUSII_INCLUDE_DIR
EXODUSII_LIBRARY
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ target_link_libraries(
PUBLIC
fmt::fmt
PRIVATE
${EXODUSII_LIBRARY}
exodusii::exodusii
${NETCDF_LIBRARY}
${HDF5_LIBRARIES}
)
Expand Down

0 comments on commit 47c8fb5

Please sign in to comment.