From e9416abd4bfb148beb8c3c7c63b4a314e64d2a3b Mon Sep 17 00:00:00 2001 From: xDarkLemon Date: Tue, 19 Mar 2024 01:15:15 -0400 Subject: [PATCH] Fix trilinos.cmake --- cmake/recipes/trilinos.cmake | 42 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/cmake/recipes/trilinos.cmake b/cmake/recipes/trilinos.cmake index 1b15890..15174ea 100644 --- a/cmake/recipes/trilinos.cmake +++ b/cmake/recipes/trilinos.cmake @@ -7,31 +7,37 @@ message(STATUS "Third-party: creating target 'Trilinos::Trilinos'") find_package(Trilinos COMPONENTS ML Epetra) if(NOT Trilinos_FOUND) + set(POLYSOLVE_WITH_TRILINOS OFF) message("Trilinos not found.") endif() find_package(MPI) if(NOT MPI_FOUND) + set(POLYSOLVE_WITH_TRILINOS OFF) message("MPI not found.") endif() -MESSAGE("\nFound Trilinos! Here are the details: ") -MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}") -MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}") -MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}") -MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES} ") -MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS} ") -MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}") -MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}") -MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}") -MESSAGE("End of Trilinos details\n") -# include(trilinos) -if(TARGET Trilinos::Trilinos) -else() - add_library(trilinos INTERFACE) - add_library(Trilinos::Trilinos ALIAS trilinos) - target_include_directories(trilinos INTERFACE ${Trilinos_INCLUDE_DIRS} ) - target_link_libraries(trilinos INTERFACE ${Trilinos_LIBRARIES} ) - target_link_libraries(trilinos INTERFACE MPI::MPI_C MPI::MPI_CXX ) +if(Trilinos_FOUND) + if(MPI_FOUND) + MESSAGE("\nFound Trilinos! Here are the details: ") + MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}") + MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}") + MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}") + MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES} ") + MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS} ") + MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}") + MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}") + MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}") + MESSAGE("End of Trilinos details\n") + # include(trilinos) + if(TARGET Trilinos::Trilinos) + else() + add_library(trilinos INTERFACE) + add_library(Trilinos::Trilinos ALIAS trilinos) + target_include_directories(trilinos INTERFACE ${Trilinos_INCLUDE_DIRS} ) + target_link_libraries(trilinos INTERFACE ${Trilinos_LIBRARIES} ) + target_link_libraries(trilinos INTERFACE MPI::MPI_C MPI::MPI_CXX ) + endif() + endif() endif() \ No newline at end of file