ENH: Added option BUILD_CursesDialog if curses is found. This allows people to disable building the dialog even when curses is found.

This commit is contained in:
Brad King 2006-02-08 10:13:13 -05:00
parent dd710c9482
commit 6fe45fe9c3
3 changed files with 32 additions and 30 deletions

View File

@ -106,14 +106,21 @@ SET(CMAKE_XMLRPC_INCLUDES
SET(CMAKE_XMLRPC_LIBRARIES "cmXMLRPC")
IF (UNIX)
INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
FIND_PACKAGE(Curses QUIET)
IF (CURSES_LIBRARY)
SUBDIRS(Source/CursesDialog/form)
OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
ELSE (CURSES_LIBRARY)
MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be build.")
SET(BUILD_CursesDialog 0)
ENDIF (CURSES_LIBRARY)
ELSE (UNIX)
SET(BUILD_CursesDialog 0)
ENDIF (UNIX)
IF(BUILD_CursesDialog)
SUBDIRS(Source/CursesDialog/form)
ENDIF(BUILD_CursesDialog)
SUBDIRS(Source Modules Templates Utilities)
ENABLE_TESTING()

View File

@ -291,12 +291,9 @@ ADD_EXECUTABLE(cpack CPack/cpack.cxx)
TARGET_LINK_LIBRARIES(cpack CPackLib)
# Curses GUI
IF (UNIX)
INCLUDE (${CMake_SOURCE_DIR}/Modules/FindCurses.cmake OPTIONAL)
IF (CURSES_LIBRARY)
INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
ENDIF (CURSES_LIBRARY)
ENDIF (UNIX)
IF(BUILD_CursesDialog)
INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
ENDIF(BUILD_CursesDialog)
# MFC GUI
# MFC libraries are only available on Visual Studio

View File

@ -51,28 +51,26 @@ INSTALL_FILES(${CMAKE_DOC_DIR} FILES
SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/ctest.txt)
# Generate documentation for "ccmake" executable.
IF(UNIX)
IF(CURSES_LIBRARY)
SET(CMD ${CMD_DIR}/ccmake${CMD_EXT})
ADD_CUSTOM_COMMAND(
OUTPUT ${CMake_BINARY_DIR}/Docs/ccmake.txt
COMMAND ${CMD}
ARGS --help-full ${CMake_BINARY_DIR}/Docs/ccmake.txt
--help-html ${CMake_BINARY_DIR}/Docs/ccmake.html
--help-man ${CMake_BINARY_DIR}/Docs/ccmake.1
DEPENDS ccmake
MAIN_DEPENDENCY ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt
)
INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES
${CMake_BINARY_DIR}/Docs/ccmake.1
)
INSTALL_FILES(${CMAKE_DOC_DIR} FILES
${CMake_BINARY_DIR}/Docs/ccmake.txt
${CMake_BINARY_DIR}/Docs/ccmake.html
)
SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/ccmake.txt)
ENDIF(CURSES_LIBRARY)
ENDIF(UNIX)
IF(BUILD_CursesDialog)
SET(CMD ${CMD_DIR}/ccmake${CMD_EXT})
ADD_CUSTOM_COMMAND(
OUTPUT ${CMake_BINARY_DIR}/Docs/ccmake.txt
COMMAND ${CMD}
ARGS --help-full ${CMake_BINARY_DIR}/Docs/ccmake.txt
--help-html ${CMake_BINARY_DIR}/Docs/ccmake.html
--help-man ${CMake_BINARY_DIR}/Docs/ccmake.1
DEPENDS ccmake
MAIN_DEPENDENCY ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt
)
INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES
${CMake_BINARY_DIR}/Docs/ccmake.1
)
INSTALL_FILES(${CMAKE_DOC_DIR} FILES
${CMake_BINARY_DIR}/Docs/ccmake.txt
${CMake_BINARY_DIR}/Docs/ccmake.html
)
SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/ccmake.txt)
ENDIF(BUILD_CursesDialog)
IF(BUILD_MFCDialog)
SET(CMD ${CMD_DIR}/CMakeSetup${CMD_EXT})