diff options
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/CMakeLists.txt | 18 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesPathWidget.cxx | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesStandardIncludes.h | 25 | ||||
-rw-r--r-- | Source/CursesDialog/form/fld_attr.c | 8 | ||||
-rw-r--r-- | Source/CursesDialog/form/form.h | 10 | ||||
-rw-r--r-- | Source/CursesDialog/form/form.priv.h | 6 | ||||
-rw-r--r-- | Source/CursesDialog/form/frm_driver.c | 19 | ||||
-rw-r--r-- | Source/CursesDialog/form/frm_post.c | 5 | ||||
-rw-r--r-- | Source/CursesDialog/form/frm_req_name.c | 6 |
10 files changed, 32 insertions, 69 deletions
diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 548f5a5..7d4e88c 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -26,13 +26,25 @@ set( CURSES_SRCS CursesDialog/ccmake ) -include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form - ${CMake_BINARY_DIR}/Source/CursesDialog/form) +if( NOT CMAKE_USE_SYSTEM_FORM ) + include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form + ${CMake_BINARY_DIR}/Source/CursesDialog/form) +endif() include_directories(${CURSES_INCLUDE_PATH}) add_executable(ccmake ${CURSES_SRCS} ) target_link_libraries(ccmake CMakeLib) -target_link_libraries(ccmake cmForm) +if(CMAKE_USE_SYSTEM_FORM) + target_link_libraries(ccmake + ${CURSES_FORM_LIBRARY} + ${CURSES_LIBRARY} + ) + if(CURSES_EXTRA_LIBRARY) + target_link_libraries(ccmake ${CURSES_EXTRA_LIBRARY}) + endif() +else() + target_link_libraries(ccmake cmForm) +endif() install(TARGETS ccmake DESTINATION bin) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 0734927..4200e9e 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -47,7 +47,7 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args, cmSystemTools::GetCMakeCursesCommand()); // create the arguments for the cmake object - std::string whereCMake = cmSystemTools::GetProgramPath(this->Args[0].c_str()); + std::string whereCMake = cmSystemTools::GetProgramPath(this->Args[0]); whereCMake += "/cmake"; this->Args[0] = whereCMake; this->CMakeInstance->SetArgs(this->Args); diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index cd93bc3..89e2238 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -69,7 +69,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) cstr = cstr.substr(0, cstr.size()-1); } - if ( cmSystemTools::FileIsDirectory(cstr.c_str()) ) + if ( cmSystemTools::FileIsDirectory(cstr) ) { cstr += "/"; } diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index b157a28..791ac9b 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -15,30 +15,13 @@ #define _MSE_INT_H #endif -#include <cmFormConfigure.h> - #if defined(__hpux) # define _BOOL_DEFINED # include <sys/time.h> -# define _XOPEN_SOURCE_EXTENDED -# include <curses.h> -# include <form.h> -# undef _XOPEN_SOURCE_EXTENDED -#else -/* figure out which curses.h to include */ -# if defined(CURSES_HAVE_NCURSES_H) -# include <ncurses.h> -# elif defined(CURSES_HAVE_NCURSES_NCURSES_H) -# include <ncurses/ncurses.h> -# elif defined(CURSES_HAVE_NCURSES_CURSES_H) -# include <ncurses/curses.h> -# else -# include <curses.h> -# endif - -# include <form.h> #endif +#include <form.h> + // This is a hack to prevent warnings about these functions being // declared but not referenced. #if defined(__sgi) && !defined(__GNUC__) @@ -57,10 +40,6 @@ public: }; #endif -#ifndef getmaxyx - #define getmaxyx(w,y,x) ((y) = getmaxy(w), (x) = getmaxx(w)) -#endif - // on some machines move erase and clear conflict with stl // so remove them from the namespace diff --git a/Source/CursesDialog/form/fld_attr.c b/Source/CursesDialog/form/fld_attr.c index 8619588..35ea903 100644 --- a/Source/CursesDialog/form/fld_attr.c +++ b/Source/CursesDialog/form/fld_attr.c @@ -29,13 +29,7 @@ /**************************************************************************** * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 * ****************************************************************************/ -#if defined(__hpux) - #define _XOPEN_SOURCE_EXTENDED -#endif - #include "form.priv.h" -#if defined(__hpux) - #undef _XOPEN_SOURCE_EXTENDED -#endif +#include "form.priv.h" MODULE_ID("$Id$") /*---------------------------------------------------------------------------- diff --git a/Source/CursesDialog/form/form.h b/Source/CursesDialog/form/form.h index 94f05af..1219cb5 100644 --- a/Source/CursesDialog/form/form.h +++ b/Source/CursesDialog/form/form.h @@ -47,7 +47,17 @@ # elif defined(CURSES_HAVE_NCURSES_CURSES_H) # include <ncurses/curses.h> # else +# if defined(__hpux) +# if defined(_XOPEN_SOURCE_EXTENDED) +# define HAVE__XOPEN_SOURCE_EXTENDED +# else +# define _XOPEN_SOURCE_EXTENDED +# endif +# endif # include <curses.h> +# if defined(__hpux) && !defined(HAVE__XOPEN_SOURCE_EXTENDED) +# undef _XOPEN_SOURCE_EXTENDED +# endif # endif #include <eti.h> diff --git a/Source/CursesDialog/form/form.priv.h b/Source/CursesDialog/form/form.priv.h index 3691f2f..8516a6f 100644 --- a/Source/CursesDialog/form/form.priv.h +++ b/Source/CursesDialog/form/form.priv.h @@ -33,12 +33,6 @@ #include "mf_common.h" #include "form.h" -/* get around odd bug on aCC and itanium */ -#if defined(__hpux) && defined(__ia64) -#define getmaxx __getmaxx -#define getmaxy __getmaxy -#endif - /* form status values */ #define _OVLMODE (0x04) /* Form is in overlay mode */ #define _WINDOW_MODIFIED (0x10) /* Current field window has been modified */ diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index b9611bf..26f580e 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -29,13 +29,7 @@ /**************************************************************************** * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 * ****************************************************************************/ -#if defined(__hpux) - #define _XOPEN_SOURCE_EXTENDED -#endif #include "form.priv.h" -#if defined(__hpux) - #undef _XOPEN_SOURCE_EXTENDED -#endif /* AIX seems to define this */ #undef lines @@ -357,12 +351,7 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win) assert(win && field); -#if defined(__LSB_VERSION__) getmaxyx(win, height, width); -#else - width = getmaxx(win); - height = getmaxy(win); -#endif for(row=0, pBuffer=field->buf; row < height; @@ -394,17 +383,13 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field) int pad; int len = 0; char *p; - int row, height; + int row, height, width; assert(win && field && field->buf ); pad = field->pad; p = field->buf; -#if defined(__LSB_VERSION__) - { int width; getmaxyx(win, height, width); } -#else - height = getmaxy(win); -#endif + getmaxyx(win, height, width); for(row=0; (row < height) && (row < field->drows); row++ ) { diff --git a/Source/CursesDialog/form/frm_post.c b/Source/CursesDialog/form/frm_post.c index 3c63de7..924fe6a 100644 --- a/Source/CursesDialog/form/frm_post.c +++ b/Source/CursesDialog/form/frm_post.c @@ -63,12 +63,7 @@ int post_form(FORM * form) RETURN(E_NOT_CONNECTED); formwin = Get_Form_Window(form); -#if defined(__LSB_VERSION__) getmaxyx(formwin, height, width); -#else - width = getmaxx(formwin); - height = getmaxy(formwin); -#endif if ((form->cols > width) || (form->rows > height)) RETURN(E_NO_ROOM); diff --git a/Source/CursesDialog/form/frm_req_name.c b/Source/CursesDialog/form/frm_req_name.c index b108dab..6fb9183 100644 --- a/Source/CursesDialog/form/frm_req_name.c +++ b/Source/CursesDialog/form/frm_req_name.c @@ -35,13 +35,7 @@ * Routines to handle external names of menu requests * ***************************************************************************/ -#if defined(__hpux) - #define _XOPEN_SOURCE_EXTENDED -#endif #include "form.priv.h" -#if defined(__hpux) - #undef _XOPEN_SOURCE_EXTENDED -#endif MODULE_ID("$Id$") |