Thu, 23 Jul 2015 00:16:47 +0300
some work on MSVC support (still doesn't work yet...)
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | cmake_minimum_required (VERSION 2.4) |
81
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
2 | cmake_policy (SET CMP0003 NEW) |
87
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
3 | project (ZFC9000) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
4 | string (TOLOWER ${CMAKE_PROJECT_NAME} TARGET_NAME) |
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | |
76
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
6 | add_library (huffman STATIC |
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
7 | huffman/bitreader.cpp |
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
8 | huffman/bitwriter.cpp |
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
9 | huffman/huffcodec.cpp |
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
10 | huffman/huffman.cpp |
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
11 | ) |
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
12 | |
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | set (SOURCE_FILES |
46
19be47c9bab7
- renamed RendererLine to ColoredLine and split it into its own files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
14 | sources/coloredline.cpp |
14
33b8f428bacb
- begin work on interface - input line works for the most part :)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
15 | sources/interface.cpp |
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | sources/main.cpp |
10
3874575d924d
- begin work on rcon sessions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
8
diff
changeset
|
17 | sources/md5.cpp |
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | sources/mystring.cpp |
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | sources/version.cpp |
5 | 20 | sources/network/bytestream.cpp |
21 | sources/network/ipaddress.cpp | |
10
3874575d924d
- begin work on rcon sessions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
8
diff
changeset
|
22 | sources/network/rconsession.cpp |
6 | 23 | sources/network/udpsocket.cpp |
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | ) |
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | |
87
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
26 | set (HEADER_FILES |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
27 | sources/basics.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
28 | sources/coloredline.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
29 | sources/geometry.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
30 | sources/interface.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
31 | sources/list.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
32 | sources/main.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
33 | sources/md5.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
34 | sources/mystring.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
35 | sources/network/bytestream.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
36 | sources/network/ipaddress.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
37 | sources/network/rconsession.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
38 | sources/network/udpsocket.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
39 | sources/range.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
40 | sources/version.h |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
41 | ) |
81
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
42 | |
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
43 | if (NOT WIN32) |
87
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
44 | find_package (Curses REQUIRED) |
81
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
45 | endif() |
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
46 | |
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
47 | if (MINGW) |
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
48 | set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static") |
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
49 | endif() |
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
50 | |
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | include_directories (${CMAKE_CURRENT_BINARY_DIR}) |
76
6de6d9a64ebd
- moved huffman from sources/ to top level because it's external
Teemu Piippo <crimsondusk64@gmail.com>
parents:
46
diff
changeset
|
52 | include_directories (huffman) |
87
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
53 | add_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
54 | target_link_libraries (${TARGET_NAME} huffman) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
55 | |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
56 | if (WIN32) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
57 | add_definitions ("/Za /D_CRT_SEURE_NO_WARNINGS") |
81
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
58 | |
87
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
59 | if (NOT PDCURSES_WIN32A_PATH) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
60 | message (SEND_ERROR "Must give PDCURSES_WIN32A_PATH on Windows") |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
61 | else() |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
62 | include_directories (${PDCURSES_WIN32A_PATH}/include) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
63 | target_link_libraries (${TARGET_NAME} ${PDCURSES_WIN32A_PATH}/lib/pdcurses.a) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
64 | target_link_libraries (${TARGET_NAME} wsock32 ws2_32) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
65 | endif() |
81
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
66 | else() |
87
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
67 | include_directories (${CURSES_INCUDE_DIRS}) # sic |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
68 | target_link_libraries (${TARGET_NAME} ${CURSES_LIBRARIES}) |
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
69 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -std=c++0x") |
81
a18aaf460648
Allow compilation on Windows/MinGW
Teemu Piippo <crimsondusk64@gmail.com>
parents:
76
diff
changeset
|
70 | endif() |
1
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
71 | |
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
72 | add_custom_target (make_hginfo_h |
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
73 | COMMAND python |
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | "${CMAKE_SOURCE_DIR}/updaterevision/updaterevision.py" |
4dd5bde4e777
- a whole lot of supplementary source code!!
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
75 | "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h") |
87
53c2aecb9704
some work on MSVC support (still doesn't work yet...)
Teemu Piippo <tsapii@utu.fi>
parents:
83
diff
changeset
|
76 | add_dependencies (${TARGET_NAME} make_hginfo_h) |