CMakeLists.txt

branch
protocol5
changeset 84
3bd32eec3d57
parent 83
08bfc3d9d2ae
child 87
53c2aecb9704
equal deleted inserted replaced
80:f992b027374b 84:3bd32eec3d57
1 cmake_minimum_required (VERSION 2.4) 1 cmake_minimum_required (VERSION 2.4)
2 cmake_policy (SET CMP0003 NEW)
2 project (zfc9000) 3 project (zfc9000)
3 4
4 add_library (huffman STATIC 5 add_library (huffman STATIC
5 huffman/bitreader.cpp 6 huffman/bitreader.cpp
6 huffman/bitwriter.cpp 7 huffman/bitwriter.cpp
8 huffman/huffman.cpp 9 huffman/huffman.cpp
9 ) 10 )
10 11
11 set (SOURCE_FILES 12 set (SOURCE_FILES
12 sources/coloredline.cpp 13 sources/coloredline.cpp
13 sources/format.cpp
14 sources/interface.cpp 14 sources/interface.cpp
15 sources/main.cpp 15 sources/main.cpp
16 sources/md5.cpp 16 sources/md5.cpp
17 sources/mystring.cpp 17 sources/mystring.cpp
18 sources/version.cpp 18 sources/version.cpp
22 sources/network/udpsocket.cpp 22 sources/network/udpsocket.cpp
23 ) 23 )
24 24
25 set (CURSES_NEED_NCURSES, True) 25 set (CURSES_NEED_NCURSES, True)
26 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall") 26 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")
27 find_package (Curses) 27
28 if (NOT WIN32)
29 find_package (Curses)
30 endif()
31
32 if (MINGW)
33 set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
34 endif()
35
28 include_directories (${CURSES_INCUDE_DIRS}) 36 include_directories (${CURSES_INCUDE_DIRS})
29 include_directories (${CMAKE_CURRENT_BINARY_DIR}) 37 include_directories (${CMAKE_CURRENT_BINARY_DIR})
30 include_directories (huffman) 38 include_directories (huffman)
31 add_executable (${PROJECT_NAME} ${SOURCE_FILES}) 39 add_executable (${PROJECT_NAME} ${SOURCE_FILES})
32 target_link_libraries (${PROJECT_NAME} ${CURSES_LIBRARIES} huffman) 40 target_link_libraries (${PROJECT_NAME} huffman)
41
42 if (NOT WIN32)
43 target_link_libraries (${PROJECT_NAME} ${CURSES_LIBRARIES})
44 else()
45 target_link_libraries (${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}/pdcurses.a wsock32 ws2_32)
46 endif()
33 47
34 add_custom_target (make_hginfo_h 48 add_custom_target (make_hginfo_h
35 COMMAND python 49 COMMAND python
36 "${CMAKE_SOURCE_DIR}/updaterevision/updaterevision.py" 50 "${CMAKE_SOURCE_DIR}/updaterevision/updaterevision.py"
37 "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h") 51 "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h")

mercurial