| 1 |
MACRO(CONFIGURE_GCU_FRONTEND _NAME_TARGET) |
| 2 |
|
| 3 |
# 3.10 required for CURSES_NEED_WIDE |
| 4 |
CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR) |
| 5 |
SET(CURSES_NEED_WIDE TRUE) |
| 6 |
# Only ncurses provides wide character support so require that as well. |
| 7 |
SET(CURSES_NEED_NCURSES TRUE) |
| 8 |
FIND_PACKAGE(Curses) |
| 9 |
|
| 10 |
IF (CURSES_FOUND) |
| 11 |
|
| 12 |
TARGET_LINK_LIBRARIES(${_NAME_TARGET} PRIVATE ${CURSES_LIBRARIES}) |
| 13 |
TARGET_INCLUDE_DIRECTORIES(${_NAME_TARGET} PRIVATE ${CURSES_INCLUDE_DIRS}) |
| 14 |
TARGET_COMPILE_DEFINITIONS(${_NAME_TARGET} PRIVATE -D USE_GCU) |
| 15 |
TARGET_COMPILE_DEFINITIONS(${_NAME_TARGET} PRIVATE -D USE_NCURSES) |
| 16 |
|
| 17 |
CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} use_default_colors "" ANGBAND_CURSES_NCURSES_HAS_USE_DEFAULT_COLORS) |
| 18 |
IF (ANGBAND_CURSES_NCURSES_HAS_USE_DEFAULT_COLORS) |
| 19 |
TARGET_COMPILE_DEFINITIONS(${_NAME_TARGET} PRIVATE -D HAVE_USE_DEFAULT_COLORS) |
| 20 |
MESSAGE(STATUS "Using use_default_colors() with GCU front end") |
| 21 |
ENDIF() |
| 22 |
|
| 23 |
MESSAGE(STATUS "Support for GCU front end - Ready") |
| 24 |
|
| 25 |
ELSE() |
| 26 |
|
| 27 |
MESSAGE(FATAL_ERROR "Support for GCU front end - Failed") |
| 28 |
|
| 29 |
ENDIF() |
| 30 |
|
| 31 |
ENDMACRO() |