From 266232e0fea74e4cad0cb7e5326af5506bb18a90 Mon Sep 17 00:00:00 2001 From: David Andrs Date: Fri, 13 Sep 2024 07:06:31 -0600 Subject: [PATCH] Creating import target for exodusii --- cmake/FindExodusII.cmake | 9 +++++++++ src/CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/FindExodusII.cmake b/cmake/FindExodusII.cmake index 27e2c84..b28fd0b 100644 --- a/cmake/FindExodusII.cmake +++ b/cmake/FindExodusII.cmake @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ccc6b6b..ccabf4d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,7 @@ target_link_libraries( PUBLIC fmt::fmt PRIVATE - ${EXODUSII_LIBRARY} + exodusii::exodusii ${NETCDF_LIBRARY} ${HDF5_LIBRARIES} )