-
Notifications
You must be signed in to change notification settings - Fork 215
/
CMakeLists.txt
141 lines (123 loc) · 4.23 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
PROJECT( fc )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.0 )
SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )
SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )
INCLUDE( VersionMacros )
INCLUDE( SetupTargetMacros )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src )
SET( DEFAULT_HEADER_INSTALL_DIR include/\${target} )
SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
SET( CMAKE_DEBUG_POSTFIX _debug )
SET( BUILD_SHARED_LIBS NO )
if( WIN32 )
set( RPCRT4 Rpcrt4 )
#boost
SET( Boost_INCLUDE_DIR $ENV{BOOST_ROOT} )
#Using shared libs for boost on windows
else(WIN32)
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 context )
endif( WIN32 )
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
IF( WIN32 )
ADD_DEFINITIONS( -DWIN32 )
ADD_DEFINITIONS( -DNOMINMAX )
ADD_DEFINITIONS( -D_WIN32_WINNT=0x0501 )
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -D_SCL_SERCURE_NO_WARNINGS )
# Activate C++ exception handling
IF (NOT CMAKE_CXX_FLAGS MATCHES "/EHsc")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
ENDIF()
ELSE(WIN32)
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs -fmax-errors=3" )
ENDIF(WIN32)
if( UNIX )
if( NOT APPLE )
set(rt_library rt )
set(pthread_library pthread)
endif()
endif()
option( UNITY_BUILD OFF )
FIND_PACKAGE( OpenSSL )
include_directories( ${Boost_INCLUDE_DIR} )
include_directories( ${OPENSSL_INCLUDE_DIR} )
SET( ALL_OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE})
set( fc_sources
src/uint128.cpp
src/variant.cpp
src/exception.cpp
src/variant_object.cpp
src/thread/thread.cpp
src/thread/future.cpp
src/thread/task.cpp
src/thread/spin_lock.cpp
src/thread/spin_yield_lock.cpp
src/thread/mutex.cpp
src/asio.cpp
src/string.cpp
src/shared_ptr.cpp
src/time.cpp
src/io/iostream.cpp
src/io/datastream.cpp
src/io/buffered_iostream.cpp
src/io/fstream.cpp
src/io/sstream.cpp
src/io/json.cpp
src/io/varint.cpp
src/filesystem.cpp
src/interprocess/process.cpp
src/interprocess/file_mapping.cpp
src/interprocess/mmap_struct.cpp
src/rpc/json_connection.cpp
src/log/log_message.cpp
src/log/logger.cpp
src/log/appender.cpp
src/log/console_appender.cpp
src/log/file_appender.cpp
src/log/logger_config.cpp
src/crypto/openssl.cpp
src/crypto/aes.cpp
src/crypto/crc.cpp
src/crypto/city.cpp
src/crypto/base32.cpp
src/crypto/base36.cpp
src/crypto/base58.cpp
src/crypto/base64.cpp
src/crypto/bigint.cpp
src/crypto/hex.cpp
src/crypto/sha1.cpp
src/crypto/ripemd160.cpp
src/crypto/sha256.cpp
src/crypto/sha224.cpp
src/crypto/sha512.cpp
src/crypto/dh.cpp
src/crypto/blowfish.cpp
src/crypto/elliptic.cpp
src/network/tcp_socket.cpp
src/network/udp_socket.cpp
src/network/http/http_connection.cpp
src/network/http/http_server.cpp
src/network/ip.cpp
src/network/resolve.cpp
src/network/url.cpp
src/compress/smaz.cpp
vendor/cyoencode-1.0.2/src/CyoDecode.c
vendor/cyoencode-1.0.2/src/CyoEncode.c
)
set( sources
${fc_sources}
)
add_subdirectory( vendor/easylzma )
setup_library( fc SOURCES ${sources} LIBRARY_TYPE STATIC )
set( BOOST_LIBRARIES ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_CHRONO_LIBRARY} ${ALL_OPENSSL_LIBRARIES} ${Boost_COROUTINE_LIBRARY} ${Boost_CONTEXT_LIBRARY} )
#add_executable( test_compress tests/compress.cpp )
#target_link_libraries( test_compress fc ${BOOST_LIBRARIES} )
#add_executable( test_aes tests/aes_test.cpp )
#target_link_libraries( test_aes fc ${BOOST_LIBRARIES} )
#add_executable( test_sleep tests/sleep.cpp )
#target_link_libraries( test_sleep fc ${BOOST_LIBRARIES} )