diff options
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | Source/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Utilities/CMakeLists.txt | 42 |
3 files changed, 32 insertions, 30 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a5d7575..613ceaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 023a718..c7ef79c 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -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 diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 70b3e28..3bc5840 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -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}) |