diff --git a/cmake_modules/FindTRILINOS.cmake b/cmake_modules/FindTRILINOS.cmake index 37456e5e8316..56441d57ad7f 100644 --- a/cmake_modules/FindTRILINOS.cmake +++ b/cmake_modules/FindTRILINOS.cmake @@ -39,7 +39,9 @@ ELSE (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT) GET_FILENAME_COMPONENT(TRILINOS_ROOT "${Trilinos_INCLUDE_DIRS}" DIRECTORY) SET(TRILINOS_LIBRARY_DIR "${TRILINOS_ROOT}/lib") ELSE (Trilinos_FOUND) # Not found. This will raise an error - MESSAGE(FATAL_ERROR ${ERROR_NOT_FOUND_MESSAGE}) + IF(NOT DEFINED MAKE_TRILINOS_OPTIONAL) + MESSAGE(FATAL_ERROR ${ERROR_NOT_FOUND_MESSAGE}) + ENDIF(NOT DEFINED MAKE_TRILINOS_OPTIONAL) ENDIF (Trilinos_FOUND) ENDIF (TRILINOS_LIBRARY_DIR OR TRILINOS_INCLUDE_DIR OR TRILINOS_ROOT)