-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Corvusoft/master
Update to main repo
- Loading branch information
Showing
256 changed files
with
2,881 additions
and
8,115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.