Skip to content

Commit

Permalink
Merge pull request #1 from Corvusoft/master
Browse files Browse the repository at this point in the history
Update to main repo
  • Loading branch information
clrusby authored Jul 23, 2018
2 parents dc8f188 + 1b43b9a commit 5bf2e61
Show file tree
Hide file tree
Showing 256 changed files with 2,881 additions and 8,115 deletions.
24 changes: 24 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 1.0.{build}
image: Visual Studio 2015
configuration: Release
platform: x64
clone_folder: C:\projects\restbed
init:
- cmd: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"'
install:
- cmd: git submodule update --init --recursive
build_script:
- cmd: >-
mkdir c:\projects\restbed\build
cd c:\projects\restbed\build
cmake -G "Visual Studio 14 2015" -DBUILD_SSL=NO -DOPENSSL_ROOT_DIR=C:\OpenSSL-Win64 ..
cmake --build . --target ALL_BUILD --config Release
test_script:
- cmd: >-
cd c:\projects\restbed\build
ctest
deploy: off
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@
path = dependency/openssl
url = https://github.com/corvusoft/openssl-dependency
branch = OpenSSL_1_0_2-stable
[submodule "dependency/kashmir"]
path = dependency/kashmir
url = https://github.com/corvusoft/kashmir-dependency
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ matrix:
env:
- COMPILERCXX="g++-5"
- COMPILERC="gcc-5"
- OPENSSL_VERSION=openssl-1.1.0
- os: linux
compiler: clang
addons:
Expand All @@ -32,11 +33,10 @@ matrix:
before_script:
- if [ -n "$COMPILERC" ]; then export CC=$COMPILERC; fi
- if [ -n "$COMPILERCXX" ]; then export CXX=$COMPILERCXX; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OPENSSL_ROOT_DIR=/usr/local/opt/openssl; fi
- mkdir build
- cd build
- cmake -DBUILD_EXAMPLES=YES -DBUILD_TESTS=YES -DBUILD_SSL=YES ..
- cmake -DBUILD_SSL=NO ..

script: make -j3 && make test

notifications:
Expand Down
110 changes: 58 additions & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,88 +1,94 @@
# Copyright 2013-2017, Corvusoft Ltd, All Rights Reserved.
cmake_minimum_required( VERSION 2.8.10 )
cmake_minimum_required( VERSION 3.1.0 FATAL_ERROR )

project( "restbed" )
set( restbed_VERSION_MAJOR 4 )
set( restbed_VERSION_MINOR 5.0 )
set( restbed_VERSION ${restbed_VERSION_MAJOR}.${restbed_VERSION_MINOR} )
set( PACKAGE_VERSION ${restbed_VERSION} )
set( VERSION "${restbed_VERSION}" )
project( "restbed" VERSION 4.7.0 LANGUAGES CXX )
message( "Copyright 2013-2018, Corvusoft Ltd, All Rights Reserved." )

#
# Build Options
#
option( BUILD_SHARED "Build shared library." OFF )
option( BUILD_EXAMPLES "Build examples applications." OFF )
option( BUILD_TESTS "Build all available test suites." OFF )
option( BUILD_SSL "Build secure socket layer support." ON )

#
# Configuration
#
include( "${PROJECT_SOURCE_DIR}/cmake/configuration.cmake" )
set( CMAKE_CXX_STANDARD 11 )
set( INCLUDE_DIR "${PROJECT_SOURCE_DIR}/source" )
set( SOURCE_DIR "${PROJECT_SOURCE_DIR}/source/corvusoft/${PROJECT_NAME}" )

message( " ${Blue}Copyright 2013-2017, Corvusoft Ltd, All Rights Reserved.${Reset}" )
if ( NOT DEFINED CMAKE_INSTALL_LIBDIR )
set( CMAKE_INSTALL_LIBDIR library )
endif ( )

