From 802eeca3ee7c78f5df3deaf39ab1b34fabec801e Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 23 Jun 2023 16:57:26 +0200 Subject: [PATCH] Add TAMPI cmake module --- cmake/FindTampi.cmake | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cmake/FindTampi.cmake diff --git a/cmake/FindTampi.cmake b/cmake/FindTampi.cmake new file mode 100644 index 0000000..6bcc84b --- /dev/null +++ b/cmake/FindTampi.cmake @@ -0,0 +1,22 @@ +include(GNUInstallDirs) + +find_library(TAMPI_LIBRARY NAMES tampi-c) +find_path(TAMPI_INCLUDE_DIR TAMPI.h) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Tampi DEFAULT_MSG + TAMPI_LIBRARY TAMPI_INCLUDE_DIR) + +if(NOT TAMPI_FOUND) + return() +endif() + +if(TARGET Tampi::tampi-c) + return() +endif() + +add_library(Tampi::tampi-c SHARED IMPORTED) +set_target_properties(Tampi::tampi-c PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${TAMPI_INCLUDE_DIR}" + IMPORTED_LOCATION ${TAMPI_LIBRARY})