1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-21 23:00:50 +08:00

ccmake: Refactor BUILD_CursesDialog option logic

Move all the current logic behind `if(UNIX)` conditions to make room
for other platforms to be added.
This commit is contained in:
Brad King
2022-01-18 16:32:48 -05:00
parent bf94e01348
commit bf11dab49d

View File

@@ -670,15 +670,17 @@ macro (CMAKE_BUILD_UTILITIES)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Use curses? # Use curses?
if (UNIX)
if(NOT DEFINED BUILD_CursesDialog) if(NOT DEFINED BUILD_CursesDialog)
if (UNIX)
include(${CMake_SOURCE_DIR}/Source/Checks/Curses.cmake) include(${CMake_SOURCE_DIR}/Source/Checks/Curses.cmake)
option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" "${CMakeCheckCurses_COMPILED}") set(BUILD_CursesDialog_DEFAULT "${CMakeCheckCurses_COMPILED}")
endif() option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" "${BUILD_CursesDialog_DEFAULT}")
else () else()
set(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
endif()
endif () endif ()
if(BUILD_CursesDialog) if(BUILD_CursesDialog)
if(UNIX)
set(CURSES_NEED_NCURSES TRUE) set(CURSES_NEED_NCURSES TRUE)
find_package(Curses) find_package(Curses)
if(NOT CURSES_FOUND) if(NOT CURSES_FOUND)
@@ -689,6 +691,7 @@ macro (CMAKE_BUILD_UTILITIES)
set(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
endif() endif()
endif() endif()
endif()
if(BUILD_CursesDialog) if(BUILD_CursesDialog)
if(NOT CMAKE_USE_SYSTEM_FORM) if(NOT CMAKE_USE_SYSTEM_FORM)
add_subdirectory(Source/CursesDialog/form) add_subdirectory(Source/CursesDialog/form)