--- a/CMakeLists.txt Thu Jul 23 17:51:35 2015 +0300 +++ b/CMakeLists.txt Thu Jul 23 18:07:39 2015 +0300 @@ -54,13 +54,13 @@ target_link_libraries (${TARGET_NAME} huffman) if (WIN32) - add_definitions (-D_CRT_SECURE_NO_WARNINGS) - target_link_libraries (${TARGET_NAME} wsock32 ws2_32) - if (PDCURSES_PATH OR PDCURSES_WIN32A_PATH) if (NOT PDCURSES_PATH) set (PDCURSES_PATH "${PDCURSES_WIN32A_PATH}") add_definitions (-DHAVE_PDCURSES_WIN32A) + message (STATUS "Using external PDCurses-win32a in ${PDCURSES_WIN32A_PATH}") + else() + message (STATUS "Using external PDCurses in ${PDCURSES_PATH}") endif() include_directories (${PDCURSES_PATH}/include) @@ -71,14 +71,64 @@ target_link_libraries (${TARGET_NAME} ${PDCURSES_PATH}/lib/pdcurses.lib) endif() else() - message (SEND_ERROR "Must provide PDCURSES_PATH or PDCURSES_WIN32A_PATH on Windows") + add_library (pdcurses STATIC + pdcurses/addch.c + pdcurses/addchstr.c + pdcurses/addstr.c + pdcurses/attr.c + pdcurses/beep.c + pdcurses/bkgd.c + pdcurses/border.c + pdcurses/clear.c + pdcurses/color.c + pdcurses/debug.c + pdcurses/delch.c + pdcurses/deleteln.c + pdcurses/deprec.c + pdcurses/getch.c + pdcurses/getstr.c + pdcurses/getyx.c + pdcurses/inch.c + pdcurses/inchstr.c + pdcurses/initscr.c + pdcurses/inopts.c + pdcurses/insch.c + pdcurses/insstr.c + pdcurses/instr.c + pdcurses/kernel.c + pdcurses/keyname.c + pdcurses/mouse.c + pdcurses/move.c + pdcurses/outopts.c + pdcurses/overlay.c + pdcurses/pad.c + pdcurses/panel.c + pdcurses/pdcclip.c + pdcurses/pdcdisp.c + pdcurses/pdcgetsc.c + pdcurses/pdckbd.c + pdcurses/pdcscrn.c + pdcurses/pdcsetsc.c + pdcurses/pdcutil.c + pdcurses/printw.c + pdcurses/refresh.c + pdcurses/scanw.c + pdcurses/scroll.c + pdcurses/scr_dump.c + pdcurses/slk.c + pdcurses/termattr.c + pdcurses/terminfo.c + pdcurses/touch.c + pdcurses/util.c + pdcurses/window.c + ) + target_link_libraries (${TARGET_NAME} pdcurses) + message (STATUS "Using internal pdcurses") + endif() - if (MINGW) - message (SEND_ERROR "This path must contain pdcurses.a in lib/, and curses.h in include/.") - else() - message (SEND_ERROR "This path must contain pdcurses.lib in lib/, and curses.h in include/.") - endif() - endif() + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + target_link_libraries (${TARGET_NAME} wsock32 ws2_32) + include_directories (pdcurses) else() include_directories (${CURSES_INCUDE_DIRS}) # sic target_link_libraries (${TARGET_NAME} ${CURSES_LIBRARIES})