diff options
author | Brad King <brad.king@kitware.com> | 2019-10-01 15:02:53 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-10-01 15:03:18 (GMT) |
commit | 7ad49fa3339dd25c53b4166a8aa12fcf59cf4dad (patch) | |
tree | 454fd1a5eedaae713334536054b5ae1dc8c41502 /Modules | |
parent | a06472b1689b16f1e1026330d0147b528a96ac5c (diff) | |
parent | 048860e172cb08445fca19ea2e4387e5ea3cedbe (diff) | |
download | CMake-7ad49fa3339dd25c53b4166a8aa12fcf59cf4dad.zip CMake-7ad49fa3339dd25c53b4166a8aa12fcf59cf4dad.tar.gz CMake-7ad49fa3339dd25c53b4166a8aa12fcf59cf4dad.tar.bz2 |
Merge topic 'FindCurses-ncursesw'
048860e172 FindCurses: toplevel ncursesw support, recover cflags
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3845
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCurses.cmake | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index b3cd8fa..5abc08a 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -18,6 +18,8 @@ This module defines the following variables: The include directories needed to use Curses. ``CURSES_LIBRARIES`` The libraries needed to use Curses. +``CURSES_CFLAGS`` + Parameters which ought be given to C/C++ compilers when using Curses. ``CURSES_HAVE_CURSES_H`` True if curses.h is available. ``CURSES_HAVE_NCURSES_H`` @@ -56,7 +58,7 @@ else() set(CURSES_NEED_NCURSES TRUE) endif() -find_library(CURSES_CURSES_LIBRARY NAMES curses ) +find_library(CURSES_CURSES_LIBRARY NAMES curses) find_library(CURSES_NCURSES_LIBRARY NAMES "${NCURSES_LIBRARY_NAME}" ) set(CURSES_USE_NCURSES FALSE) @@ -118,7 +120,7 @@ if(CURSES_USE_NCURSES) if(CURSES_NCURSES_INCLUDE_PATH) if (CURSES_NEED_WIDE) find_path(CURSES_INCLUDE_PATH - NAMES ncursesw/ncurses.h ncursesw/curses.h + NAMES ncursesw/ncurses.h ncursesw/curses.h ncursesw.h cursesw.h PATHS ${CURSES_NCURSES_INCLUDE_PATH} NO_DEFAULT_PATH ) @@ -133,7 +135,7 @@ if(CURSES_USE_NCURSES) if (CURSES_NEED_WIDE) find_path(CURSES_INCLUDE_PATH - NAMES ncursesw/ncurses.h ncursesw/curses.h + NAMES ncursesw/ncurses.h ncursesw/curses.h ncursesw.h cursesw.h HINTS "${_cursesParentDir}/include" ) else() @@ -238,10 +240,16 @@ if(CURSES_FORM_LIBRARY) set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY}) endif() -# Provide the *_INCLUDE_DIRS result. +# Provide the *_INCLUDE_DIRS and *_CFLAGS results. set(CURSES_INCLUDE_DIRS ${CURSES_INCLUDE_PATH}) set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH}) # compatibility +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(NCURSES QUIET ${NCURSES_LIBRARY_NAME}) + set(CURSES_CFLAGS ${NCURSES_CFLAGS_OTHER}) +endif() + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG CURSES_LIBRARY CURSES_INCLUDE_PATH) |