52 include_directories (huffman) |
52 include_directories (huffman) |
53 add_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) |
53 add_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) |
54 target_link_libraries (${TARGET_NAME} huffman) |
54 target_link_libraries (${TARGET_NAME} huffman) |
55 |
55 |
56 if (WIN32) |
56 if (WIN32) |
57 add_definitions (-D_CRT_SECURE_NO_WARNINGS) |
|
58 target_link_libraries (${TARGET_NAME} wsock32 ws2_32) |
|
59 |
|
60 if (PDCURSES_PATH OR PDCURSES_WIN32A_PATH) |
57 if (PDCURSES_PATH OR PDCURSES_WIN32A_PATH) |
61 if (NOT PDCURSES_PATH) |
58 if (NOT PDCURSES_PATH) |
62 set (PDCURSES_PATH "${PDCURSES_WIN32A_PATH}") |
59 set (PDCURSES_PATH "${PDCURSES_WIN32A_PATH}") |
63 add_definitions (-DHAVE_PDCURSES_WIN32A) |
60 add_definitions (-DHAVE_PDCURSES_WIN32A) |
|
61 message (STATUS "Using external PDCurses-win32a in ${PDCURSES_WIN32A_PATH}") |
|
62 else() |
|
63 message (STATUS "Using external PDCurses in ${PDCURSES_PATH}") |
64 endif() |
64 endif() |
65 |
65 |
66 include_directories (${PDCURSES_PATH}/include) |
66 include_directories (${PDCURSES_PATH}/include) |
67 |
67 |
68 if (MINGW) |
68 if (MINGW) |
69 target_link_libraries (${TARGET_NAME} ${PDCURSES_PATH}/lib/pdcurses.a) |
69 target_link_libraries (${TARGET_NAME} ${PDCURSES_PATH}/lib/pdcurses.a) |
70 else() |
70 else() |
71 target_link_libraries (${TARGET_NAME} ${PDCURSES_PATH}/lib/pdcurses.lib) |
71 target_link_libraries (${TARGET_NAME} ${PDCURSES_PATH}/lib/pdcurses.lib) |
72 endif() |
72 endif() |
73 else() |
73 else() |
74 message (SEND_ERROR "Must provide PDCURSES_PATH or PDCURSES_WIN32A_PATH on Windows") |
74 add_library (pdcurses STATIC |
|
75 pdcurses/addch.c |
|
76 pdcurses/addchstr.c |
|
77 pdcurses/addstr.c |
|
78 pdcurses/attr.c |
|
79 pdcurses/beep.c |
|
80 pdcurses/bkgd.c |
|
81 pdcurses/border.c |
|
82 pdcurses/clear.c |
|
83 pdcurses/color.c |
|
84 pdcurses/debug.c |
|
85 pdcurses/delch.c |
|
86 pdcurses/deleteln.c |
|
87 pdcurses/deprec.c |
|
88 pdcurses/getch.c |
|
89 pdcurses/getstr.c |
|
90 pdcurses/getyx.c |
|
91 pdcurses/inch.c |
|
92 pdcurses/inchstr.c |
|
93 pdcurses/initscr.c |
|
94 pdcurses/inopts.c |
|
95 pdcurses/insch.c |
|
96 pdcurses/insstr.c |
|
97 pdcurses/instr.c |
|
98 pdcurses/kernel.c |
|
99 pdcurses/keyname.c |
|
100 pdcurses/mouse.c |
|
101 pdcurses/move.c |
|
102 pdcurses/outopts.c |
|
103 pdcurses/overlay.c |
|
104 pdcurses/pad.c |
|
105 pdcurses/panel.c |
|
106 pdcurses/pdcclip.c |
|
107 pdcurses/pdcdisp.c |
|
108 pdcurses/pdcgetsc.c |
|
109 pdcurses/pdckbd.c |
|
110 pdcurses/pdcscrn.c |
|
111 pdcurses/pdcsetsc.c |
|
112 pdcurses/pdcutil.c |
|
113 pdcurses/printw.c |
|
114 pdcurses/refresh.c |
|
115 pdcurses/scanw.c |
|
116 pdcurses/scroll.c |
|
117 pdcurses/scr_dump.c |
|
118 pdcurses/slk.c |
|
119 pdcurses/termattr.c |
|
120 pdcurses/terminfo.c |
|
121 pdcurses/touch.c |
|
122 pdcurses/util.c |
|
123 pdcurses/window.c |
|
124 ) |
|
125 target_link_libraries (${TARGET_NAME} pdcurses) |
|
126 message (STATUS "Using internal pdcurses") |
|
127 endif() |
75 |
128 |
76 if (MINGW) |
129 add_definitions (-D_CRT_SECURE_NO_WARNINGS) |
77 message (SEND_ERROR "This path must contain pdcurses.a in lib/, and curses.h in include/.") |
130 target_link_libraries (${TARGET_NAME} wsock32 ws2_32) |
78 else() |
131 include_directories (pdcurses) |
79 message (SEND_ERROR "This path must contain pdcurses.lib in lib/, and curses.h in include/.") |
|
80 endif() |
|
81 endif() |
|
82 else() |
132 else() |
83 include_directories (${CURSES_INCUDE_DIRS}) # sic |
133 include_directories (${CURSES_INCUDE_DIRS}) # sic |
84 target_link_libraries (${TARGET_NAME} ${CURSES_LIBRARIES}) |
134 target_link_libraries (${TARGET_NAME} ${CURSES_LIBRARIES}) |
85 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -std=c++0x") |
135 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -std=c++0x") |
86 endif() |
136 endif() |