summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-18 16:32:48 -0500
committerBrad King <brad.king@kitware.com>2022-01-18 16:34:43 -0500
commitbf11dab49d4155c0c58e1048ee0ab082b692d5db (patch)
treefe26630c2b879d373279b5100d1ebdcdf7c0a5a5 /CMakeLists.txt
parentbf94e01348e9a862db4e9476f14b8e4f89619469 (diff)
downloadcmake-bf11dab49d4155c0c58e1048ee0ab082b692d5db.tar.gz
ccmake: Refactor BUILD_CursesDialog option logic
Move all the current logic behind `if(UNIX)` conditions to make room for other platforms to be added.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 16 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1fe847f9ae..1f7a510834 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -670,23 +670,26 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Use curses?
- if (UNIX)
- if(NOT DEFINED BUILD_CursesDialog)
+ if(NOT DEFINED BUILD_CursesDialog)
+ if (UNIX)
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}")
+ option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" "${BUILD_CursesDialog_DEFAULT}")
+ else()
+ set(BUILD_CursesDialog 0)
endif()
- else ()
- set(BUILD_CursesDialog 0)
endif ()
if(BUILD_CursesDialog)
- set(CURSES_NEED_NCURSES TRUE)
- find_package(Curses)
- if(NOT CURSES_FOUND)
- message(WARNING
- "'ccmake' will not be built because Curses was not found.\n"
- "Turn off BUILD_CursesDialog to suppress this message."
- )
- set(BUILD_CursesDialog 0)
+ if(UNIX)
+ set(CURSES_NEED_NCURSES TRUE)
+ find_package(Curses)
+ if(NOT CURSES_FOUND)
+ message(WARNING
+ "'ccmake' will not be built because Curses was not found.\n"
+ "Turn off BUILD_CursesDialog to suppress this message."
+ )
+ set(BUILD_CursesDialog 0)
+ endif()
endif()
endif()
if(BUILD_CursesDialog)