2012-09-08 02:50:37 +00:00
|
|
|
PROJECT( fc )
|
|
|
|
|
|
|
|
|
|
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.0 )
|
|
|
|
|
|
2013-03-10 06:53:32 +00:00
|
|
|
SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )
|
2013-06-05 19:19:00 +00:00
|
|
|
SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )
|
2012-09-08 02:50:37 +00:00
|
|
|
|
|
|
|
|
INCLUDE( VersionMacros )
|
|
|
|
|
INCLUDE( SetupTargetMacros )
|
2013-06-05 19:19:00 +00:00
|
|
|
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
|
|
|
|
|
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include )
|
2013-06-27 18:45:11 +00:00
|
|
|
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src )
|
2012-09-08 02:50:37 +00:00
|
|
|
|
|
|
|
|
SET( DEFAULT_HEADER_INSTALL_DIR include/\${target} )
|
|
|
|
|
SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
|
|
|
|
|
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
|
|
|
|
|
SET( CMAKE_DEBUG_POSTFIX _debug )
|
2013-06-05 19:19:00 +00:00
|
|
|
SET( BUILD_SHARED_LIBS NO )
|
2012-09-08 02:50:37 +00:00
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
if( WIN32 )
|
|
|
|
|
set( RPCRT4 Rpcrt4 )
|
2013-08-11 02:11:59 +00:00
|
|
|
#boost
|
|
|
|
|
SET( Boost_INCLUDE_DIR $ENV{BOOST_ROOT} )
|
2013-08-11 13:59:55 +00:00
|
|
|
#Using shared libs for boost on windows
|
2013-08-11 02:11:59 +00:00
|
|
|
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 )
|
2013-06-05 19:19:00 +00:00
|
|
|
endif( WIN32 )
|
2012-09-08 02:50:37 +00:00
|
|
|
|
|
|
|
|
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
|
|
|
|
|
|
|
|
|
|
IF( WIN32 )
|
2013-06-05 19:19:00 +00:00
|
|
|
ADD_DEFINITIONS( -DWIN32 )
|
2013-08-11 13:59:55 +00:00
|
|
|
ADD_DEFINITIONS( -DNOMINMAX )
|
2012-09-08 02:50:37 +00:00
|
|
|
ADD_DEFINITIONS( -D_WIN32_WINNT=0x0501 )
|
|
|
|
|
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
2013-08-11 13:59:55 +00:00
|
|
|
ADD_DEFINITIONS( -D_SCL_SERCURE_NO_WARNINGS )
|
|
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
# Activate C++ exception handling
|
|
|
|
|
IF (NOT CMAKE_CXX_FLAGS MATCHES "/EHsc")
|
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
|
|
|
|
ENDIF()
|
2012-09-08 02:50:37 +00:00
|
|
|
ELSE(WIN32)
|
2013-08-11 02:11:59 +00:00
|
|
|
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include )
|
2013-06-05 19:19:00 +00:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs -fmax-errors=3" )
|
2012-09-08 02:50:37 +00:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
|
|
if( UNIX )
|
|
|
|
|
if( NOT APPLE )
|
|
|
|
|
set(rt_library rt )
|
|
|
|
|
set(pthread_library pthread)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
option( UNITY_BUILD OFF )
|
|
|
|
|
|
|
|
|
|
include_directories( ${Boost_INCLUDE_DIR} )
|
2013-08-24 08:25:03 +00:00
|
|
|
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/salsa20 )
|
2012-11-01 04:23:06 +00:00
|
|
|
|
2013-10-11 02:19:01 +00:00
|
|
|
FIND_PACKAGE( OpenSSL )
|
|
|
|
|
include_directories( ${OPENSSL_INCLUDE_DIR} )
|
2013-06-27 18:19:08 +00:00
|
|
|
SET( ALL_OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE})
|
2013-06-05 19:19:00 +00:00
|
|
|
|
2013-10-11 02:19:01 +00:00
|
|
|
if( UNIX )
|
|
|
|
|
SET(SALSA_SRC vendor/salsa20/salsa20.s)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
set( fc_sources
|
2013-07-27 03:20:06 +00:00
|
|
|
src/uint128.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
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
|
2013-07-04 01:35:30 +00:00
|
|
|
src/interprocess/mmap_struct.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
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
|
2013-08-13 16:58:55 +00:00
|
|
|
src/crypto/openssl.cpp
|
|
|
|
|
src/crypto/aes.cpp
|
2013-07-17 15:50:45 +00:00
|
|
|
src/crypto/crc.cpp
|
|
|
|
|
src/crypto/city.cpp
|
2013-06-27 18:19:08 +00:00
|
|
|
src/crypto/base32.cpp
|
2013-07-17 19:00:13 +00:00
|
|
|
src/crypto/base36.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
src/crypto/base58.cpp
|
2013-07-17 19:00:13 +00:00
|
|
|
src/crypto/base64.cpp
|
2013-06-27 18:19:08 +00:00
|
|
|
src/crypto/bigint.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
src/crypto/hex.cpp
|
|
|
|
|
src/crypto/sha1.cpp
|
2013-07-28 14:49:45 +00:00
|
|
|
src/crypto/ripemd160.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
src/crypto/sha256.cpp
|
2013-06-27 18:19:08 +00:00
|
|
|
src/crypto/sha224.cpp
|
|
|
|
|
src/crypto/sha512.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
src/crypto/dh.cpp
|
|
|
|
|
src/crypto/blowfish.cpp
|
2013-06-07 00:37:04 +00:00
|
|
|
src/crypto/elliptic.cpp
|
2013-08-24 08:25:03 +00:00
|
|
|
src/crypto/salsa20.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
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
|
2013-08-13 16:58:55 +00:00
|
|
|
src/compress/smaz.cpp
|
2013-06-27 18:45:11 +00:00
|
|
|
vendor/cyoencode-1.0.2/src/CyoDecode.c
|
|
|
|
|
vendor/cyoencode-1.0.2/src/CyoEncode.c
|
2013-08-24 08:25:03 +00:00
|
|
|
# vendor/salsa20/ecrypt.c
|
2013-10-11 02:19:01 +00:00
|
|
|
${SALSA_SRC}
|
2013-06-05 19:19:00 +00:00
|
|
|
)
|
2013-08-24 08:25:03 +00:00
|
|
|
SET_PROPERTY( SOURCE
|
|
|
|
|
vendor/salsa20/salsa20.s
|
|
|
|
|
PROPERTY LANGUAGE C)
|
2012-09-08 02:50:37 +00:00
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
set( sources
|
|
|
|
|
${fc_sources}
|
|
|
|
|
)
|
2013-08-13 17:28:53 +00:00
|
|
|
add_subdirectory( vendor/easylzma )
|
2012-10-26 05:03:47 +00:00
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
setup_library( fc SOURCES ${sources} LIBRARY_TYPE STATIC )
|
2013-02-05 04:08:48 +00:00
|
|
|
|
2013-08-13 16:58:55 +00:00
|
|
|
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} )
|
2013-10-11 02:19:01 +00:00
|
|
|
set( BOOST_LIBRARIES ${BOOST_LIBRARIES} PARENT_SCOPE )
|
2013-08-13 16:58:55 +00:00
|
|
|
|
|
|
|
|
#add_executable( test_compress tests/compress.cpp )
|
|
|
|
|
#target_link_libraries( test_compress fc ${BOOST_LIBRARIES} )
|
2013-11-13 19:51:29 +00:00
|
|
|
#add_executable( test_aes tests/aes_test.cpp )
|
|
|
|
|
#target_link_libraries( test_aes ${pthread_library} ${rt_library} fc ${BOOST_LIBRARIES} ${rt_library} ${pthread_library} ${BOOST_LIBRARIES} )
|
2013-08-19 18:44:13 +00:00
|
|
|
#add_executable( test_sleep tests/sleep.cpp )
|
|
|
|
|
#target_link_libraries( test_sleep fc ${BOOST_LIBRARIES} )
|
2012-09-08 02:50:37 +00:00
|
|
|
|