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 )
|
|
|
|
|
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include )
|
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
|
|
|
SET(Boost_USE_STATIC_LIBS ON)
|
2012-09-08 02:57:00 +00:00
|
|
|
FIND_PACKAGE(Boost 1.51 COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context )
|
2012-09-08 02:50:37 +00:00
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
if( WIN32 )
|
|
|
|
|
set( RPCRT4 Rpcrt4 )
|
|
|
|
|
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 )
|
2012-09-08 02:50:37 +00:00
|
|
|
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 )
|
2013-06-05 19:19:00 +00:00
|
|
|
ADD_DEFINITIONS( -DBOOST_ALL_NO_LIB -DBOOST_THREAD_BUILD_LIB)
|
|
|
|
|
ADD_DEFINITIONS( -DWIN32)
|
|
|
|
|
# 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-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 )
|
|
|
|
|
|
2012-11-09 05:41:57 +00:00
|
|
|
FIND_PACKAGE( OpenSSL )
|
2012-09-08 02:50:37 +00:00
|
|
|
include_directories( ${Boost_INCLUDE_DIR} )
|
2012-10-29 20:19:17 +00:00
|
|
|
include_directories( ${OPENSSL_INCLUDE_DIR} )
|
2012-11-01 04:23:06 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
|
set( fc_sources
|
|
|
|
|
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
|
|
|
|
|
src/crypto/base36.cpp
|
2013-06-27 18:19:08 +00:00
|
|
|
src/crypto/base32.cpp
|
2013-06-05 19:19:00 +00:00
|
|
|
src/crypto/base64.cpp
|
|
|
|
|
src/crypto/base58.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
|
|
|
|
|
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-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-06-27 18:45:11 +00:00
|
|
|
vendor/cyoencode-1.0.2/src/CyoDecode.c
|
|
|
|
|
vendor/cyoencode-1.0.2/src/CyoEncode.c
|
2013-06-05 19:19:00 +00:00
|
|
|
# src/ssh/client.cpp
|
|
|
|
|
# src/ssh/process.cpp
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
IF( UNIX )
|
|
|
|
|
IF( ENABLE_ARM )
|
|
|
|
|
SET_PROPERTY( SOURCE
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_arm_aapcs_elf_gas.S
|
|
|
|
|
PROPERTY LANGUAGE C)
|
|
|
|
|
SET( boost_context_sources vendor/boost_1.51/libs/context/protected_stack_posix.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/stack_helper_posix.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_arm_aapcs_elf_gas.S
|
|
|
|
|
)
|
|
|
|
|
ELSE()
|
|
|
|
|
|
|
|
|
|
IF( APPLE )
|
|
|
|
|
SET_PROPERTY( SOURCE
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_macho_gas.S
|
|
|
|
|
PROPERTY LANGUAGE C)
|
|
|
|
|
SET( boost_context_sources vendor/boost_1.51/libs/context/stack_utils_posix.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/stack_allocator_posix.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/fcontext.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_macho_gas.S
|
|
|
|
|
)
|
|
|
|
|
ELSE (APPLE)
|
|
|
|
|
IF( CMAKE_SIZEOF_VOID_P EQUAL 4 )
|
|
|
|
|
SET_PROPERTY( SOURCE
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_elf_gas.S
|
|
|
|
|
PROPERTY LANGUAGE C)
|
|
|
|
|
SET( fcontext_asm vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_elf_gas.S )
|
|
|
|
|
ELSE( )
|
|
|
|
|
SET( fcontext_asm vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_elf_gas.S )
|
|
|
|
|
SET_PROPERTY( SOURCE
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_elf_gas.S
|
|
|
|
|
PROPERTY LANGUAGE C)
|
|
|
|
|
ENDIF( )
|
|
|
|
|
|
|
|
|
|
SET( boost_context_sources vendor/boost_1.51/libs/context/stack_utils_posix.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/stack_allocator_posix.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/fcontext.cpp
|
|
|
|
|
${fcontext_asm}
|
|
|
|
|
)
|
|
|
|
|
ENDIF(APPLE)
|
|
|
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
ENDIF( UNIX )
|
2012-11-01 04:23:06 +00:00
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
IF( WIN32 )
|
|
|
|
|
ENABLE_LANGUAGE(ASM_MASM)
|
|
|
|
|
# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa" )
|
|
|
|
|
|
|
|
|
|
SET( boost_context_sources vendor/boost_1.51/libs/context/fcontext.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/seh.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/stack_allocator_windows.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/stack_utils_windows.cpp
|
|
|
|
|
vendor/boost_1.51/libs/context/seh.cpp
|
|
|
|
|
)
|
|
|
|
|
IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
|
|
|
|
SET( boost_context_sources ${boost_context_sources}
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_x86_64_ms_pe_masm.asm )
|
|
|
|
|
ELSE() # 32bit
|
|
|
|
|
SET( boost_context_sources ${boost_context_sources}
|
|
|
|
|
vendor/boost_1.51/libs/context/asm/fcontext_i386_ms_pe_masm.asm )
|
|
|
|
|
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO" )
|
|
|
|
|
message(STATUS "")
|
|
|
|
|
message(STATUS "Note for Visual Studio 2012 projects:")
|
|
|
|
|
message(STATUS " Each time CMake regenerates your projects, you will need to:")
|
|
|
|
|
message(STATUS " Right-click on the 'fc' project and select 'Build Customizations', and")
|
|
|
|
|
message(STATUS " check the 'masm' customization.")
|
|
|
|
|
message(STATUS " then, go to the 'Properties' for the fcontext*.asm file, and change its ")
|
|
|
|
|
message(STATUS " item type from 'Does not participate in build' to 'Microsoft Macro Assembler'")
|
|
|
|
|
ENDIF()
|
2013-01-25 02:13:23 +00:00
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
ENDIF(WIN32)
|
2012-09-08 02:50:37 +00:00
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
set( sources
|
|
|
|
|
${fc_sources}
|
|
|
|
|
${boost_context_sources}
|
|
|
|
|
)
|
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
|
|
|
|
2012-09-08 02:50:37 +00:00
|
|
|
|