#
# Dependencies
#
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules" )
if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set( CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/distribution" CACHE PATH "Install path prefix" FORCE )
endif ( )

find_package( asio REQUIRED )
include_directories( SYSTEM ${asio_INCLUDE} )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_WIN32_WINNT=0x0601 /W4 /wd4068 /wd4702" )
endif ( )

if( NOT WIN32 )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -pedantic -Wno-unknown-pragmas" )
endif ( )

if ( UNIX AND NOT APPLE )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
endif ( )

if ( APPLE )
set( CMAKE_MACOSX_RPATH ON )
endif ( )

find_package( kashmir REQUIRED )
include_directories( SYSTEM ${kashmir_INCLUDE} )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake" )

find_package( asio REQUIRED )
find_package( catch REQUIRED )
if ( BUILD_SSL )
find_package( openssl REQUIRED )
include_directories( SYSTEM ${ssl_INCLUDE} )
endif ( )

include_directories( ${INCLUDE_DIR} SYSTEM ${asio_INCLUDE} ${kashmir_INCLUDE} ${ssl_INCLUDE} )

#
# Build
#
include( "${PROJECT_SOURCE_DIR}/cmake/manifest.cmake" )

include_directories( ${INCLUDE_DIR} )

add_library( ${PROJECT_NAME} ${MANIFEST} )

if ( BUILD_SHARED )
set_target_properties( ${PROJECT_NAME} PROPERTIES SOVERSION ${restbed_VERSION_MAJOR} VERSION ${restbed_VERSION} )
endif ( )
file( GLOB_RECURSE MANIFEST "${SOURCE_DIR}/*.cpp" )

set( STATIC_LIBRARY_NAME "${PROJECT_NAME}-static" )
add_library( ${STATIC_LIBRARY_NAME} STATIC ${MANIFEST} )
set_property( TARGET ${STATIC_LIBRARY_NAME} PROPERTY CXX_STANDARD 11 )
set_property( TARGET ${STATIC_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON )
set_target_properties( ${STATIC_LIBRARY_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} )
if ( BUILD_SSL )
target_link_libraries( ${PROJECT_NAME} LINK_PRIVATE ${ssl_LIBRARY} ${crypto_LIBRARY} )
target_link_libraries( ${STATIC_LIBRARY_NAME} LINK_PRIVATE ${ssl_LIBRARY_STATIC} ${crypto_LIBRARY_STATIC} )
else ( )
target_link_libraries( ${PROJECT_NAME} )
target_link_libraries( ${STATIC_LIBRARY_NAME} )
endif ( )

if ( BUILD_EXAMPLES )
find_package( pam )
find_package( syslog )
add_subdirectory( "${PROJECT_SOURCE_DIR}/example" )
set( SHARED_LIBRARY_NAME "${PROJECT_NAME}-shared" )
add_library( ${SHARED_LIBRARY_NAME} SHARED ${MANIFEST} )
set_property( TARGET ${SHARED_LIBRARY_NAME} PROPERTY CXX_STANDARD 11 )
set_property( TARGET ${SHARED_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON )
set_target_properties( ${SHARED_LIBRARY_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} )
set_target_properties( ${SHARED_LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} )
if ( BUILD_SSL )
target_link_libraries( ${SHARED_LIBRARY_NAME} LINK_PRIVATE ${ssl_LIBRARY_SHARED} ${crypto_LIBRARY_SHARED} )
else ( )
target_link_libraries( ${SHARED_LIBRARY_NAME} )
endif ( )

if ( BUILD_TESTS )
find_package( catch REQUIRED )

enable_testing( )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/unit" )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/acceptance" )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/regression" )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/integration" )
endif ( )
enable_testing( )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/unit" )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/feature" )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/regression" )
add_subdirectory( "${PROJECT_SOURCE_DIR}/test/integration" )

#
# Install
#
include( "${PROJECT_SOURCE_DIR}/cmake/artifacts.cmake" )

if ( NOT DEFINED CMAKE_INSTALL_LIBDIR )
set( CMAKE_INSTALL_LIBDIR library )
endif ( )
file( GLOB ARTIFACTS "${SOURCE_DIR}/*.hpp" )

install( FILES "${INCLUDE_DIR}/${PROJECT_NAME}" DESTINATION "${CMAKE_INSTALL_PREFIX}/include" )
install( FILES ${ARTIFACTS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/corvusoft/${PROJECT_NAME}" )
install( TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library )
install( TARGETS ${STATIC_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library )
install( TARGETS ${SHARED_LIBRARY_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library )
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2013-2017 Corvusoft Limited, United Kingdom.
Copyright 2013-2018 Corvusoft Limited, United Kingdom.
All rights reserved.

Everyone is permitted to copy and distribute verbatim copies of this
Expand Down
Loading

0 comments on commit 5bf2e61

Please sign in to comment.