Skip to content

Commit

Permalink
Fix trilinos.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
xDarkLemon committed Mar 19, 2024
1 parent f66222a commit e9416ab
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions cmake/recipes/trilinos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit e9416ab

Please sign in to comment.