blob: 2520ac46fe1c253e64f1452463be1eefd5951437 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From c2291fe28dc5682f81804941512431642975cf21 Mon Sep 17 00:00:00 2001
2From: Pascal Bach <pascal.bach@siemens.com>
3Date: Mon, 29 Oct 2018 18:17:32 +0100
4Subject: [PATCH] Simplify ncurses finding module
5
6CMake will automatically look in the right locations, there is no need to
7re-implement the logic with a for loop and NO_DEFAULT_PATH.
8
9It is already done like this to file the headers.
10
11Upstream-Status: Submitted [https://github.com/libyui/libyui-ncurses/pull/73]
12Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
13---
14 cmake/Modules/FindCurses6.cmake | 8 +++-----
15 1 file changed, 3 insertions(+), 5 deletions(-)
16
17diff --git a/cmake/Modules/FindCurses6.cmake b/cmake/Modules/FindCurses6.cmake
18index 0bf02c3..e298d5d 100644
19--- a/cmake/Modules/FindCurses6.cmake
20+++ b/cmake/Modules/FindCurses6.cmake
21@@ -5,11 +5,9 @@
22 # CURSES6_LIBRARIES - The libraries needed to use Curses6
23 # CURSES6_DEFINITIONS - Compiler switches required for using Curses6
24
25-FOREACH(path ${CMAKE_LIBRARY_PATH} /usr/${LIB_DIR})
26- FIND_LIBRARY(CURSES6_NCURSESW_LIBRARY NAMES ncursesw PATHS ${path}/ncurses6 ${path} NO_DEFAULT_PATH)
27- FIND_LIBRARY(CURSES6_PANELW_LIBRARY NAMES panelw PATHS ${path}/ncurses6 ${path} NO_DEFAULT_PATH)
28- FIND_LIBRARY(CURSES6_TINFO_LIBRARY NAMES tinfo PATHS ${path}/ncurses6 ${path} NO_DEFAULT_PATH)
29-ENDFOREACH()
30+FIND_LIBRARY(CURSES6_NCURSESW_LIBRARY NAMES ncursesw PATH_SUFFIXES ncurses6)
31+FIND_LIBRARY(CURSES6_PANELW_LIBRARY NAMES panelw PATH_SUFFIXES ncurses6)
32+FIND_LIBRARY(CURSES6_TINFO_LIBRARY NAMES tinfo PATH_SUFFIXES ncurses6)
33
34 SET(CURSES6_LIBRARIES ${CURSES6_NCURSESW_LIBRARY} ${CURSES6_PANELW_LIBRARY})
35 # tinfo is optional (in 12.1 is not there)