if(LAPACK_FOUND) add_executable(example example.f90) target_link_libraries(example ${LAPACK_LIBRARIES}) else() message(FATAL_ERROR "LAPACK library not found") endif()