-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
169 lines (144 loc) · 4.17 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
PROJECT( tornet )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.0 )
SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )
INCLUDE( VersionMacros )
INCLUDE( SetupTargetMacros )
SET( DEFAULT_HEADER_INSTALL_DIR include/\${target} )
SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
SET( CMAKE_DEBUG_POSTFIX _debug )
IF( WIN32 )
ADD_DEFINITIONS( -DBOOST_CONTEXT_NO_LIB )
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -D_WIN32_WINNT=0x0501 )
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
ENDIF(WIN32)
if( UNIX )
if( NOT APPLE )
set(rt_library rt )
set(pthread_library pthread)
endif()
endif()
FIND_PACKAGE( Wt REQUIRED )
INCLUDE_DIRECTORIES( ${Wt_INCLUDE_DIR} )
find_package( Qt4 REQUIRED )
add_definitions( -DQT_NO_KEYWORDS )
#find_package( Protobuf REQUIRED )
FIND_PACKAGE( OpenSSL REQUIRED )
SET(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost 1.51 COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework regex random )
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
include_directories( ${Boost_INCLUDE_DIR} )
include_directories( ${QT_QTCORE_INCLUDE_DIR} )
include_directories( ${QT_QTGUI_INCLUDE_DIR} )
include_directories( fc/include )
#include_directories( ../reflect/include )
include_directories( include )
include_directories( cafs )
include_directories( /usr/include )
include_directories( /opt/local/include/db53 )
link_directories( /opt/local/lib/db53 )
#set( BerkeleyDB_LIBRARY /opt/local/lib/db53/libdb_cxx.a )
set( BerkeleyDB_LIBRARY -ldb_cxx )
add_subdirectory(fc)
add_subdirectory(context)
SET( sources
cafs/cafs.cpp
cafs/cafs_file_db.cpp
src/db/chunk.cpp
src/db/peer.cpp
src/db/publish.cpp
# src/db/name.cpp
src/chunk_service.cpp
# src/name_service_client.cpp
# src/archive.cpp
# src/main.cpp
src/tprox.cpp
src/node.cpp
src/connection.cpp
src/buffer.cpp
src/channel.cpp
src/kad.cpp
src/kbucket.cpp
# src/name_service.cpp
src/udt_test_service.cpp
src/udt_channel.cpp
src/miss_list.cpp
src/chunk_search.cpp
src/chunk_service_client.cpp
# src/download_status.cpp
# src/tornet_app.cpp
src/chisq.c
src/raw_rpc.cpp
# src/webgui/WTornetApplication.cpp
# src/webgui/WTornetResource.cpp
# src/webgui/WUserItemModel.cpp
# src/webgui/dbo.cpp
# src/webgui/sql_session.cpp
# main.cpp
# gui/QBind.cpp
# net/channel.cpp
# net/node.cpp
# net/kad.cpp
# net/udt_channel.cpp
# net/detail/miss_list.cpp
# net/detail/connection.cpp
# net/detail/node_private.cpp
# rpc/connection.cpp
# rpc/service.cpp
# rpc/udp_connection.cpp
# rpc/udt_connection.cpp
# services/accounting.cpp
# services/chat.cpp
# services/calc.cpp
# services/chunk_service.cpp
# services/chunk_session.cpp
# services/chunk_search.cpp
# db/peer.cpp
# db/chunk.cpp
# db/publish.cpp
)
SET( moc_headers
gui/QBind.hpp
)
#QT4_WRAP_UI( sources gui/main.ui )
#QT4_WRAP_CPP( sources ${moc_headers} )
SET( CXX_FLAGS -Wall )
SET( libraries
fc
boost_context
${Wt_DEBUG_LIBRARIES}
${Wt_HTTP_LIBRARY}
${Wt_EXT_LIBRARY}
${BerkeleyDB_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_ASIO_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SIGNALS_LIBRARY}
${Boost_REGEX_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${OPENSSL_CRYPTO_LIBRARY}
${OPENSSL_CRYPTO_LIBRARIES}
${OPENSSL_SSL_LIBRARIES}
z
${Boost_RANDOM_LIBRARY}
${rt_library}
${pthread_library}
)
SET( MACOSX_BUNDLE_INFO_STRING "TornetInfoString" )
SET( MACOSX_BUNDLE_BUNDLE_NAME "TornetBundleName" )
#add_executable( tornet
# MACOSX_BUNDLE
# ${sources} )
#target_link_libraries( tornet ${libraries} )
add_executable( tprox ${sources} )
target_link_libraries( tprox ${libraries} )
#add_executable( cafst cafs_main.cpp cafs/cafs.cpp cafs/cafs_file_db.cpp src/chisq.c)
#target_link_libraries( cafst ${libraries} )