| 1 |
cmake_minimum_required(VERSION 3.13...4.1 FATAL_ERROR) |
| 2 |
project(CheckCurses C) |
| 3 |
|
| 4 |
set(CURSES_NEED_NCURSES TRUE) |
| 5 |
find_package(Curses) |
| 6 |
if(NOT Curses_FOUND) |
| 7 |
return() |
| 8 |
endif() |
| 9 |
include_directories(${CURSES_INCLUDE_DIRS}) |
| 10 |
add_executable(CheckCurses CheckCurses.c) |
| 11 |
target_link_libraries(CheckCurses ${CURSES_LIBRARIES}) |
| 12 |
|
| 13 |
foreach(h |
| 14 |
CURSES_HAVE_CURSES_H |
| 15 |
CURSES_HAVE_NCURSES_H |
| 16 |
CURSES_HAVE_NCURSES_NCURSES_H |
| 17 |
CURSES_HAVE_NCURSES_CURSES_H |
| 18 |
) |
| 19 |
if(${h}) |
| 20 |
target_compile_definitions(CheckCurses PRIVATE ${h}) |
| 21 |
endif() |
| 22 |
endforeach() |