mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 03:54:04 +08:00
Fall back to CMake's pkg-config-based search for curses
CMake seems to have trouble finding libraries from multiarch packages that do not have the compatibility symlink installed to the arch-independent library directory. Users must either manually supply the path to the library in question via command-line parameters or we can fall back to CMake's alternate method of finding packages based off of pkg-config rather than using the hard-coded `FindCurses` CMake module specific to the CMake version/distribution installed.
This commit is contained in:
parent
74422e476b
commit
7af0cad23d
|
@ -1,5 +1,15 @@
|
|||
# Detect curses.
|
||||
FIND_PACKAGE(Curses REQUIRED)
|
||||
# Try using CMake's own logic to locate curses/ncurses
|
||||
FIND_PACKAGE(Curses)
|
||||
IF(NOT ${CURSES_FOUND})
|
||||
# CMake has trouble finding platform-specific system libraries
|
||||
# installed to multiarch paths (e.g. /usr/lib/x86_64-linux-gnu)
|
||||
# if not symlinked or passed in as a manual define.
|
||||
MESSAGE("Falling back to pkg-config for (n)curses detection")
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_SEARCH_MODULE(CURSES REQUIRED ncurses curses)
|
||||
SET(CURSES_CURSES_LIBRARY ${CURSES_LIBRARIES})
|
||||
SET(CURSES_LIBRARY ${CURSES_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
# Get threads.
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
|
|
Loading…
Reference in New Issue
Block a user