Skip to content

Commit e9416ab

Browse files
committed
Fix trilinos.cmake
1 parent f66222a commit e9416ab

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

cmake/recipes/trilinos.cmake

+24-18
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,37 @@ message(STATUS "Third-party: creating target 'Trilinos::Trilinos'")
77
find_package(Trilinos COMPONENTS ML Epetra)
88

99
if(NOT Trilinos_FOUND)
10+
set(POLYSOLVE_WITH_TRILINOS OFF)
1011
message("Trilinos not found.")
1112
endif()
1213

1314
find_package(MPI)
1415

1516
if(NOT MPI_FOUND)
17+
set(POLYSOLVE_WITH_TRILINOS OFF)
1618
message("MPI not found.")
1719
endif()
1820

19-
MESSAGE("\nFound Trilinos! Here are the details: ")
20-
MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}")
21-
MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}")
22-
MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
23-
MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES} ")
24-
MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS} ")
25-
MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
26-
MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
27-
MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
28-
MESSAGE("End of Trilinos details\n")
29-
# include(trilinos)
30-
if(TARGET Trilinos::Trilinos)
31-
else()
32-
add_library(trilinos INTERFACE)
33-
add_library(Trilinos::Trilinos ALIAS trilinos)
34-
target_include_directories(trilinos INTERFACE ${Trilinos_INCLUDE_DIRS} )
35-
target_link_libraries(trilinos INTERFACE ${Trilinos_LIBRARIES} )
36-
target_link_libraries(trilinos INTERFACE MPI::MPI_C MPI::MPI_CXX )
21+
if(Trilinos_FOUND)
22+
if(MPI_FOUND)
23+
MESSAGE("\nFound Trilinos! Here are the details: ")
24+
MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}")
25+
MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}")
26+
MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
27+
MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES} ")
28+
MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS} ")
29+
MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
30+
MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
31+
MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
32+
MESSAGE("End of Trilinos details\n")
33+
# include(trilinos)
34+
if(TARGET Trilinos::Trilinos)
35+
else()
36+
add_library(trilinos INTERFACE)
37+
add_library(Trilinos::Trilinos ALIAS trilinos)
38+
target_include_directories(trilinos INTERFACE ${Trilinos_INCLUDE_DIRS} )
39+
target_link_libraries(trilinos INTERFACE ${Trilinos_LIBRARIES} )
40+
target_link_libraries(trilinos INTERFACE MPI::MPI_C MPI::MPI_CXX )
41+
endif()
42+
endif()
3743
endif()

0 commit comments

Comments
 (0)