Add support for linking against a curses library when available and
[oota-llvm.git] / cmake / modules / LLVM-Config.cmake
index 2ddc0b2bf89a34c14dc06cc77063f80e7aab89f5..3e2447a0464c32bfba5ead35c0a7d82d11cb27dc 100644 (file)
@@ -10,6 +10,15 @@ function(get_system_libs return_var)
       if( HAVE_LIBDL )
         set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
       endif()
+      if(LLVM_ENABLE_CURSES)
+        if(HAVE_NCURSESW)
+          set(system_libs ${system_libs} ncursesw)
+        elseif(HAVE_NCURSES)
+          set(system_libs ${system_libs} ncurses)
+        elseif(HAVE_CURSES)
+          set(system_libs ${system_libs} curses)
+        endif()
+      endif()
       if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
         set(system_libs ${system_libs} pthread)
       endif()